Apollo-android: Support SDL schemas in addition to introspection results

Created on 11 May 2020  路  5Comments  路  Source: apollographql/apollo-android

Taken from https://spectrum.chat/apollo/apollo-android/can-i-create-a-graphql-sdl-instead-of-using-a-schema-json~e893df98-765f-41d8-8692-583555960ce8

It would be nice to be able to drop in a SDL file instead of using the schema.json format.

compiler In Progress Feature

All 5 comments

It would be a nice feature to have, especially when starting out with Apollo. I was initially put off by the introspection tool.
Also, if this feature would get implemented, one would be able to use the GraphQL plugin for android studio. JS GraphQL.

The plugin works when you create a schema.graphql using SDL, but the schema needs to be deleted in order for the apollo sources to be generated.

@FernandoH-G I have seen the apollo js plugin work with json introspection results. You might have to tweak a bit your .graphqlconfig:

Something like:

{
  "schema": "src/main/graphql/schema.json"
}

That did it. Thank you.

That would be great feature, at least SDL more concise than JSON format.

Unfortunately I couldn't find existing Antlr grammar for this, we should write own one, to be able to parse it.

The NPM cli tool supports converting from SDL to JSON format. We probably do not want to depend on that though :D

Was this page helpful?
0 / 5 - 0 ratings