aoudiamoncef / apollo-client-maven-plugin

Generate a Java/Kotlin GraphQL client based on introspection data and predefined queries.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Directives at query or mutation locations not supported

jorgebay opened this issue · comments

The spec allows directives at QUERY and MUTATION locations but code generation plugin doesn't.

For example, the following valid graphql is not supported by the plugin:

mutation @myModifier CreateReviewForEpisode($review: ReviewInput!) {
  val1: createReview(review: $review),
  val2: trackReview(review: $review),
}

Please open an issue in Apollo Android.

Thanks for the guidance, I've created a ticket there apollographql/apollo-kotlin#2661

TIL the correct order is the following:

mutation CreateReviewForEpisode($review: ReviewInput!) @myModifier {
  val1: createReview(review: $review),
  val2: trackReview(review: $review),
}

With the directive after the name. It works as expected that way, sorry for the noise.