Skip to content

Commit 75d8963

Browse files
committed
improve: remove top-level signal config
1 parent ec6407a commit 75d8963

File tree

7 files changed

+4
-10
lines changed

7 files changed

+4
-10
lines changed

examples/10_transport-http/transport-http_abort.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ const graffle = Graffle.create({
1515
graffle
1616

1717
const resultPromise = graffle
18-
.with({ transport: { signal: abortController.signal } })
19-
// ^^^^^^^^^^^^^^^
18+
.with({ transport: { raw: { signal: abortController.signal } } })
19+
// ^^^^^^^^^^^^^^^
2020
.gql`
2121
{
2222
pokemon {

examples/__outputs__/10_transport-http/transport-http_extension_headers__dynamicHeaders.output.test.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
'content-type': 'application/json',
77
'x-sent-at-time': 'DYNAMIC_VALUE'
88
},
9-
signal: undefined,
109
method: 'post',
1110
url: 'http://localhost:3000/graphql',
1211
body: '{"query":"{ pokemons { name } }"}'

examples/__outputs__/10_transport-http/transport-http_method-get.output.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
'content-type': 'application/json',
77
tenant: 'nano'
88
},
9-
signal: undefined,
109
method: 'post',
1110
url: URL {
1211
href: 'http://localhost:3000/graphql',
@@ -31,7 +30,6 @@
3130
accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8',
3231
tenant: 'nano'
3332
},
34-
signal: undefined,
3533
method: 'get',
3634
url: URL {
3735
href: 'http://localhost:3000/graphql?query=%7B%0A++pokemonByName%28name%3A+%22Nano%22%29+%7B%0A++++hp%0A++%7D%0A%7D',

examples/__outputs__/10_transport-http/transport-http_raw.output.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8',
66
'content-type': 'application/json'
77
},
8-
signal: undefined,
98
mode: 'cors',
109
method: 'post',
1110
url: 'http://localhost:3000/graphql',

src/layers/6_client/client.transport-http.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ describe(`configuration`, () => {
106106
const abortErrorMessagePattern = /This operation was aborted|AbortError: The operation was aborted/
107107
test(`to constructor`, async () => {
108108
const abortController = new AbortController()
109-
const graffle = Graffle.create({ schema, transport: { signal: abortController.signal } })
109+
const graffle = Graffle.create({ schema, transport: { raw: { signal: abortController.signal } } })
110110
const resultPromise = graffle.gql`query { id }`.send()
111111
abortController.abort()
112112
const { caughtError } = await resultPromise.catch((caughtError: unknown) => ({ caughtError })) as any as {
@@ -116,7 +116,7 @@ describe(`configuration`, () => {
116116
})
117117
test(`to "with"`, async () => {
118118
const abortController = new AbortController()
119-
const graffle = Graffle.create({ schema }).with({ transport: { signal: abortController.signal } })
119+
const graffle = Graffle.create({ schema }).with({ transport: { raw: { signal: abortController.signal } } })
120120
const resultPromise = graffle.gql`query { id }`.send()
121121
abortController.abort()
122122
const { caughtError } = await resultPromise.catch((caughtError: unknown) => ({ caughtError })) as any as {

src/layers/6_client/transportHttp/request.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export type TransportHttpInput = {
2323
*/
2424
methodMode?: MethodMode
2525
headers?: HeadersInit
26-
signal?: AbortSignal | null
2726
raw?: RequestInit
2827
}
2928

src/requestPipeline/core.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ export const anyware = Anyware.create<HookSequence, HookMap, Grafaid.FormattedEx
9292
},
9393
{
9494
headers: input.state.config.transport.config.headers,
95-
signal: input.state.config.transport.config.signal,
9695
},
9796
),
9897
input.state.config.transport.config.raw,

0 commit comments

Comments
 (0)