graphqlgen icon indicating copy to clipboard operation
graphqlgen copied to clipboard

Apollo Federation support

Open JakesBas opened this issue 5 years ago • 4 comments

Description

With the new release of Apollo Federation (https://blog.apollographql.com/apollo-federation-f260cf525d21), new keywords and directives can be used in the graphql schema declaration.

More information on all that Apollo Federation allows can be read in their official documentation (https://www.apollographql.com/docs/apollo-server/federation/introduction/)

Out team has managed to figure out a workaround for generating resolvers with the @key directive added to the schema, but at the moment, graphqlgen cannot generate resolvers for types that use the extend keyword.

A typical error that is generated when trying to run graphqlgen with a type that uses the extend keyword would look like the following.

"Error occurred while reading schema: Error: Field company: Couldn't find type <MyType> in any of the schemas."

This feature request aims to include Apollo Federation support with regards to generating resolvers.

Additional context

JakesBas avatar Jul 18 '19 06:07 JakesBas

@JakesBas have you found any solution?

AlexQuidditch avatar Mar 21 '20 21:03 AlexQuidditch

Hey @AlexQuidditch, Our team managed to find a working solution. However, it is not that elloquent. Let me know what problem you are facing and if you would like a rundown of our workaround. Haven't revisited this issue again and the solution dates 8 months or so back, so its not that fresh in my mind, but I don't mind doing some digging upon request

JakesBas avatar Mar 31 '20 08:03 JakesBas

@JakesBas @AlexQuidditch graphql-code-generator, which grahqhgen was deprecated in favor of, has complete Federation support.

Would you mind trying it out and let me know if you experience any issues?

Urigo avatar Mar 31 '20 10:03 Urigo

@Urigo Thanks for the info. Will investigate tomorrow and let you know what the results are!

JakesBas avatar Apr 01 '20 11:04 JakesBas