-
Notifications
You must be signed in to change notification settings - Fork 96
Bug Fix- list of input types #107
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
Conversation
|
||
private graphql.schema.GraphQLType getOrPutInRegistry(graphql.schema.GraphQLType graphQLType) { | ||
graphql.schema.GraphQLType typeFromRegistry = typeRegistry.get(graphQLType.getName()); | ||
if (typeFromRegistry!=null) |
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.
please use braces in the if and else
Stack<graphql.schema.GraphQLType> typesStack= new Stack<>(); | ||
typesStack = getWrappedTypesStack(graphQLType, typesStack); | ||
graphql.schema.GraphQLType wrappedType = typesStack.pop(); | ||
if (wrappedType instanceof GraphQLObjectType){ |
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.
What if I have an interface? will this still work? (I don't remember if an interface is also an objectType)
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.
It won't, but Im not sure if we should handle it the same way
He doesn't solve issue #78 entirely. This PR allows List of List of List (...) of Input Type (it handles it recursively), while his PR does not. |
Actually List of List of List of Input types work in #94 , I've just added a unit test. It also allows you to use constructor with typed fields instead of simple map, which makes possible to use more complex type ( in the unit test, an input containing a list of other objects ) |
collect(Collectors.toList())); | ||
} | ||
|
||
private GraphQLInputType handleGraphQLList(graphql.schema.GraphQLType type) { |
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.
I think it is better that the function get a GraphQLList as an input
Do you have tests that check list of inputs? |
} | ||
} | ||
|
||
private graphql.schema.GraphQLType getOrPutInRegistry(graphql.schema.GraphQLType graphQLType) { |
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.
rename method
GraphQLInputObjectType inputObject = getInputObject((GraphQLObjectType) wrappedType, "input"); | ||
inputObject = (GraphQLInputObjectType) getOrPutInRegistry(inputObject); | ||
inputType = inputObject; | ||
while (!typesStack.isEmpty()) { |
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.
extract to different method
fixes the bug of unsupported list of input types as an argument
fixing issue #78
fixing issue #90