-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix @defer
with payload containing "---"
#10891
Conversation
When using `@defer` if the response payload contains "---" then the query will fail with an error message such as: ApolloError: Unterminated string in JSON at position 15378
👷 Deploy request for apollo-client-docs pending review.Visit the deploys page to approve it
|
🦋 Changeset detectedLatest commit: 76f2814 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Re: @alessbell |
are not parsed within response data, only read at the beginning of each chunk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch and thanks for the PR, @laverdet! Updated a test case to prevent regressions, this fix LGTM 🚀
"Unsupported patch content type: application/json is required." | ||
); | ||
} | ||
// nb: Technically you'd want to slice off the beginning "\r\n" but since |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
When using
@defer
if the response payload contains "---" then the query will fail with an error message such as:Checklist: