99designs / 99designs/gqlgen

Updated Federation demo fails

Đang mở
#1,270 2 bình luận 0 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 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

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.