v2 example federation not working, normalization failed
Hi, I tried the federation example from the v2 version but unfortunately, the federation part is not really working. It will fail with a normalization failure when the query is spanning multiple subgraphs. I provided an example to reproduce. I also tried it with my services and I got the same failed response.
The following error is produced from the gateway example
ERROR [email protected]/zap.go:82 engine.Execute {"error": "internal: printOperation: normalization failed"}
I used the following query:
query{
me {
id
username
reviews{
body
author{
id
username
}
}
}
}
I debug and traced to where the error originated from.
It happens in the astnormalization.OperationNormalizer.NormalizeOperation() function will report a failure at some point with the following external error
field: reviews not defined on type: Query
These are the normalized stages (1st visit normalizeOperation)
{
topProducts {
upc
name
price
inStock
reviews {
body
author {
id
username
}
}
}
}
2nd visit (normalizeOperation)
query($a: Int){
topProducts(first: $a){
upc
name
price
inStock
}
}
3th visit the one that errors (normalizeOperation)
{
reviews {
body
author {
id
username
}
}
}
Please let me know if you need more information.
I'm changing our gateway(which is using graphql-go-tools gateway but with v1 engine) to start using the v2 engine and I'm having the same issue.
Struggling with this too. Is there any fix for that?
I have the same problem. And if you use cosmo, then https://github.com/wundergraph/cosmo/issues/442
Hi everyone, the federation example in this repo is outdated and could not use v2 due to mismatched configuration requirements
We will update it soon with the v2 version
It will be available once this PR is finished
While it is not ready we suggest trying out cosmo instead
Thanks!
@devsergiy any eta when the pull request will be merged?
Hello! We are looking forward to upgrade to V2 and we are using graphql-go-tools, moving to Cosmo seems too invasive. Is there an ETA on linked PR or any plans you can share with the community @devsergiy ? Thank you!