Skip to content

Conversation

@KammererTob
Copy link
Contributor

@KammererTob KammererTob commented Jul 4, 2020

Fixes #409

Checklist

  • Pull requests follows the contribution guide
  • New or modified functionality is covered by tests

Description

I tried to fix #409 with this PR. Quick rundown of the problem and what my attempt to fix it was:
This commit 10ee43f tried to address #385 by using GraphQLInputObjectTypes instead of just GraphQLTypeReferences. The GraphQLInputObjectTypes will be populated with a full list of field definitions, which in turn will create GraphQLInputObjectTypes if necessary. The stackoverflow occured when a field needed to create a GraphQLInputObjectType, which then would have a reference back to any ancestor in the creation chain. Since at that point the ancestor did not yet exist in the inputObjects list the function tries to create it again, which restarts the whole chain.

My fix: Instead of using GraphQLInputObjectTypes for everything we keep a list of all ancestors (called referencingInputObjects). If we then encounter a type which already is in this list we return a GraphQLTypeReference instead of the full GraphQLInputObjectType again. This should hopefully allow #385 to still be functional, while also fixing #409, although i did not test, for that. So maybe someone more knowledgeable should have a look at the specific use-case of #385

@tedepstein
Copy link

Any news on this pull request? I have also encountered this issue.

@lnorregaard
Copy link

I have also just run into this. Any knowledge of the fix for this

Copy link
Member

@vojtapol vojtapol left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! Please address the conflict and we can merge this.

@vojtapol vojtapol merged commit 3abb3ed into graphql-java-kickstart:master Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants