Replies: 1 comment 1 reply
-
Can you share a sample |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Until recently, GraphQL allowing for only one schema/endpoint per project was seen as a big but unavoidable limitation.
Then about a year ago, Github user Jim Kynde Meyer perfected his js-graphql-intellij-plugin allowing for graphql-java projects to have multiple schemas, multiple graphql endpoints, and even schemas shared by other schemas. With this plugin, the schemas are mapped & distinguished with either one (or one per schema) .graphqlconfig file. As quoted by Jim: "GraphQL files find their associated .graphqlconfig by looking in their current and parent directories."
Here is a link to the plugin:
https://github.com/jimkyndemeyer/js-graphql-intellij-plugin
Here's one of his examples:
https://github.com/jimkyndemeyer/graphql-config-examples/tree/master/two-schemas-plus-shared-using-projects
I'm very impressed with your DGS framework and pleased you made it open source. It singlehandedly solves every reservation I had about using graphQL with Spring Boot. Player from Carmen Sandiego would be proud.
There is only one single major issue specifically with multi-endpoint GraphQL projects: it seems to butt heads with the syntax of my .graphqlconfig files and won't run unless they're gone. However in some cases, those .graphqlconfig files still have to be present or else the multi endpoint structure breaks down, so I end up having to relocate the .graphqlconfig mapping to a single file in the root directory where it's out of range of netflix-dgs in order for the project to function.
This works, but I wish it wouldn't clash with the .graphqlconfig files in the first place, as it would in turn mean full support for graphQL projects with multiple schemas & endpoints.
Here is a copy of the error that will be produced when you try to run a spring boot dgs application within range of a .graphqlconfig file:
There are problems with the GraphQL Schema: * InvalidSyntaxError{ message=Invalid Syntax : offending token '"name"' at line 2 column 3 ,offendingToken="name" ,locations=[SourceLocation{line=2, column=3}] ,sourcePreview={ "name": "GraphQL Config",
Beta Was this translation helpful? Give feedback.
All reactions