99designs / 99designs/gqlgen

GraphQL Interface With GqlGen

Đang mở
#2,446 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
10.8k
Fork
1.3k
Merge trung bình
2 ngày 36 phút
Pull request đã merge (30 ngày)
26

Mô tả

### What happened?
I'm trying to implement the GraphQL Interface but it's not working. I'm getting following error:
```{
"errors": [
{
"message": "json: cannot unmarshal object into Go struct field Segment.segments.contents of type models.Content",
"path": [
"GetData"
]
}
],
"data": {
"GetData": null
}
}
```

### Minimal graphql.schema and models to reproduce
```
type Root {
id: String
title: String
segments: [Segment]
}

type Segment {
id: String
contents: [Content]
}

type Team {
name: String
}

type A implements Content {
id: String
title: String
teams: [Team]
}

type B implements Content {
id: String
title: String
score: Int
}

interface Content {
id: String
title: String
}

type Query {
GetData: Root
}
```
Here is complete code:
https://bit.ly/3VGNjus

### versions
- `go run github.com/99designs/gqlgen version`? v0.17.20
- `go version`? go version go1.19 darwin/amd64

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

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

Đánh giá

Issue này chưa được đánh giá.

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.