Downloading Schema from GraphiQL

895 views Asked by At

I am currently using the apollo android and iOs libraries which require me to download the schema. Is it possible to download the schema from graphiql? Currently, I keep getting errors from the command line and there is no way to download it manually from the GraphiQL interface. Thank you in advance!

1

There are 1 answers

2
YodagamaHeshan On

Yes Its possible to download the schema from graphiql, but when you download manually it may be in old json format.(in my case that was the problem).

so you can add this scrip to your build phase run script ( when you use SPM, check for others -> https://www.apollographql.com/docs/ios/installation/#adding-a-code-generation-build-step ). then the CLI will download the correct one for you automatically.

"${SCRIPT_PATH}"/run-bundled-codegen.sh schema:download --endpoint="https://apollo-fullstack-tutorial.herokuapp.com/"

Note: you need to change the endpoint url according to yours.

After you build the xcode project once ,then you can remove this line from the build script.