download-schema
Apollo Android requires your GraphQL server's schema as a schema.json
file. You can obtain the contents of this file by running an introspection query on your server.
The Apollo Gradle plugin exposes a downloadApolloSchema
task to help you obtain your schema. Provide this task your server's GraphQL endpoint and the output location for the schema.json
file:
note
Always remember to replace API_SECRET
with the correct value that you copied from apito console.
Go to this page if you do not know where to find your api secrets for your project
shell
./gradlew downloadApolloSchema \
--endpoint="https://api.apito.io/secured/graphql" \
--schema="app/src/main/graphql/com/example" \
--header="Authorization: Bearer API_SECRET"