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

Circular input property leads to stackoverflow #409

Closed
KammererTob opened this issue Jun 22, 2020 · 3 comments · Fixed by #414
Closed

Circular input property leads to stackoverflow #409

KammererTob opened this issue Jun 22, 2020 · 3 comments · Fixed by #414
Labels

Comments

@KammererTob
Copy link
Contributor

KammererTob commented Jun 22, 2020

After updating graphql-java-tools to 6.1.0 i have encountered a stackoverflow exception on startup. I think that the problem was introduced in this commit: 10ee43f and happens because of the interaction between determineInputType and createInputObject.
Example schema:

input A {
    id: ID!
    b: B
}

input B {
   id: ID!
   a: A
}

According to the spec this should be allowed (graphql/graphql-spec#445, graphql/graphql-spec#189), which leads me to believe that this is a bug.

@KammererTob KammererTob changed the title Circular input property leads to Stackoverflow Circular input property leads to stackoverflow Jun 22, 2020
@vojtapol vojtapol added the bug label Jun 22, 2020
@vojtapol
Copy link
Member

vojtapol commented Jul 2, 2020

Confirmed bug. Contributions welcome.

KammererTob added a commit to KammererTob/graphql-java-tools that referenced this issue Jul 4, 2020
@KammererTob KammererTob mentioned this issue Jul 4, 2020
2 tasks
@enriquedacostacambio
Copy link

fyi, simple (non-mutual) recursion also triggers the bug:

input CriterionInput {
    and: [CriterionInput!]
    or: [CriterionInput!]
    not: CriterionInput
    status: StatusCriterionInput
}

input StatusCriterionInput {
    eq: String
}

@PhilippS93
Copy link

Can confirm. This is especially important for filtering purposes like recursive OR and AND patterns.

vojtapol added a commit that referenced this issue Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants