-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated Federation code for fields with @external
directive applied on a list which is used in a @requires
field is wrong.
#2559
Comments
@external
directive applied on a list field is wrong.@external
directive applied on a list which is used in a @requires
field is wrong.
gqlgen have fully passed Apollo Federation (1 and 2) Validation tests in the past, and even has had contributions from Apollo engineers. It looks like something in their test suite changed. If there is some nuance they noticed we are missing, then PRs are very welcome! |
Thanks for the reply! I understand that apollo test suite has changed, but the actual bug I mentioned in the post hasn't got anything to do with the apollo test suite as I understand it. It is a bug with implementation of |
Facing similar issue where getting "interface conversion: interface {} is nil, not map[string]interface {}" error in subgraph's federation go when that subgraph has dependency on other subgraph entity's field. |
fixed in #2884 |
What happened?
Hi everyone, thanks for the library!
I am trying to port one of my services from python to go. This service is a subgraph in a larger supergraph, and makes use of
@external
and@requires
directives. As a simplified example, I have a type like this:This seems to require implementation of a resolver called
findCheckoutByID
(I imagine this is theresolve_reference
equivalent in gqlgen?).In
federation.go
I see this output:and the error
Which makes sense because, entity.Metadata is a list, not a struct. Here's the generated Checkout entity
As you can see, there's a mismatch. I am not sure how to proceed here.
What did you expect?
I expect that the metadata must be constructed as a list, not as a single struct.
Minimal Reproduction Example
versions
go run github.com/99designs/gqlgen version
?v0.17.24
go version
?go version go1.19 darwin/amd64
In general, we are planning to move some of our services to golang and our existing services use extensive use of federation directives, specifically external, requires and inaccessible. Does
gqlgen
handle all these requirements well? I see from here: https://www.apollographql.com/docs/federation/building-supergraphs/supported-subgraphs/#go, that@requires
is not supported. Is there any plan to support it anytime soon? (as it is a big blocker for us).Any help is appreciated, thank you.
The text was updated successfully, but these errors were encountered: