-
Notifications
You must be signed in to change notification settings - Fork 172
Fix for #409 #414
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
Merged
Merged
Fix for #409 #414
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Any news on this pull request? I have also encountered this issue. |
edacostacambioupgrade
previously approved these changes
Sep 29, 2020
I have also just run into this. Any knowledge of the fix for this |
vojtapol
requested changes
Nov 17, 2020
There was a problem hiding this 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.
2 tasks
# Conflicts: # src/main/kotlin/graphql/kickstart/tools/SchemaParser.kt
vojtapol
approved these changes
Dec 14, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #409
Checklist
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 justGraphQLTypeReferences
. TheGraphQLInputObjectTypes
will be populated with a full list of field definitions, which in turn will createGraphQLInputObjectTypes
if necessary. The stackoverflow occured when a field needed to create aGraphQLInputObjectType
, 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 theinputObjects
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 aGraphQLTypeReference
instead of the fullGraphQLInputObjectType
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