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

Make TypeVisitor result type nullable #1212

Closed
wants to merge 2 commits into from

Conversation

pelepelin
Copy link

@pelepelin pelepelin commented Oct 3, 2019

TypeVisitor is expected to return GraphQLNamedType | null | undefined in the code here
https://github.com/apollographql/graphql-tools/blob/9bfb11c51e2ca57579a950bd8de65adb0e1f37a3/src/transforms/visitSchema.ts#L60

However, it is declared as non-nullable here
https://github.com/apollographql/graphql-tools/blob/9bfb11c51e2ca57579a950bd8de65adb0e1f37a3/src/transforms/visitSchema.ts#L33-L36

Which leads to necessity of type cast when a null-returning visitor is defined.

TODO:

  • [ ] If this PR is a new feature, reference an issue where a consensus about the design was reached (not necessary for small changes)
  • [ ] Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass
  • Update CHANGELOG.md with your change. Include a description of your change, link to PR (always) and issue (if applicable). Add your CHANGELOG entry under vNEXT. Do not create a new version number for your change yourself.

@apollo-cla
Copy link

@pelepelin: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

@yaacovCR yaacovCR mentioned this pull request Nov 4, 2019
5 tasks
@yaacovCR
Copy link
Collaborator

yaacovCR commented Apr 1, 2020

Closed in favor of #1307

@yaacovCR yaacovCR closed this Apr 1, 2020
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.

None yet

4 participants