Skip to content

fix(field-suggestions): Fix block-field-suggestions rule throwing Bod… #19

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 11, 2024

Conversation

ldebruijn
Copy link
Owner

Fix bug on Block Field suggestions rule.

We found that the block field suggestion rule broke when the response body did not contain the valid JSON (i.e. when proxying GraphiQL).

This MR makes sure to read the response body as plain bytes, try to determine whether it can and should be modified and if that fails, set the body back to the original bytes so that it can be read again later.

…y already Read error when response body does not contain expected json payload
@ldebruijn ldebruijn merged commit f0c551f into main Jan 11, 2024
@ldebruijn ldebruijn deleted the fix-field-suggestions branch January 11, 2024 21:05
ldebruijn added a commit that referenced this pull request Jan 23, 2024
#19)

Fix bug on Block Field suggestions rule.

We found that the block field suggestion rule broke when the response
body did not contain the valid JSON (i.e. when proxying GraphiQL).

This MR makes sure to read the response body as plain bytes, try to
determine whether it can and should be modified and if that fails, set
the body back to the original bytes so that it can be read again later.

Co-authored-by: ldebruijn <[email protected]>
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.

1 participant