99designs / 99designs/gqlgen

Unexpected response for inline spread

オープン
#2,195 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Go
スター
10.8k
フォーク
1.3k
平均マージ
2日 36分
マージ済み PR(30日)
26

説明

### What happened?

The server returned an unexpected response for `query А`:
```graphql
query A {
todos {
... {
id
text
user {
id
}
}
}
}

query B {
todos {
id
text
user {
id
}
}
}
```

The response is broken:
```json
{
"data": {
"todos": [
{},
{}
]
}
}
```

Adding the `... @include(if:true) {` directive doesn't help.

### What did you expect?

I expect the same result as for `query B`:
```json
{
"data": {
"todos": [
{
"id": "first",
"text": "This is the first todo",
"user": {
"id": "first_creator"
}
},
{
"id": "second",
"text": "This is the second todo",
"user": {
"id": "second_creator"
}
}
]
}
}
```

### Minimal graphql.schema and models to reproduce

```graphql
# GraphQL schema example
#
# https://gqlgen.com/getting-started/

type Todo {
id: ID!
text: String!
done: Boolean!
user: User!
}

type User {
id: ID!
name: String!
}

type Query {
todos: [Todo!]!
}

input NewTodo {
text: String!
userId: String!
}

type Mutation {
createTodo(input: NewTodo!): Todo!
}

```

### versions
- `go run github.com/99designs/gqlgen version`: `v0.17.7`
- `go version`: `go1.18.2 linux/amd64`

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

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

評価

この issue はまだ評価されていません。

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

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