-
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
Problem with schemaName
#2546
Comments
Thanks for alerting us to this one. Supports a lowercase named schema here should be an easy fix, we'll get a PR up for that ASAP and release it as part of the first patch version. (We're at GraphQL summit this week, so that will probably be on Monday when we're back!)
This definitely shouldn't be happening. I'm not sure why it would not create the enum. I'll see if we can reproduce that... |
Can reproduce the issue on my end; Using a lowercase schema name results in code that doesn't compile, and using a capitalized schema name, one file is missing from the code generation and the project also doesn't compile. Only way I can get it to compile is to use a lower case name (i.e. |
@SilverTab are you able to share with me a project (schema + operations + config) that demonstrates the second issue - missing file? I can replicate the first issue of test mocks using the incorrectly cased type but not the second missing file bug. If you are you can send it to me at calvin.cestari@apollographql.com - thanks. |
@calvincestari so this wasn't due to having a type named |
@calvincestari I'll try to put something together! In the meantime, if that helps; it seems like I didn't have any issues (with lowercase or uppercase schema name) before I started using Fragments in my project 🤔 That's when the error showed up. |
Hmm, the fragment thing is interesting but I can't say I've noticed those specifically causing a problem. @AnthonyMDev and I were talking this morning about the missing file and we wondered if it could be a bug in the pruning code; the fact that you're getting some but not all of the generated files is very odd. Can you add the options config to your configuration file and disable pruning, then run codegen again and see whether the file is still missing. |
For transparency of where we are on this issue:
|
@calvincestari Yup, I can confirm that. Once I've added |
Awesome, that's a solid lead on getting it resolved. Thanks for trying it! |
Same here! |
You need to add When you init the codegen config using the CLi built by Cocoapods, it adds this option automatically, so I'm kinda interested to hear how you set this up to not have the option already there! FWIW, the |
Thank you very much. It is working but every time I generate I get import embeddedInTarget.Name. And it is giving error. If I comment out it everything working. |
@indama I think you're using the wrong schema module type. If you're using a CocoaPods setup you need to be using
|
@AnthonyMDev we should probably get a config validation check to ensure you've got the right combination of
|
I don't think that's correct in all cases @calvincestari. We'll have to have a chat about this and make sure we are validating the logic properly. |
1.0.2 included a fix for the first two problems we identified in this issue:
There is one bug left before we can close out this issue and that is the missing file; some users have indicated that |
I'm closing this issue since we've addressed the initial issues and we will track the bug related to |
Bug report
schemaName
Steps to reproduce
ModuleType.embeddedInTarget
andTestMockFileOutput.absolute
options.schemaName
is in lowercase ("schemaName": "rocket"
for example), therocket.graphql.swift
with theRocket
caseless namespace enum is created. However, the generated Mocks are not working, because there isrocket
instead ofRocket
.schemaName
to start with the capitalized letter ("schemaName": "Rocket"
for example), the file with caseless namespace enum isn't created at all. 😔Versions
apollo-ios
SDK version: 1.0.0The text was updated successfully, but these errors were encountered: