Skip to content

Make typescript-generic-sdk respect importOperationTypesFrom option #70

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

Merged
merged 3 commits into from
Feb 14, 2023
Merged

Conversation

aplr
Copy link
Contributor

@aplr aplr commented Jan 25, 2023

Description

Related #69

Make typescript-generic-sdk respect the documentMode external option by prefixing types with the value configured in importOperationTypesFrom as it is already documented.

Type of change

Adapted the visitor of typescript-generic-sdk. Changes are heavily inspired by typescript-graphql-request visitor.

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

How Has This Been Tested?

Added the following two unit tests. Copied from typescript-graphql-request test suite and adapted to generic-sdk.

  • respects importDocumentNodeExternallyFrom
  • respects importOperationTypesFrom

Test Environment:

  • OS: macOS 13
  • @graphql-codegen/typescript-generic-sdk:
  • NodeJS: 16.17.1

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 Jan 25, 2023

🦋 Changeset detected

Latest commit: a82dd1d

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-generic-sdk Minor

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

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.

can you add a changeset explaining your changes (learn more #70 (comment))

@wootencl
Copy link

@saihaj any word on getting this merged now that @aplr has introduced the changeset. I too would fine this functionality useful in DRYing up my module. Thanks! (and many thanks to @aplr for implementing 🙂)

@saihaj saihaj merged commit e6e85a9 into dotansimha:main Feb 14, 2023
@saihaj
Copy link
Collaborator

saihaj commented Feb 14, 2023

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.

3 participants