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!
Asked
Active
Viewed 689 times
1 Answers
1
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.

YodagamaHeshan
- 4,996
- 2
- 26
- 36
-
Thank you @Yodagama would this old json format cause problems when running the queries? The reason I ask is because I was able to get the schema outside of xcode scripts and now i am seeing a 400 error when making calls – paul590 Jan 20 '21 at 18:57
-
is 400 networking error code or compiler error code ? – YodagamaHeshan Jan 21 '21 at 04:17