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

Prevent infer input fields infinite recursion #2436

Conversation

jasonphillips
Copy link
Contributor

Test and fix for #2420

Ensures that the recursive type-checking of new graphql fields added by plugins does not infinitely recur when types contain circular references. The solution used is to simply track the set of types during a traversal, aborting at the first instance of circularity, yet preserving the functionality of input type inference up until that point.

@jasonphillips jasonphillips changed the title Prevent infer input fields recursion Prevent infer input fields infinite recursion Oct 12, 2017
@gatsbybot
Copy link
Collaborator

Deploy preview ready!

Built with commit ce5d386

https://deploy-preview-2436--gatsbygram.netlify.com

@KyleAMathews
Copy link
Contributor

Thanks!

Seems correct. @Zalastax any feedback?

@Zalastax
Copy link
Contributor

Very nice! Merge it!

It's great that since createTypeNames guarantees unique names this won't run into conflicts even if two fields have the same name.
When gatsby start using React 16 I'd consider using Set, but that's for the future.

@KyleAMathews
Copy link
Contributor

This is node.js code so we're already good there :-) Set was first added to Node 4 which is the lowest version we support.

@KyleAMathews
Copy link
Contributor

But anyways, this is plenty good enough. Merging! Thanks!

@jlengstorf
Copy link
Contributor

Hiya @jasonphillips! 👋

This is definitely late, but on behalf of the entire Gatsby community, I wanted to say thank you for being here.

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. (We’ve got t-shirts and hats, plus some socks that are really razzing our berries right now.)
  2. If you’re not already part of it, we just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. You’ll receive an email shortly asking you to confirm. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If you have questions, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again! 💪💜

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.

5 participants