apollo-ios: Generate Apollo GraphQL API phase not executing properly
I am having trouble getting the build phase execute prperly. I have properly created the build script and using default paths for my *.graphql and schema.json. It looks like Xcode is running the generation phase but no API.swift file is generated.
Any directions on how to debug this?
Using Apollo 0.3.1 and apollo-codegen 0.8.2
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 48 (17 by maintainers)
I experienced multiple errors while attempting to get the auto generation working. Including the following:
Apollo.frameworkdoes not support the latest version ofapollo-codegen.apollo-codegenversion installed on my machine to 0.18.8 from the current latest of 0.19.1.@shelldonhu’s suggested fix of adding a
.graphqlfile fixed it for me. Something in the generation script doesn’t fail gracefully or the documentation is possibly out of order (it says to verifyAPI.swiftis generated before saying to add a .graphql file).Hope this helps someone.
It can be built successfully when I firstly create an empty .graphql file on ${SRCROOT}/${TARGET_NAME}.
@NiltiakSivad, thank you! I spent lot of time to find the issue! And finally, I came across with @NiltiakSivad answer. Apollo team should warn their audience about such possible case in installation tutorial!
@jzhw0130: I still don’t know what causes that for some people, but now that I think of it, we may have a workaround in recent versions of
apollo-codegen.Could you try replacing the last line of the build script with: