Azure / Azure/data-api-builder

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

Đang mở
#2,155 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug graphql triage
Ngôn ngữ chính
C#
Star
1.5k
Fork
370
Merge trung bình
3 ngày 22 giờ
Pull request đã merge (30 ngày)
9

Mô tả

### 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Tái hiện các request GraphQL có bộ lọc và không có bộ lọc từ issue trên Microsoft.DataApiBuilder 0.10.23 với Cosmos DB, sau đó truy vết quá trình validation entity/type của runtime-config liên quan đến bộ lọc. Không có source file hoặc test nào được nêu; công việc được xem là hoàn tất khi xác định được lý do request có bộ lọc từ chối GraphQL type và thêm regression test hoặc ghi lại lỗi cấu hình đã được xác nhận.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
graphql, postman
Lĩnh vực
api, databases
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.