Skip to content

Conversation

@jefrydco
Copy link
Contributor

@jefrydco jefrydco commented Sep 7, 2024

🚨 IMPORTANT: Please do not create a Pull Request without creating an issue first.

Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of
the pull request.

Description

Support skip token for suspense query.

From https://www.apollographql.com/docs/react/api/react/hooks/#suspensequeryhookoptions-skip, it's mentioned that skip is deprecated in favor of skipToken for useSuspenseQuery:

We recommend using skipToken in place of the skip option as it is more type-safe. This option is deprecated and only supported to ease the migration from useQuery. It will be removed in a future release.

Related #647

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

Screenshots/Sandbox (if appropriate/relevant):

Adding links to sandbox or providing screenshots can help us understand more about this PR and take
action on it as appropriate

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can
reproduce. Please also list any relevant details for your test configuration

  • I ran codegen with the changes applied to the project that is actually using the library, and confirmed that useSuspenseQuery was working properly. (with patch-package)
  • passed yarn run test after update snapshot file

Test Environment:

  • OS: Mac OS
  • @graphql-codegen/...:
  • NodeJS: 20.11.0

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

changeset-bot bot commented Sep 7, 2024

🦋 Changeset detected

Latest commit: c174e8c

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-react-apollo 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

@jefrydco
Copy link
Contributor Author

jefrydco commented Sep 7, 2024

Hi @saihaj can you please help review this PR? 🙏🏼

@jefrydco jefrydco force-pushed the feat/647-skip-token branch from 5014392 to c174e8c Compare September 9, 2024 08:44
Copy link
Collaborator

@saihaj saihaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@saihaj saihaj merged commit ea83cf4 into dotansimha:main Sep 9, 2024
@github-actions github-actions bot mentioned this pull request Sep 9, 2024
@saihaj
Copy link
Collaborator

saihaj commented Sep 9, 2024

@jefrydco jefrydco deleted the feat/647-skip-token branch September 11, 2024 13:45
mvdstam pushed a commit to mvdstam/graphql-code-generator-community that referenced this pull request Sep 27, 2024
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.

2 participants