Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(typescript-urql): optional options for subscription #373

Merged

Conversation

danielkaxis
Copy link
Contributor

Description

When generating subscription, it now checks if
variables are required and generates correct
options argument to the function.

Related #372

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

I first made a yarn patch in my project to fix my issue.
In graphql-code-generator-community repo I added tests
to make sure it creates optional and required options if variables are required.

Test Environment:

  • OS: Linux
  • "@graphql-codegen/add": "4.0.1"
  • "@graphql-codegen/cli": "3.3.1"
  • "@graphql-codegen/typescript": "3.0.4"
  • "@graphql-codegen/typescript-operations": "3.0.0"
  • "@graphql-codegen/typescript-react-apollo": "3.3.7"
  • "@graphql-codegen/typescript-urql": "3.7.3"
  • "@graphql-codegen/plugin-helpers": "4.2.0"
  • "@graphql-codegen/typescript-resolvers": "3.2.1"
  • "@graphql-codegen/urql-introspection": "2.2.1"
  • NodeJS: 16.14.2

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

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose
the solution you did and what alternatives you considered, etc...

@changeset-bot
Copy link

changeset-bot bot commented Jul 7, 2023

🦋 Changeset detected

Latest commit: 766170d

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-urql 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

When generating subscription, it now checks if
variables are required and generates correct
options argument to the function.
@danielkaxis danielkaxis force-pushed the urql-typescript-react-subscription-bug branch from e9ec2c3 to 766170d Compare July 7, 2023 14:45
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