Azure / Azure/data-api-builder

[Bug]: GraphQL type doesn't match any entity name or singular type in the runtime config.

オープン
#2,155 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug graphql triage
主要言語
C#
スター
1.5k
フォーク
370
平均マージ
3日 22時間
マージ済み PR(30日)
9

説明

### What happened?

A bug happened! (Or I'm doing something wrong)
Error message in Postman

In postman: POST `http://localhost:5000/graphql`
CosmosDB emulator running

schema.gql:
```type Activity @model {
id: String
iothubname: String
Body: Body
SystemProperties: SystemProperties
Properties: Properties
}

type Body {
la_activity_device_mac_date: String
action: String
la_activity_device_mac: String
la_activity_index: Int
la_activity_dev_ref: String
la_activity_block: String
la_activity_activity: String
la_activity_mode: Int
la_activity_tag: String
la_activity_date: String
la_activity_time: String
la_activity_timestamp: Int
la_activity_quantity: Int
}

type SystemProperties {
iothubconnectiondeviceid: String
iothubconnectionauthmethod: String
iothubconnectionauthgenerationid: String
iothubcontenttype: String
iothubcontentencoding: String
iothubenqueuedtime: String
iothubmessagesource: String
}

type Properties {
action: String
}
```

The GraphQL Query in Postman:
```{
activities(filter: { Body: { la_activity_device_mac: {eq: "DCDA0C56FA18"}}}){
items {
id
Body {
la_activity_device_mac_date
la_activity_device_mac
la_activity_index
la_activity_dev_ref
la_activity_tag
la_activity_date
la_activity_time
la_activity_quantity
}
Properties {
action
}

}
}
}
```

This query results in the error message posted below.

If I run a query without a filter as follows, it returns the record.
Query:
```{
activities{
items {
id
Body {
la_activity_device_mac_date
la_activity_device_mac
la_activity_index
la_activity_dev_ref
la_activity_tag
la_activity_date
la_activity_time
la_activity_quantity
}
Properties {
action
}

}
}
}
```

The result:
```{
"data": {
"activities": {
"items": [
{
"id": "843e7f39-a565-4379-ae3b-99f49afba24b",
"Body": {
"la_activity_device_mac_date": "DCDA0C56FA18-2024-03-29",
"la_activity_device_mac": "DCDA0C56FA18",
"la_activity_index": 0,
"la_activity_dev_ref": "am1",
"la_activity_tag": "8D01EF395A",
"la_activity_date": "2024-03-29",
"la_activity_time": "12:24:06",
"la_activity_quantity": 1
},
"Properties": {
"action": "addActivity"
}
}
]
}
}
}
```

Any advice as to what is being done incorrectly?

### Version

Microsoft.DataApiBuilder 0.10.23+573117a7ff19d9d946343a92ad8d0f32e649954c

### What database are you using?

CosmosDB NoSQL

### What hosting model are you using?

Static Web Apps (SWA)

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

GraphQL

### Relevant log output

```Text
{
"errors": [
{
"message": "GraphQL type doesn't match any entity name or singular type in the runtime config.",
"extensions": {
"code": "BadRequest"
}
}
]
}
```

### Code of Conduct

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Microsoft.DataApiBuilder 0.10.23 と Cosmos DB に対して、issue に記載されたフィルター済みおよびフィルターなしの GraphQL リクエストを再現し、その後、フィルターに関係する runtime-config の entity/type 検証を追跡します。ソースファイルやテストは指定されていません。フィルター済みのリクエストが GraphQL 型を拒否する理由を特定し、回帰テストを追加するか、確認された構成エラーを文書化すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
graphql, postman
領域
api, databases
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。