Azure / Azure/data-api-builder

Multiple mutations not supported in PGSQL

Offen
#2,485 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement Multiple mutations triage
Vorherrschende Sprache
C#
Sterne
1.5k
Forks
370
Ø Merge
3 T. 22 Std.
Gemergte PRs (30 T.)
9

Beschreibung

### What happened?

**Current behavior**
I am using the following [tutorial](https://learn.microsoft.com/en-us/azure/data-api-builder/how-to-multiple-mutations) and while using the following query
```
mutation {
createBook(
item: {
id: 1
title: "Introduction to Data API builder"
pages: 200
years: 2024
chapters: [
{
id: 2
name: "Configuration files", pages: 150
}
{
id: 3
name: "Running", pages: 50
}
]
}
) {
id
title
pages
years
chapters {
items {
name
pages
}
}
}
}
````
I get the following error;

```
{
"errors": [
{
"message": "The specified input object field `chapters` does not exist.",
"locations": [
{
"line": 8,
"column": 7
}
],
"path": [
"createBook"
],
"extensions": {
"field": "chapters",
"specifiedBy": "http://spec.graphql.org/October2021/#sec-Input-Object-Field-Names"
}
}
]
}
```

dab-config.json

```
{
"$schema": "https://github.com/Azure/data-api-builder/releases/download/v1.3.19/dab.draft.schema.json",
"data-source": {
"database-type": "postgresql",
"connection-string": "Host=localhost;Port=5431;Database=postgres;User ID=postgres;Password=password;",
"options": {}
},
"runtime": {
"rest": {
"enabled": true,
"path": "/api",
"request-body-strict": true
},
"graphql": {
"enabled": true,
"path": "/graphql",
"allow-introspection": true
},
"host": {
"cors": {
"origins": [],
"allow-credentials": false
},
"authentication": {
"provider": "StaticWebApps"
},
"mode": "development"
}
},
"entities": {
"Book": {
"source": {
"object": "books",
"type": "table"
},
"graphql": {
"enabled": true,
"type": {
"singular": "Book",
"plural": "Books"
}
},
"rest": {
"enabled": true
},
"permissions": [
{
"role": "anonymous",
"actions": [
{
"action": "*"
}
]
}
],
"relationships": {
"chapters": {
"cardinality": "many",
"target.entity": "Chapter",
"source.fields": [],
"target.fields": [],
"linking.source.fields": [],
"linking.target.fields": []
}
}
},
"Chapter": {
"source": {
"object": "chapters",
"type": "table"
},
"graphql": {
"enabled": true,
"type": {
"singular": "Chapter",
"plural": "Chapters"
}
},
"rest": {
"enabled": true
},
"permissions": [
{
"role": "anonymous",
"actions": [
{
"action": "*"
}
]
}
],
"relationships": {
"book": {
"cardinality": "one",
"target.entity": "Book",
"source.fields": [],
"target.fields": [],
"linking.source.fields": [],
"linking.target.fields": []
}
}
}
}
}
```

**Expected Behavior**
Book and its Chapters should get created.

### Version

1.3.19

### What database are you using?

PostgreSQL

### What hosting model are you using?

Local (including CLI)

### Which API approach are you accessing DAB through?

GraphQL

### Relevant log output

```Text
{
"errors": [
{
"message": "The specified input object field `chapters` does not exist.",
"locations": [
{
"line": 8,
"column": 7
}
],
"path": [
"createBook"
],
"extensions": {
"field": "chapters",
"specifiedBy": "http://spec.graphql.org/October2021/#sec-Input-Object-Field-Names"
}
}
]
}
```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Reproduziere die verschachtelte createBook-Mutation aus dem Issue mit der bereitgestellten dab-config.json gegen PostgreSQL und bestätige den Fehler im `chapters`-Eingabefeld. Verfolge die Verarbeitung der GraphQL-Mutation für Entitätsbeziehungen in Version 1.3.19; erledigt ist die Aufgabe, wenn die Mutation sowohl das Book als auch seine Chapters ohne den Eingabefeldfehler erstellt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp, graphql, postgresql
Bereich
api, databases
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
32/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.