prisma-labs / graphqlgen

⚙️ Generate type-safe resolvers based upon your GraphQL Schema
MIT License
817 stars 56 forks source link

Apollo Federation support #483

Open JakesBas opened 5 years ago

JakesBas commented 5 years ago

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 in any of the schemas."

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

Additional context

AlexQuidditch commented 4 years ago

@JakesBas have you found any solution?

JakesBas commented 4 years ago

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

Urigo commented 4 years ago

@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?

JakesBas commented 4 years ago

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