cynic icon indicating copy to clipboard operation
cynic copied to clipboard

Generator isn't great at reconciling a querys argument types with schema argument types.

Open obmarg opened this issue 3 years ago • 0 comments

The generator doesn't always do a good job of providing the right argument types if a queries arguments differ in type from where they're provided in a query.

Given the following schema:

input OrderChannelFilter {
  restaurantIdentifiers: [ID!]
  providerIdentifiers: [ID!]
}

type Query {
  orderChannels(filter: OrderChannelFilter): OrderChannel!
}

type OrderChannel {
  id: String
}

and query:

query MyQuery($restaurant_identifier: [ID!]!, $providers: [Provider!]!){
    orderChannels(filter: {
     restaurantIdentifiers: $restaurant_identifier,
     providers: $providers,
  }){
    id
  }

Querygen will try and pass the incorrect tyeps to OrderChannelFilter in it's output. At the very least worth exploring whether querygen can do better here.

obmarg avatar Sep 14 '21 11:09 obmarg