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

x is not member of x in generated files error after using selectionSetInitializers #3112

Closed
iAmericanBoy opened this issue Jul 11, 2023 · 9 comments · Fixed by #3168
Closed
Assignees
Labels
bug Generally incorrect behavior needs investigation planned-next Slated to be included in the next release

Comments

@iAmericanBoy
Copy link

Summary

After adding the selectionSetInitializers: option to our OutputOptions function the generated code is not building anymore. it looks like apollo is maybe duplicating the asUserPie inline fragment?

Type 'ApolloSimpleSliceable.AsPie.AsUserPie' has no member 'AsUserPie' is the error we are getting in Xcode.

Screenshot 2023-07-11 at 9 56 50 AM

the part of the query that is generated by this looks like this:

...
  ... on Pie {
    containsCrypto
    ... on UserPie {
      id
    }
...

Version

1.3

Steps to reproduce the behavior

add selectionSetInitializers selection set to the options initializer and run ApolloCodegen.build the generated code now has failures in it being unable to resolve the inline fragment

Logs

No response

Anything else?

this can be reproduced with the same schema and fragment files I send @AnthonyMDev last week

@iAmericanBoy iAmericanBoy added bug Generally incorrect behavior needs investigation labels Jul 11, 2023
@AnthonyMDev AnthonyMDev added this to the Patch Releases (1.x.x) milestone Jul 11, 2023
@AnthonyMDev
Copy link
Contributor

Thanks for the bug report! We're going to look into this as soon as we can. Probably will be next week, as we have some people out on vacation this week!

@AnthonyMDev
Copy link
Contributor

@iAmericanBoy in order to figure out what's going on here, I am probably going to need a reproduction case. Can you provide me with an example of your schema and operation that causes this bug when generated? It doesn't need to be your entire schema, but if you can pull out just enough of the schema to make something that reproduces this issue, we'll be able to get a fix out much quicker!

@AnthonyMDev
Copy link
Contributor

Whoooooops, missed the part that you said this can be reproduced with the example you already sent me last week! Disregard that last comment. We'll look into this!

@iAmericanBoy
Copy link
Author

yup sorry I only left it as a note bit yes you can reproduce it by setting selectionSetInitializers:[.all] in the codegen function. you'll see the error in the ApolloSimpleSliceable generated code file

@calvincestari
Copy link
Member

I think we've got another report of this issue in 1.3 over in the community forums - https://community.apollographql.com/t/apollo-v1-3-swift-ios-how-to-access-type-uploadfile/6465.

@AnthonyMDev AnthonyMDev added the planned-next Slated to be included in the next release label Jul 17, 2023
@iAmericanBoy
Copy link
Author

Just checking in here, have you been able to reproduce this? I know the other issue is still being investigated but this is blocking us from completing the 1.x migration. Please let me know if I can help in any way? Maybe there's some investigation I could help with?

@AnthonyMDev
Copy link
Contributor

I just figured out and got a fix up for the other issue you were having. This one I haven't gotten to yet, but I'm working on it. Hoping to have a resolution for this ASAP.

@AnthonyMDev
Copy link
Contributor

Actually, with the other one resolved, I was able to figure out what was wrong here and fix it super quickly! The fix for this is also no in the #3168 PR. Once that is merged in, we will push a patch and this should all be sorted out! So sorry it took so long to make this happen!

@iAmericanBoy
Copy link
Author

OMG thank you so much for resolving this! I really appreciate that you took the time to find it and where able to fix it thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Generally incorrect behavior needs investigation planned-next Slated to be included in the next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants