-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Nested List Input Coercion not matching GraphQL spec #3858
Comments
I think @abhinand-c is right, the test here contradicts the above spec. Probably because the spec was changed in 2018 and the test followed the older spec of 2016. |
TLDR: I imagine the next step is to bring this to the attention of the WG at the next meeting. The tests were added on 9/27/2018. The spec change with the above table was made on 5/1/2018. The explanatory text there reads:
Looking back at graphql/graphql-spec#372, the spec change is attempting to clarify whether providing a single item for a recursive list should yield a nested list, and @leebyron adds that the intention had been that it should. i.e. the change is meant to clarify the following cases:
As noted above, the table includes additional cases:
That latter case about a nested list where a non-nested list is supplied does not seem to be directly addressed in the spec text, but by the fact that recursion is explicitly mandated by the issue noted above that inspired the spec change and the existing spec text, from the symmetry of the input from all the cases, from the fact that the spec change described itself as merely a clarification of existing behavior, it seems possible that the table has a typo and the cases for non-nested list input and nested list input types should be symmetrical:
In any case, as the spec text does not at all address the case in the table, either the spec text or the table must be updated. If we have different options of whether to change this line in the table or change the spec to match the table, we may want to follow the principle of least harm, i.e. let existing implementations' behavior dictate and avoid a change that will break existing operations. If there are multiple implementations that handle this case differently, and any standardization would break something, we actually have the choice of figuring out whether to fix the spec text or fix the table => I imagine we would favor recursion in this case as well just for consistency and fix the table, although I think the use case is much less likely. I would love to hear from @leebyron and anybody with working memory of how we got here => I imagine the next step is to bring this to the attention of the WG at the next meeting. |
@abhinand-c are you interested in adding this to the agenda of the next WG meeting this Thursday? You would add this item to the agenda by opening up a PR with the new item on: If you can't make that date, you can add it to a later meeting this or next month. |
Sure✨, I'll add this to the WG Meeting agenda, and join the meeting. |
My summary of the points from the meeting on 2023.06.02 --
@abhinand-c et al feel free to add any recollections or correct the above :) |
Not that I am aware of. |
Tracked at graphql/graphql-spec#1057 |
Note: this was ultimately changed into the spec as an update to the version presented in the table, so there is no need to update the reference implementation. |
There seems to be a deviation of Nested List Input Coercion in GraphQL library and the GraphQL specification.
The fix for the same is raised in a PR in graphql-python/graphql-core#194
(This was my first time contributing to GraphQL core library, sorry for missing out on the recommended practice of raising a issue and engaging proper discussion here)
The text was updated successfully, but these errors were encountered: