As a client system developer, I want to download the GraphQL schema from server while building (using Gradle) my spring-boot project. As per ApolloGraphQL guide (apollographql.com/docs/ios/downloading-schema.html), we can download the schema using Apollo-codegen by Node.js. I'm not using Node.js in my project and I'm not allowed to use this. Could you please help me - how I can download the schema from server every time I build my project using Gradle.
Asked
Active
Viewed 761 times
0
-
1The schema can be queried using GraphQL itself. See [this Java file](https://github.com/graphql-java/graphql-java/blob/master/src/main/java/graphql/introspection/IntrospectionQuery.java) for a GraphQL query that returns schema data. However, it is unclear *why* you want to download this schema. If you are going to pass that schema to some other program (e.g., a code generator), downloading the schema is insufficient. You need to make it available however that program needs it, and that will require documentation or other information from that program's developers. – CommonsWare Dec 14 '17 at 11:38
-
Are you looking for a way to generate a client for an existing GraphQL service, similar to what wsdl2java is doing for SOAP services? If so, you have Apollo Android client, and Shoppify's client generator. If you just need the remote schema, simply fire an introspection query at the server, as described in @CommonWare 's comment. – kaqqao Jan 26 '18 at 00:12
-
@kaqqao - Yes, you are right. I'm give a try and let you know. – bpa.mdl Jan 26 '18 at 11:06