You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to add SDL (https://www.graphql-java.com/documentation/v11/schema/) support to the GraphQL Java Servlet project. But this might also imply having a way to provide "parts" of SDL as well as Data Fetchers (TypeProviders should be ok) in a pluggable way (to stay compatible with OSGi notably).
@sergehuber Not sure I quite follow you here. This servlet is a wrapper around graphql-java and therefore provides support for this. When used in combination with graphql-java-tools you get automatic parsing of SDL found on the class path. So what it is exactly that you would like to be able to do which you can't right now?
Well you don't have to use graphql-java-tools, you can use the SchemaParser from graphql-java directly. So the way to use it in combination with graphql-java-servlet would be to first create a GraphQLSchema with that SchemaParser from graphql-java and then pass that in to create the servlet using GraphQLHttpServlet.with(schema).
Almost, I'm using the OSGi servlet right now, which seems to lack an extension point for that. Maybe I will need to contribute it if my understanding is correct ?
Right, I don't have any experience with OSGi unfortunately. There's a GraphQLSchemaProvider in the OsgiGraphQLHttpServlet that's responsible for providing the GraphQLSchema. Can't you use that somehow?
Actually that schemaProvider is initialized this way :
this.schemaProvider = new DefaultGraphQLSchemaProvider(newSchema().query(queryTypeBuilder.build())
.mutation(mutationType)
.subscription(subscriptionType)
.additionalTypes(types)
.build());
so it's not pluggeable (yet) and can't hook a parser to generate it. I could provide a patch to do this but I need to get around to implementing and testing that.
Activity
oliemansm commentedon Feb 16, 2019
@sergehuber Not sure I quite follow you here. This servlet is a wrapper around
graphql-javaand therefore provides support for this. When used in combination withgraphql-java-toolsyou get automatic parsing of SDL found on the class path. So what it is exactly that you would like to be able to do which you can't right now?sergehuber commentedon Feb 16, 2019
I wasn't aware this was possible. So basically I need to provide a schema Provider that uses graphql-java-tools?
I thought SDL was directly supported by graphql-java or did I misunderstand there? it seems they have a SchemaParser available ? https://www.graphql-java.com/tutorials/getting-started-with-spring-boot/#schema
Regards,
Serge...
oliemansm commentedon Feb 16, 2019
Well you don't have to use graphql-java-tools, you can use the SchemaParser from graphql-java directly. So the way to use it in combination with graphql-java-servlet would be to first create a
GraphQLSchemawith thatSchemaParserfrom graphql-java and then pass that in to create the servlet usingGraphQLHttpServlet.with(schema).Does that answer your question?
sergehuber commentedon Feb 16, 2019
Almost, I'm using the OSGi servlet right now, which seems to lack an extension point for that. Maybe I will need to contribute it if my understanding is correct ?
oliemansm commentedon Feb 16, 2019
Right, I don't have any experience with OSGi unfortunately. There's a
GraphQLSchemaProviderin theOsgiGraphQLHttpServletthat's responsible for providing theGraphQLSchema. Can't you use that somehow?sergehuber commentedon Feb 18, 2019
Actually that schemaProvider is initialized this way :
so it's not pluggeable (yet) and can't hook a parser to generate it. I could provide a patch to do this but I need to get around to implementing and testing that.
[-]SDL support[/-][+]SDL support for OSGi servlet[/+]