GraphQLSwift / GraphQL

The Swift GraphQL implementation for macOS and Linux
MIT License
938 stars 72 forks source link

Introspection error with latest CLI #49

Closed noahemmet closed 4 years ago

noahemmet commented 5 years ago

Version 0.13.0 of Apollo iOS was just released, and it includes an update to the CLI from 1.9 to 2.16. Unfortunately, there's a breaking change around @directives.

When I run the code gen build script, I get a CLIError: Error in "Loading schema for Unnamed Project": Error: Introspection result missing directive locations: { onField: true, onOperation: false, args: [[Object]], name: "include", description: "Directs the executor to include this field or fragment only when theifargument is true.", onFragment: true }

I haven't delved into it too much, but the error message was added in https://github.com/graphql/graphql-js/pull/1429/, in response to https://github.com/dotansimha/graphql-code-generator/issues/556#issue-356000347.

(I opened a ticket on the Apollo GitHub as well: https://github.com/apollographql/apollo-ios/issues/665.)

Any thoughts?

paulofaria commented 4 years ago

Sorry for the huge delay. Were you able to overcome this issue?

noahemmet commented 4 years ago

No worries! Unfortunately no; I’ve had to pin to an earlier version of Apollo. It sort of feels like it’s missing a directive_location field or something, but I’m not sure exactly what that should be... if you have any tips, I’ll take another look!

noahemmet commented 4 years ago

Figured it out! The Vapor extension I was using wasn't including the directives field in the introspection query: https://github.com/StevenLambion/GraphQLRouteCollection/pull/3