-
Notifications
You must be signed in to change notification settings - Fork 731
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
Cannot find type 'graphQLSchema' in scope. #2705
Comments
Hi @iAmericanBoy - this looks like a casing problem. The correct casing of the schema namespace is shown on line 19 in that screenshot. I believe if you were to capitalize it to Are you able to replicate this behaviour in a sample project? Is |
Can you also confirm whether this bug occurs even after deleting all previously generated files and regenerating? |
Correct
|
OK, I can try replicate this error using fragments, I was not able to earlier with just a very simple test schema.
No, I wasn't clear enough earlier with my message "if you were to capitalize it to GraphQLSchema it would build as expected". I meant on line 6 where you're getting the compilation error; if that were capitalized it should build as expected. It shouldn't matter what your schema file is named, rather the schema name you use in the codegen configuration, and there is logic to always capitalize that so I'm confused why it's being generated with the first character lowercased here. |
your right if I change the schema name to this in the configuration json it builds correctly. |
Oh that's weird, but it points to a place where I suspect the schema name is not being capitalized correctly - thanks! |
@iAmericanBoy I've got a fix up for this in PR #2730. It'll get merged to |
Thank you for that quick fix! |
Bug report
I followed the new migration guide coming with 1.0.6 and it helped me finally generate all the correct files for our queries and mutations. Thank you for the detailed guide!
However after dragging the swift package into our Xcode I'm running into some circular dependencies and Xcode errors around not being able to find the schema package in the source files. Are there plans to add more documentation of how to use the new Package integration?
Versions
Please fill in the versions you're currently using:
apollo-ios
SDK version: 1.0.5Steps to reproduce
generate code with this configuration file. and dragged the package into our Xcode project
Further details
Here is the error we are seeing in the generated files:
The text was updated successfully, but these errors were encountered: