apollographql / apollo-ios

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

@defer issue #3372

Closed HandyappGroup closed 6 months ago

HandyappGroup commented 6 months ago

Summary

I've downloaded the latest version, which technically fixes the @defer issue, but the problem is still exists.

Version

1.10.0

Steps to reproduce the behavior

Just try to generate new files using defer version fix. This is the version i've used - https://github.com/apollographql/apollo-ios/releases/tag/preview-defer.2

Logs

No response

Anything else?

CleanShot 2024-04-26 at 23 33 10

calvincestari commented 6 months ago
Please update your version of the Codegen CLI by following the instructions at: ...

@HandyappGroup this error is correct, and expected. You cannot mix versions. You must install, and use, the CLI that from the dependency version your project is using. This looks like you were using preview-defer.2 and then changed to 1.10.0 but didn't re-install the CLI.

Error: JavaScriptError: GraphQLSchemaValidationError-There can be only one directive named "@defer".-GraphQLSchemaValidationError"

As for this error, I suggest fixing the first one and then we can focus on whether this is still relevant and in which version.

xLuciferSx commented 6 months ago

HI. I've updated Apollo and CLi version to use preview-defer.2 but still getting the same error.

CleanShot 2024-04-30 at 23 39 24 CleanShot 2024-04-30 at 23 40 23

calvincestari commented 6 months ago

Take a look in your schema for the @defer directive definition, it will look like this:

directive @defer(label: String, if: Boolean! = true) on FRAGMENT_SPREAD | INLINE_FRAGMENT

Make sure there is only one @defer directive definition.

xLuciferSx commented 6 months ago

Take a look in your schema for the @defer directive definition, it will look like this:

directive @defer(label: String, if: Boolean! = true) on FRAGMENT_SPREAD | INLINE_FRAGMENT

Make sure there is only one @defer directive definition.

Removed defer but throwing now different errors. I am happy to share graphqls file over email for team to have a look.

calvincestari commented 6 months ago

I am happy to share graphqls file over email for team to have a look.

@xLuciferSx - sure, email it to me () and I'll take a look.

xLuciferSx commented 6 months ago

I am happy to share graphqls file over email for team to have a look.

@xLuciferSx - sure, email it to me () and I'll take a look.

Email sent :)

calvincestari commented 6 months ago

Closing as this seems to have been a syntax problem in an operation file. The graphql-js error messages are misleading and don't clearly point to the actual problem.

github-actions[bot] commented 6 months ago

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.