Replies: 2 comments
-
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. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What happened?
I have a number of graphql files that hold shared type definitions from multiple backends. Not every backend uses every type, but it's convenient to be able to deduplicate them in cases where they are shared.
Unfortunately, currently, this results in every backend being forced to generate resolvers for every type.
What did you expect?
I expected that unreachable types don't need to be implemented and don't affect the output of gqlgen.
Minimal graphql.schema and models to reproduce
https://github.com/vikstrous/unreachable-repro
The "expected" directory was produced with #1238
Expected: https://github.com/vikstrous/unreachable-repro/blob/master/expected/userservice/generated.go#L43
Actual: https://github.com/vikstrous/unreachable-repro/blob/master/actual/userservice/generated.go#L43
versions
gqlgen version
: mastergo version
: 1.14.4Other
Note that this is not just a slight annoyance. In order to split up our graphql schema and move towards federation, we need to be able to take chunks out of the main common schema one at a time. With multiple different services re-implementing the same graphql resolvers, we would have to duplicate our schema 5 times as the first step towards federation. It's very hard to do this at scale and having this feature in gqlgen would really simplify our transition.
Beta Was this translation helpful? Give feedback.
All reactions