Skip to content

Commit

Permalink
fix(core): move multipart/mixed to end of accept headers (#3039)
Browse files Browse the repository at this point in the history
Co-authored-by: Phil Pluckthun <[email protected]>
  • Loading branch information
JoviDeCroock and kitten authored Mar 14, 2023
1 parent ad1ada4 commit 77f6f3a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/early-crabs-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@urql/core': patch
---

Move `multipart/mixed` to end of `Accept` header to avoid cauing Yoga to unnecessarily use it.
3 changes: 2 additions & 1 deletion packages/core/src/internal/fetchOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ export const makeFetchOptions = (
): RequestInit => {
const useGETMethod =
operation.kind === 'query' && !!operation.context.preferGetMethod;

const headers: HeadersInit = {
accept:
'multipart/mixed, application/graphql-response+json, application/graphql+json, application/json',
'application/graphql-response+json, application/graphql+json, application/json, multipart/mixed',
};
if (!useGETMethod) headers['content-type'] = 'application/json';
const extraOptions =
Expand Down

0 comments on commit 77f6f3a

Please sign in to comment.