Skip to content

Exception fix for non-query compound requests #477

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 1 commit into from
Jan 9, 2021

Conversation

WouterG
Copy link
Contributor

@WouterG WouterG commented Jan 9, 2021

Hi,

I encountered a bug while using the GraphQLRequests#toHttpJsonBody method, causing it to be unable to compile requests of non-query types.

I swapped the code to use the first request's operation type instead of using the default QUERY type, as the value would only be updated in the loop, after the check with exception had already happened.

The operation of getting the first entry is safe to use as the list is checked before to not be empty.

Hope to hear from you, and have an update for our usage 👍

Use the first request's type to match all others against, as the previous method would only update the type after the check was being performed
@kobylynskyi kobylynskyi self-requested a review January 9, 2021 02:50
@kobylynskyi kobylynskyi self-assigned this Jan 9, 2021
@kobylynskyi kobylynskyi added the bug Something isn't working label Jan 9, 2021
Copy link
Owner

@kobylynskyi kobylynskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WouterG, looks good to me.
Thanks a lot for the contribution!
I will release it as part of 4.1.1 this weekend.

@kobylynskyi kobylynskyi added this to the 4.1.1 milestone Jan 9, 2021
@kobylynskyi kobylynskyi merged commit f83708c into kobylynskyi:master Jan 9, 2021
@kobylynskyi
Copy link
Owner

@WouterG, version 4.1.1 was released today.
Thanks again for the fix you provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants