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

feat: add ignoreNoDocuments flag and config option #8040

Merged
merged 2 commits into from Jul 7, 2022
Merged

Conversation

saihaj
Copy link
Collaborator

@saihaj saihaj commented Jul 5, 2022

Description

Add a flag ignoreNoDocuments which ensures we don't exit with non-zero exit code.

Related #7943

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?

I have added tests for parsing new config option and ensure the flag works from CLI. I also tested it locally by building the CLI locally.

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

@changeset-bot
Copy link

changeset-bot bot commented Jul 5, 2022

🦋 Changeset detected

Latest commit: 17dc431

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

This PR includes changesets to release 3 packages
Name Type
@graphql-codegen/plugin-helpers Minor
@graphql-codegen/cli Minor
@graphql-cli/codegen 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

@vercel
Copy link

vercel bot commented Jul 5, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
graphql-code-generator ✅ Ready (Inspect) Visit Preview Jul 5, 2022 at 9:15PM (UTC)

@theguild-bot
Copy link
Collaborator

The latest changes of this PR are available as alpha in npm (based on the declared changesets):

@graphql-cli/codegen@2.2.7-alpha-2ada7b533.0
@graphql-codegen/cli@2.8.0-alpha-2ada7b533.0
@graphql-codegen/core@2.5.2-alpha-2ada7b533.0
@graphql-codegen/c-sharp@4.2.16-alpha-2ada7b533.0
@graphql-codegen/c-sharp-common@0.0.1-alpha-2ada7b533.0
@graphql-codegen/c-sharp-operations@2.2.15-alpha-2ada7b533.0
@graphql-codegen/flow@2.2.15-alpha-2ada7b533.0
@graphql-codegen/flow-operations@2.2.15-alpha-2ada7b533.0
@graphql-codegen/flow-resolvers@2.2.16-alpha-2ada7b533.0
@graphql-codegen/java-apollo-android@2.2.15-alpha-2ada7b533.0
@graphql-codegen/java-common@2.1.22-alpha-2ada7b533.0
@graphql-codegen/java@3.2.16-alpha-2ada7b533.0
@graphql-codegen/kotlin@2.2.16-alpha-2ada7b533.0
@graphql-codegen/java-resolvers@2.2.15-alpha-2ada7b533.0
@graphql-codegen/add@3.1.2-alpha-2ada7b533.0
@graphql-codegen/fragment-matcher@3.2.2-alpha-2ada7b533.0
@graphql-codegen/hasura-allow-list@1.0.2-alpha-2ada7b533.0
@graphql-codegen/introspection@2.1.2-alpha-2ada7b533.0
@graphql-codegen/jsdoc@2.2.15-alpha-2ada7b533.0
@graphql-codegen/schema-ast@2.4.2-alpha-2ada7b533.0
@graphql-codegen/time@3.1.2-alpha-2ada7b533.0
@graphql-codegen/urql-introspection@2.1.2-alpha-2ada7b533.0
@graphql-codegen/visitor-plugin-common@2.10.1-alpha-2ada7b533.0
@graphql-codegen/typescript-apollo-angular@3.4.14-alpha-2ada7b533.0
@graphql-codegen/typescript-apollo-client-helpers@2.1.22-alpha-2ada7b533.0
@graphql-codegen/typescript-document-nodes@2.2.15-alpha-2ada7b533.0
@graphql-codegen/typescript-enum-array@2.1.3-alpha-2ada7b533.0
@graphql-codegen/typescript-generic-sdk@2.3.14-alpha-2ada7b533.0
@graphql-codegen/gql-tag-operations@1.2.18-alpha-2ada7b533.0
@graphql-codegen/typescript-graphql-apollo@1.1.2-alpha-2ada7b533.0
@graphql-codegen/typescript-graphql-files-modules@2.1.2-alpha-2ada7b533.0
@graphql-codegen/typescript-graphql-request@4.4.12-alpha-2ada7b533.0
@graphql-codegen/typescript-jit-sdk@2.0.13-alpha-2ada7b533.0
@graphql-codegen/typescript-mongodb@2.3.13-alpha-2ada7b533.0
@graphql-codegen/typescript-msw@1.0.14-alpha-2ada7b533.0
@graphql-codegen/named-operations-object@2.2.2-alpha-2ada7b533.0
@graphql-codegen/typescript-oclif@2.2.15-alpha-2ada7b533.0
@graphql-codegen/typescript-operations@2.4.4-alpha-2ada7b533.0
@graphql-codegen/typescript-react-apollo@3.2.18-alpha-2ada7b533.0
@graphql-codegen/typescript-react-offix@2.2.15-alpha-2ada7b533.0
@graphql-codegen/typescript-react-query@3.5.16-alpha-2ada7b533.0
@graphql-codegen/typescript-resolvers@2.6.8-alpha-2ada7b533.0
@graphql-codegen/typescript-rtk-query@2.2.16-alpha-2ada7b533.0
@graphql-codegen/typescript-stencil-apollo@2.2.15-alpha-2ada7b533.0
@graphql-codegen/typescript-type-graphql@2.2.16-alpha-2ada7b533.0
@graphql-codegen/typed-document-node@2.2.15-alpha-2ada7b533.0
@graphql-codegen/typescript@2.6.1-alpha-2ada7b533.0
@graphql-codegen/typescript-urql@3.5.14-alpha-2ada7b533.0
@graphql-codegen/typescript-urql-graphcache@2.2.18-alpha-2ada7b533.0
@graphql-codegen/urql-svelte-operations-store@1.1.22-alpha-2ada7b533.0
@graphql-codegen/typescript-vue-apollo@3.2.16-alpha-2ada7b533.0
@graphql-codegen/typescript-vue-apollo-smart-ops@2.2.15-alpha-2ada7b533.0
@graphql-codegen/typescript-vue-urql@2.2.16-alpha-2ada7b533.0
@graphql-codegen/gql-tag-operations-preset@1.4.1-alpha-2ada7b533.0
@graphql-codegen/graphql-modules-preset@2.3.15-alpha-2ada7b533.0
@graphql-codegen/import-types-preset@2.1.22-alpha-2ada7b533.0
@graphql-codegen/near-operation-file-preset@2.2.16-alpha-2ada7b533.0
@graphql-codegen/plugin-helpers@2.5.0-alpha-2ada7b533.0

Copy link
Collaborator

@n1ru4l n1ru4l left a comment

Choose a reason for hiding this comment

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

could every config option automatically be a cli option? then we don't have to implement stuff twice?

Copy link
Collaborator

@n1ru4l n1ru4l left a comment

Choose a reason for hiding this comment

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

Legit

@saihaj saihaj merged commit 8e44df5 into master Jul 7, 2022
@saihaj saihaj deleted the saihaj/7943 branch July 7, 2022 15:32
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.

Allow --ignore-no-documents flag to prevent exit code 1
4 participants