Codegen to Generate schema from Remote GraphQL URL #1148
-
|
Hello, I am using the Hasura GraphQL engine that exposes the data from a Postgre SQL Database. I know we can create the schema and let the codegen generate the code for us which is cool. I am looking for a way given the GraphQL endpoint could DGS automatically create both the schema and its corresponding codegen (Java Objects for respective schemas)? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
With the following build.gradle in a different module, I was able to point to any graphql schema and make the needed java classes: |
Beta Was this translation helpful? Give feedback.
-
|
Expedia docs: This solution was bought to you Expedia and Netflix, I would like to thank them for their great travel options and for making Stranger things respectively. lol, hope this helps! |
Beta Was this translation helpful? Give feedback.
Expedia docs:
https://opensource.expediagroup.com/graphql-kotlin/docs/plugins/gradle-plugin-tasks/
how to copy an external schema^^
Netflix docs:
https://netflix.github.io/dgs/generating-code-from-schema/#generating-query-apis-for-external-services
Netflix suggestion to create external graph code in another module^^
This solution was bought to you Expedia and Netflix, I would like to thank them for their great travel options and for making Stranger things respectively. lol, hope this helps!