Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Sep 7, 2022
1 parent 24a0af9 commit f43bf60
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"weak-napi": ""
},
"resolutions": {
"@whatwg-node/fetch": "0.4.0",
"@whatwg-node/fetch": "0.4.2",
"graphql": "16.6.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ describe('incremental delivery', () => {
const yoga = createYoga({
logging: false,
plugins: [plugin],
maskedErrors: false,
})

const server = createServer(yoga)
Expand Down Expand Up @@ -140,7 +139,27 @@ describe('incremental delivery: node-fetch', () => {
fields: () => ({
name: { type: GraphQLString },
type: { type: GraphQLString },
text: { type: GraphQLString },
text: {
type: GraphQLString,
resolve: async (file) => {
try {
return await file.text()
} catch (e) {
if (
e instanceof Error &&
e.message.startsWith('File size limit exceeded: ')
) {
throw createGraphQLError(e.message, {
extensions: {
http: {
status: 413,
},
},
})
}
}
},
},
}),
}),
description: 'Upload a single file',
Expand Down Expand Up @@ -339,6 +358,8 @@ describe('incremental delivery: node-fetch', () => {
body: formData,
})

expect(response.status).toBe(413)

const body = await response.json()

expect(body.errors).toBeDefined()
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-yoga/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@graphql-tools/schema": "^9.0.0",
"@graphql-tools/utils": "^8.8.0",
"@graphql-yoga/subscription": "^2.2.2",
"@whatwg-node/fetch": "^0.4.0",
"@whatwg-node/fetch": "^0.4.2",
"@whatwg-node/server": "0.2.0",
"dset": "^3.1.1",
"graphql-config": "^4.1.0",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5868,10 +5868,10 @@
"@webassemblyjs/ast" "1.11.1"
"@xtuc/long" "4.2.2"

"@whatwg-node/fetch@0.4.0", "@whatwg-node/fetch@^0.3.0", "@whatwg-node/fetch@^0.3.2", "@whatwg-node/fetch@^0.4.0":
version "0.4.0"
resolved "https://registry.yarnpkg.com/@whatwg-node/fetch/-/fetch-0.4.0.tgz#c638d20c76f0b6bfb23944496c6f5903090b4b00"
integrity sha512-dUsdttxfkYqQ5tRijaIlad+CSww8AyoH7OQRHaI+CPXjLV1C/nuAin10fIT0PyfokjTwgR2jbCsRQdtcSOvklA==
"@whatwg-node/fetch@0.4.2", "@whatwg-node/fetch@^0.3.0", "@whatwg-node/fetch@^0.3.2", "@whatwg-node/fetch@^0.4.0", "@whatwg-node/fetch@^0.4.2":
version "0.4.2"
resolved "https://registry.yarnpkg.com/@whatwg-node/fetch/-/fetch-0.4.2.tgz#a5045d66b1ef09f02c07f997c40302a49e82cbf8"
integrity sha512-5ACCCexn6i5Ud45wHxcqSzlcRes1FfKgRpEs87V1Ha6gJTc7wNdw7TJQE7qoYMI0dGjVmKbDvP0+Em4HKF8JLQ==
dependencies:
"@peculiar/webcrypto" "^1.4.0"
abort-controller "^3.0.0"
Expand Down

0 comments on commit f43bf60

Please sign in to comment.