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

Call prepare on lists of input objects #4933

Merged
merged 4 commits into from Apr 25, 2024

Conversation

engwan
Copy link
Contributor

@engwan engwan commented Apr 25, 2024

When the argument is a list of input objects we need to call prepare on each item of the list.

When the argument is a list of input objects we need to call prepare on
each item of the list
@engwan
Copy link
Contributor Author

engwan commented Apr 25, 2024

@rmosolgo I found a bug related to #4902

I'm not sure if there's a better way to check for lists of input objects but I've added a spec to illustrate the bug.

@rmosolgo
Copy link
Owner

Thanks for sharing this fix! Did this used to work before 2.3.1?

@engwan
Copy link
Contributor Author

engwan commented Apr 25, 2024

Thanks for sharing this fix! Did this used to work before 2.3.1?

Yes, this used to work before 2.3.1 because coerce_input called prepare.

I am trying to upgrade the GraphQL gem for GitLab and the upgrade broke our tests: https://gitlab.com/gitlab-org/gitlab/-/jobs/6711137035

I did manage to get a workaround working here: https://gitlab.com/gitlab-org/gitlab/-/commit/16e8a1035180f039cf02359b180be799ec813d68. But I think it would be better to have it fixed upstream.

@rmosolgo
Copy link
Owner

Cool, thanks for clarifying. I added a commit to handle lists-of-lists, too! I'm going to investigate one other report of a bug from this change before I release the new version 👀 https://github.com/rmosolgo/graphql-ruby/pull/4902/files#r1579471558

@rmosolgo rmosolgo added this to the 2.3.2 milestone Apr 25, 2024
@rmosolgo rmosolgo merged commit 81db09b into rmosolgo:master Apr 25, 2024
12 checks passed
@engwan
Copy link
Contributor Author

engwan commented Apr 25, 2024

Thanks for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants