-
Notifications
You must be signed in to change notification settings - Fork 743
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
RootEntityType Compilation Error when field name conflicts with Operation name #3036
Comments
Thanks for the report. I see exactly what's going on here. Your query is named We will discuss how we can address this for the future, either by handling the generated naming differently or by throwing a validation error during code generation if we detect this situation. In the mean time, the simple workaround for you is to put a field alias on the query AirportAndCityAutocomplete($searchString: String!) {
searchResult: airportAndCityAutocompleteQuery(searchString: $searchString) {
...
}
} Of course the alias |
@iAmericanBoy, thanks for the additional example. I'm not sure what's going on in your case exactly. If you are able to share a schema/query with me you can send it to [email protected]. That would help out immensely. |
Thank you! I’ll send it tomorrow morning! I was able to move on from the error by commenting out both analysis sections from the query. So there’s definitely something wrong with how we are doing this. |
@AnthonyMDev Do you have any updates on this? I know its summer vacation everywhere else too, so I just wanted to see if you need anything else from me to get this reproduced. |
Hi @iAmericanBoy, I've been working on a few other time sensitive things, but I am planning on looking at this one in more depth this week! Sorry we haven't gotten a resolution for you yet. |
@iAmericanBoy, the issue you highlighted here is not related to the name conflict that this issue is about. However I have figured out the underlying cause for this one and got a fix up for it in #3168! |
Closing this as resolved via #3168 🚀 |
Summary
'Data' is not a member type of struct 'SchemaName.QueryName.Data.QueryName.Result'
while generating code in 1.1.0
public typealias RootEntityType = QueryName.Result
after the update generating code in 1.2.0
public typealias RootEntityType = QueryName.Data.QueryName.Result
Version
1.2.0
Steps to reproduce the behavior
The issue does not exhibit with all models, so far it seems like its only inline union types
code gen config
{ "schemaNamespace" : "Schema", "input" : { "operationSearchPaths" : [ "**/*.graphql" ], "schemaSearchPaths" : [ "**/*.graphqls" ] }, "output" : { "testMocks" : { "none" : { } }, "schemaTypes" : { "path" : "../../../../Schema", "moduleType" : { "swiftPackageManager" : { } } }, "operations" : { "inSchemaModule" : { } } } }
Logs
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: