Skip to content

Fix Array used instead of ReadonlyArray for input type when immutableTypes config is on#10806

Open
vinassefranche wants to merge 2 commits into
dotansimha:masterfrom
vinassefranche:fix-immutable-array-type-not-used-for-input
Open

Fix Array used instead of ReadonlyArray for input type when immutableTypes config is on#10806
vinassefranche wants to merge 2 commits into
dotansimha:masterfrom
vinassefranche:fix-immutable-array-type-not-used-for-input

Conversation

@vinassefranche
Copy link
Copy Markdown

I did not create an issue before this as it was easier to demo the issue with the P.R. Tell me if you think I should still open an issue.

Description

When immutableTypes is set to true in the config, the generated types are supposed to use ReadonlyArray instead of Array. This works well for most cases but for some inputs, Array was still used.
This pull request fixes this issue, which is, if I'm not wrong, a regression.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as
    expected)
  • This change requires a documentation update

How Has This Been Tested?

There was already a test for this which was expecting Array. I updated it in this P.R.

Checklist:

  • I have followed the
    CONTRIBUTING doc and the
    style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 12, 2026

🦋 Changeset detected

Latest commit: ac61055

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphql-codegen/typescript-operations Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant