Graphql-code-generator: immutableTypes does not make arguments readonly

Created on 18 Mar 2019  路  2Comments  路  Source: dotansimha/graphql-code-generator

Describe the bug
Input types are not set to readonly. All other types seem to be correctly marked readonly/ReadonlyArray.

Input:

type Query {
  user(id: ID!): User
}

Output:

export interface UserQueryArgs {
  id: string;
}

Expected:

export interface UserQueryArgs {
  readonly id: string;
}
bug plugins waiting-for-release

All 2 comments

Hi @lirbank ! Thank you for reporting it.
We are currently working on a big refactor for the TypeScript plugins, and preparing for a 1.0 release.
I fixed it here: https://github.com/dotansimha/graphql-code-generator/pull/1484/commits/c8b59c8737fdc9e68dd8dbb3b8640ef4d64b7aaf
It will be available soon.

Fix available in 1.0.0 馃憤

Was this page helpful?
0 / 5 - 0 ratings