Describe the bug
If query operation not has non nullable variable, parameter variables has question mark. it cause, generated code by typescript-vue-apollo has a compile error.
To Reproduce
Steps to reproduce the behavior:
Reproduce here: https://codesandbox.io/s/typescript-vue-apollo-repro-q7t1d?file=/document.graphql
yarn install
yarn generate
yarn build
type Query {
user(id: ID!): User!
allUsers(limit: Int): [User]
}
type User {
id: ID!
username: String!
email: String!
}
query allUsers($limit: Int) {
allUsers(limit: $limit) {
id
username
}
}
codegen.yml config file:schema: schema.graphql
documents: document.graphql
generates:
src/types.ts:
plugins:
- typescript
- typescript-operations
- typescript-vue-apollo
config:
vueCompositionApiImportFrom: vue
Expected behavior
Completion to compilation with no error.
Environment:
@graphql-codegen/typescript-vue-apollo: 2.2.0 Additional context
Fixed in @graphql-codegen/[email protected].
Most helpful comment
Fixed in
@graphql-codegen/[email protected].