apollographql / apollo-ios

📱  A strongly-typed, caching GraphQL client for iOS, written in Swift.
https://www.apollographql.com/docs/ios/
MIT License
3.87k stars 717 forks source link

There can be only one directive named "@defer".-GraphQLSchemaValidationError@ #3316

Closed xLuciferSx closed 8 months ago

xLuciferSx commented 8 months ago

Summary

Unable to generate new swift files due to this issue - There can be only one directive named "@defer".-GraphQLSchemaValidationError@

After updating to Apollo CLI 1.8.0, it continues to fail to generate the code.

Screenshot 2024-01-14 at 16 36 57

Version

1.8.0

Steps to reproduce the behavior

run apollo-ios-cli generate command

Logs

No response

Anything else?

No response

calvincestari commented 8 months ago

Hi @xLuciferSx - I cannot reproduce this error when targeting the 1.8.0 release, see this sample project. If you're able to consistently reproduce the error please provide a sample application we can use.

From the last commit to the apollo-ios-codegen repo this error should not be possible since the code we had to add the @defer directive has been removed. The only way it could still be produced is if the schema declared two of the same directive but I believe that would have been an error in previous versions too.

xLuciferSx commented 8 months ago

Please share you email and i will share you sample package and graphqls file @calvincestari

calvincestari commented 8 months ago

That would be great, thank you. Send it to .

xLuciferSx commented 8 months ago

Email sent.

calvincestari commented 8 months ago

I've received it. I'll take a look and get back to you.

calvincestari commented 8 months ago

Your schema declares two @defer directives; one on line 6 and the other on line 27. Remove one of them and generate works as expected.