Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using local schema.graphql, getting error "ApolloGraphQL: cannot find schema.[json | sdl]" #3083

Closed
RLEE0731 opened this issue Apr 29, 2021 · 2 comments

Comments

@RLEE0731
Copy link

We're using a local schema in SDL, instead of puling in schema.json through introspection. The file (schema.graphql) is added to the folder path "./src/main/graphql/com/android/data/", in relation to the Android project directory.
On build we're getting the error: "ApolloGraphQL: cannot find schema.[json | sdl]".

One thought is maybe the schema is mal-formatted, however the same schema.graphql file works fine on iOS. Seems like there may be some unexpected handling of local SDL schema on Android side? Our server does not allow introspection, so this is the only way for us to setup graphql.

@RLEE0731 RLEE0731 changed the title Using local schema.graphql, getting error "ApolloGraphQL: cannot find schema.[json | sdl]" Using local schema SDL, getting error "ApolloGraphQL: cannot find schema.[json | sdl]" Apr 29, 2021
@RLEE0731 RLEE0731 changed the title Using local schema SDL, getting error "ApolloGraphQL: cannot find schema.[json | sdl]" Using local schema.graphql, getting error "ApolloGraphQL: cannot find schema.[json | sdl]" Apr 29, 2021
@martinbonnin
Copy link
Contributor

Hi @RLEE0731 👋

You'll have to rename your schema.graphql file to schema.sdl. This is so that it's not confused with other *.graphql operation files. Alternatively, you can also use schema.graphqls starting with version 2.5.5

@RLEE0731
Copy link
Author

ah I see, that did the trick! Thanks for the clarification :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants