Azure / Azure/data-api-builder
Multiple mutations not supported in PGSQL
- 主要言語
- C#
- スター
- 1.5k
- フォーク
- 370
- 平均マージ
- 3日 22時間
- マージ済み PR(30日)
- 9
説明
### 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
コントリビューションガイド
調査の方向性
提供された dab-config.json を使用して PostgreSQL に対して issue のネストされた createBook mutation を再現し、`chapters` input-field エラーを確認してください。バージョン 1.3.19 でエンティティ関係に対する GraphQL mutation の処理を追跡してください。mutation によって input-field エラーなしで Book とその Chapters の両方が作成されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- csharp, graphql, postgresql
- 領域
- api, databases
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 32/100