Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/plugins/typescript/operations/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @graphql-codegen/typescript-operations

## 6.0.4

### Patch Changes

- [#10806](https://github.com/dotansimha/graphql-code-generator/pull/10806)
[`16b9529`](https://github.com/dotansimha/graphql-code-generator/commit/16b95293c36046ed9328bab629c9a2baf4430f5f)
Thanks [@vinassefranche](https://github.com/vinassefranche)! - Fix Array used instead of
ReadonlyArray while immutableTypes config is true

## 6.0.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/typescript/operations/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphql-codegen/typescript-operations",
"version": "6.0.3",
"version": "6.0.4",
"type": "module",
"description": "GraphQL Code Generator plugin for generating TypeScript types for GraphQL queries, mutations, subscriptions and fragments",
"repository": {
Expand Down
3 changes: 2 additions & 1 deletion packages/plugins/typescript/operations/src/visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ export class TypeScriptDocumentsVisitor extends BaseDocumentsVisitor<
}

if (typeNode.type === 'ListType') {
typePart = `Array<${typePart}>`;
const listModifier = this.config.immutableTypes ? 'ReadonlyArray' : 'Array';
typePart = `${listModifier}<${typePart}>`;
if (!typeNode.isNonNullable) {
typePart = printTypeScriptMaybeType({
type: typePart,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ describe('TypeScript Operations Plugin - Input', () => {
readonly to?: Date | null | undefined;
readonly timezone?: unknown;
readonly role?: UserRole | null | undefined;
readonly ageRange1?: Array<number | null | undefined> | null | undefined;
readonly ageRange2: Array<number | null | undefined>;
readonly ageRange3?: Array<number> | null | undefined;
readonly ageRange4: Array<number>;
readonly ageRange1?: ReadonlyArray<number | null | undefined> | null | undefined;
readonly ageRange2: ReadonlyArray<number | null | undefined>;
readonly ageRange3?: ReadonlyArray<number> | null | undefined;
readonly ageRange4: ReadonlyArray<number>;
readonly bestFriend?: UsersBestFriendInput | null | undefined;
readonly nestedInput?: UsersInput | null | undefined;
};
Expand Down
Loading