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

Accept skipDocumentsValidation config parameter from near-operation-file-preset #383

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

sachalifs
Copy link
Contributor

@sachalifs sachalifs commented Aug 8, 2023

#214

Description

In 2019 dotansimha/graphql-code-generator#2143 lead to dotansimha/graphql-code-generator@1559ab6. This resulted in typechecking being disabled for near-operation-file presets.

In 2022 dotansimha/graphql-code-generator#8222 was created in the former presets repository but hasn't been created in this new repository, thanks to @klyve for that PR.

Since that change the ability to toggle this setting was introduced in: dotansimha/graphql-code-generator#6825.

Running the same tests from dotansimha/graphql-code-generator#2143 it should now be possible to remove the default disable of typechecking for near-operation-file preset.

Typechecking is important and should be enabled by default.

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Related #214

Type of change

Please delete options that are not relevant.

  • 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?

  • Using the repository shared in the issue https://github.com/klyve/graphql-codegen-preset-test
  • Upgrade to "@graphql-codegen/near-operation-file-preset": "^2.5.0" in package.json file and run yarn
  • Updated the node_modules/@graphql-codegen/near-operation-file-preset/cjs/index.js with the changes in this PR
  • yarn test and see the expected validation errors in the terminal.
Before After
image image

Test Environment:

  • OS: macOS Ventura 13.4
  • @graphql-codegen/near-operation-file-preset: 2.5.0 + changes
  • NodeJS: v16.20.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
  • [ x 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

I went with a solution closer to the suggested one in this comment in the original PR.

I think passing undefined should result on the default { skipDuplicateValidation : true } but going with false should use that value but this could be an overkill, please share your thoughts on this..

@changeset-bot
Copy link

changeset-bot bot commented Aug 8, 2023

🦋 Changeset detected

Latest commit: 6877e7a

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/near-operation-file-preset Major

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

@sachalifs
Copy link
Contributor Author

Hi @charlypoly, I created this PR to take it over from the last comment you left in dotansimha/graphql-code-generator#8222.

Can you please take a look at it? Thank you very much! 🙇

@sachalifs sachalifs changed the title fix(preset/near-operation-file): accept skipDocumentsValidation config parameter Accept skipDocumentsValidation config parameter from near-operation-file-preset Aug 8, 2023
@sachalifs
Copy link
Contributor Author

Hi @charlypoly I'm wondering if you could take a look at this PR.

Thanks in advance!

@sachalifs
Copy link
Contributor Author

Hello @saihaj @Urigo @n1ru4l, I'm wondering if you could take a look at this small PR.

Thanks 🙇

@saihaj saihaj merged commit 9a692da into dotansimha:main Sep 11, 2023
@dargmuesli
Copy link
Contributor

Well, this change broke the pipeline. Not sure why not checks ran on this PR. There is no such thing as options.skipDocumentsValidation: https://github.com/dotansimha/graphql-code-generator/blob/9df36440878a4af53d83b1989bb01e12a74642db/packages/utils/plugins-helpers/src/types.ts#L340

@sachalifs how do you think this should be fixed?
@saihaj could you revert this commit for now, so that the other releases are published?

saihaj added a commit that referenced this pull request Sep 25, 2023
…on config parameter. Closes #214 (#383)"

This reverts commit 9a692da.
saihaj added a commit that referenced this pull request Sep 25, 2023
…on config parameter. Closes #214 (#383)"

This reverts commit 9a692da.
saihaj added a commit that referenced this pull request Sep 25, 2023
…on config parameter. Closes #214 (#383)" (#413)

This reverts commit 9a692da.
saihaj added a commit that referenced this pull request Sep 25, 2023
…Validation config parameter. Closes #214 (#383)" (#413)"

This reverts commit 5739a0e.
saihaj added a commit that referenced this pull request Sep 25, 2023
* Revert "Revert "fix(preset/near-operation-file): accept skipDocumentsValidation config parameter. Closes #214 (#383)" (#413)"

This reverts commit 5739a0e.

* fix(preset/near-operation-file): read skipDocumentsValidation from config (#409)

* fix(preset/near-operation-file): add skipDocumentsValidation presetConfig types

* Create brave-bulldogs-explode.md

* fix(preset/near-operation-file): read skipDocumentsValidation from config

* Update brave-bulldogs-explode.md

* Delete .changeset/brave-bulldogs-explode.md

---------

Co-authored-by: Herman Bilous <herman.belous@gmail.com>
saihaj added a commit that referenced this pull request Sep 25, 2023
* feat (msw) withSuffix param

* edit (msw) package version increasement

* add changeset

* Revert "chore(release): update monorepo packages versions (#349)" (#411)

This reverts commit dd930f7.

* Revert "fix(preset/near-operation-file): accept skipDocumentsValidation config parameter. Closes #214 (#383)" (#413)

This reverts commit 9a692da.

* chore(deps): update dependency jest-junit to v16 (#357)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency rimraf to v5 (#325)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat(typescript-rtk-query): add addTransformResponse to config (#267)

* feat: add addTransformResponse to config

* docs: add changeset

* fix: changeset from path to minor

* fix: move subscription block before generation

* fix: prettier issue

---------

Co-authored-by: Dominic <dominic@nomanini.com>

* changes to dev tests

* fix(preset/near-operation-file): accept skipDocumentsValidat (#414)

* Revert "Revert "fix(preset/near-operation-file): accept skipDocumentsValidation config parameter. Closes #214 (#383)" (#413)"

This reverts commit 5739a0e.

* fix(preset/near-operation-file): read skipDocumentsValidation from config (#409)

* fix(preset/near-operation-file): add skipDocumentsValidation presetConfig types

* Create brave-bulldogs-explode.md

* fix(preset/near-operation-file): read skipDocumentsValidation from config

* Update brave-bulldogs-explode.md

* Delete .changeset/brave-bulldogs-explode.md

---------

Co-authored-by: Herman Bilous <herman.belous@gmail.com>

* chore(deps): update dependency patch-package to v8 (#417)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency @urql/introspection to v1.0.2 (#321)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(graphql-request): return errors in return type for rawRequest (#408)

* fix(graphql-request): return errors in return type when rawRequest is true

* add changeset

* generate examples

* chore(deps): update typescript-eslint monorepo to v5.62.0 (#288)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @apollo/client to v3.8.4 (#292)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update babel monorepo (#299)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @changesets/cli to v2.26.2 (#310)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency lint-staged to v14 (#416)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @reduxjs/toolkit to v1.9.6 (#346)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update package.json

---------

Co-authored-by: Saihajpreet Singh <saihajpreet.singh@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Dominic Gunther Bauer <46312751+DominicGBauer@users.noreply.github.com>
Co-authored-by: Dominic <dominic@nomanini.com>
Co-authored-by: Herman Bilous <herman.belous@gmail.com>
Co-authored-by: dseeto <dseeto@users.noreply.github.com>
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