99designs / gqlgen

go generate based graphql server library
https://gqlgen.com
MIT License
9.97k stars 1.17k forks source link

Updated Federation demo fails #1270

Open orefalo opened 4 years ago

orefalo commented 4 years ago

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

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

frederikhors commented 4 years ago

Nope