Updated Federation demo fails
- 主要语言
- Go
- 星标
- 10.8k
- 派生
- 1.3k
- 平均合并
- 2 天 36 分钟
- 30 天内合并 PR
- 26
描述
### What happened?
I enriched the basic federation demo bundled with gqlgen to the latest version. The latest version introduces an additional inventory service to demo *provides*, *external* and *requires* directives.
Upon starting the servers, I get those errors:
```
This data graph is missing a valid configuration. [inventory] Product.weight -> marked @external but weight is not defined on the base service of Product (products)
[inventory] Product.price -> Type `Int` does not match the type of the original field in products (`Int!`)
```
### What did you expect?
Well, it should not bark about configuration issues and schema misalignment: I double-checked all the schemas,
[product]
```
extend type Query {
topProducts(first: Int = 5): [Product]
}
type Product @key(fields: "upc") {
upc: String!
name: String
price: Int
weight: Int
}
```
[inventory]
```
type Product @extends @key(fields: "upc") {
upc: String! @external
weight: Int @external
price: Int @external
inStock: Boolean
shippingEstimate: Int @requires(fields: "price weight")
}
```
As you can see, the price definition matches.
Also looking at the generated code, weight is implemented.
### Minimal graphql.schema and models to reproduce
```
git clone git@github.com:orefalo/federation-demo-golang.git
cd federation-demo-golang
make build
start.sh
```
### versions
- `gqlgen version`? v0.11.3
- `go version`? go version go1.14.5 darwin/amd64
- dep or go modules? modules
贡献指南
调研方向
The issue is in the federation demo. Start by cloning the linked repository and running `make build` and `start.sh` to reproduce the errors. Examine the schema definitions for the 'products' and 'inventory' services, focusing on the `@external` and `@requires` directives. Check the generated Go code for the Product type to see if the weight field is implemented. The goal is to resolve the schema misalignment errors.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- go, graphql
- 领域
- api, backend
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100