Skip to content

Commit 61b6f50

Browse files
authored
feat(gql): encode custom scalars (#1178)
1 parent b597ba0 commit 61b6f50

File tree

179 files changed

+9660
-4587
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+9660
-4587
lines changed

examples/50_anyware/anyware_slot_slot-body__slot-search-params.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ const graffle = Graffle
1212
searchParams: (graphqlRequest) => {
1313
return {
1414
query: graphqlRequest.query,
15-
operationName: `queryContinents`,
15+
operationName: `getPokemon`,
1616
}
1717
},
1818
},
1919
})
2020
})
2121

2222
const result = await graffle.gql`
23-
query trainers {
24-
pokemon { name }
25-
}
26-
query pokemon {
23+
query getTrainers {
2724
trainers { name }
2825
}
26+
query getPokemon {
27+
pokemon { name }
28+
}
2929
`
30-
.send(`queryCountries`)
30+
.send(`getTrainers`)
3131

3232
show(result)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
headers: Headers {
55
accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8',
66
'content-type': 'application/json',
7-
'x-sent-at-time': '1728323381286'
7+
'x-sent-at-time': '1728856241218'
88
},
99
signal: undefined,
1010
method: 'post',

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
searchParams: URLSearchParams {},
2323
hash: ''
2424
},
25-
body: '{"query":"mutation { addPokemon(attack:0, defense:0, hp:1, name:\\"Nano\\", type: grass) { name } }"}'
25+
body: '{"query":"mutation {\\n addPokemon(attack: 0, defense: 0, hp: 1, name: \\"Nano\\", type: grass) {\\n name\\n }\\n}"}'
2626
}
2727
---------------------------------------- SHOW ----------------------------------------
2828
{
@@ -34,7 +34,7 @@
3434
signal: undefined,
3535
method: 'get',
3636
url: URL {
37-
href: 'http://localhost:3000/graphql?query=query+%7B+pokemonByName%28name%3A+%22Nano%22%29+%7B+hp+%7D+%7D',
37+
href: 'http://localhost:3000/graphql?query=%7B%0A++pokemonByName%28name%3A+%22Nano%22%29+%7B%0A++++hp%0A++%7D%0A%7D',
3838
origin: 'http://localhost:3000',
3939
protocol: 'http:',
4040
username: '',
@@ -43,8 +43,8 @@
4343
hostname: 'localhost',
4444
port: '3000',
4545
pathname: '/graphql',
46-
search: '?query=query+%7B+pokemonByName%28name%3A+%22Nano%22%29+%7B+hp+%7D+%7D',
47-
searchParams: URLSearchParams { 'query' => 'query { pokemonByName(name: "Nano") { hp } }' },
46+
search: '?query=%7B%0A++pokemonByName%28name%3A+%22Nano%22%29+%7B%0A++++hp%0A++%7D%0A%7D',
47+
searchParams: URLSearchParams { 'query' => '{\n pokemonByName(name: "Nano") {\n hp\n }\n}' },
4848
hash: ''
4949
}
5050
}

examples/__outputs__/20_output/output_envelope.output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
headers: Headers {
1919
'content-type': 'application/graphql-response+json; charset=utf-8',
2020
'content-length': '142',
21-
date: 'Mon, 07 Oct 2024 17:49:41 GMT',
21+
date: 'Sun, 13 Oct 2024 21:50:41 GMT',
2222
connection: 'keep-alive',
2323
'keep-alive': 'timeout=5'
2424
},

examples/__outputs__/20_output/output_envelope_envelope-error__envelope-error.output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
at runPipeline (/some/path/to/runPipeline.ts:XX:XX:18)
66
at async Object.run (/some/path/to/main.ts:XX:XX:22)
77
at async executeDocument (/some/path/to/requestMethods.ts:XX:XX:18)
8-
at async executeRootTypeField (/some/path/to/requestMethods.ts:XX:XX:18)
8+
at async executeRootField (/some/path/to/requestMethods.ts:XX:XX:18)
99
at async <anonymous> (/some/path/to/output_envelope_envelope-error__envelope-error.ts:XX:XX:16) {
1010
context: {
1111
hookName: 'encode',

examples/__outputs__/20_output/output_envelope_envelope_error-throw__envelope-error-throw.output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ContextualError: There was an error in the extension "anonymous" (use named func
77
at runPipeline (/some/path/to/runPipeline.ts:XX:XX:18)
88
at async Object.run (/some/path/to/main.ts:XX:XX:22)
99
at async executeDocument (/some/path/to/requestMethods.ts:XX:XX:18)
10-
at async executeRootTypeField (/some/path/to/requestMethods.ts:XX:XX:18)
10+
at async executeRootField (/some/path/to/requestMethods.ts:XX:XX:18)
1111
at async <anonymous> (/some/path/to/output_envelope_envelope_error-throw__envelope-error-throw.ts:XX:XX:1) {
1212
context: {
1313
hookName: 'encode',

examples/__outputs__/20_output/output_preset__standard-graphql.output.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,14 @@ ContextualError: There was an error in the core implementation of hook "exchange
1414
[cause]: TypeError: Failed to parse URL from ...
1515
at new Request (node:internal/deps/undici/undici:XX:XX)
1616
at Object.run (/some/path/to/core.ts:XX:XX:29)
17-
... 3 lines matching cause stack trace ...
18-
at async applyBody (/some/path/to/main.ts:XX:XX:22) {
17+
at runHook (/some/path/to/runHook.ts:XX:XX:37)
18+
at runHook (/some/path/to/runHook.ts:XX:XX:16) {
1919
[cause]: TypeError: Invalid URL
2020
at new URL (node:internal/url:XX:XX)
2121
at new Request (node:internal/deps/undici/undici:XX:XX)
2222
at Object.run (/some/path/to/core.ts:XX:XX:29)
2323
at runHook (/some/path/to/runHook.ts:XX:XX:37)
24-
at <anonymous> (/some/path/to/runHook.ts:XX:XX:14)
25-
at onRequest (/some/path/to/extension.ts:XX:XX:32)
26-
at async applyBody (/some/path/to/main.ts:XX:XX:22) {
24+
at runHook (/some/path/to/runHook.ts:XX:XX:16) {
2725
code: 'ERR_INVALID_URL',
2826
input: '...'
2927
}

examples/__outputs__/20_output/output_return-error.output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ContextualError: There was an error in the extension "anonymous" (use named func
33
at runPipeline (/some/path/to/runPipeline.ts:XX:XX:18)
44
at async Object.run (/some/path/to/main.ts:XX:XX:22)
55
at async executeDocument (/some/path/to/requestMethods.ts:XX:XX:18)
6-
at async executeRootTypeField (/some/path/to/requestMethods.ts:XX:XX:18)
6+
at async executeRootField (/some/path/to/requestMethods.ts:XX:XX:18)
77
at async <anonymous> (/some/path/to/output_return-error.ts:XX:XX:18) {
88
context: {
99
hookName: 'encode',

examples/__outputs__/20_output/output_return-error_return-error-execution__return-error-execution.output.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ContextualAggregateError: One or more errors in the execution result.
33
at handleOutput (/some/path/to/handleOutput.ts:XX:XX:19)
44
at executeDocument (/some/path/to/requestMethods.ts:XX:XX:10)
55
at process.processTicksAndRejections (node:internal/process/task_queues:XX:XX)
6-
at async executeRootTypeField (/some/path/to/requestMethods.ts:XX:XX:18)
6+
at async executeRootField (/some/path/to/requestMethods.ts:XX:XX:18)
77
at async <anonymous> (/some/path/to/output_return-error_return-error-execution__return-error-execution.ts:XX:XX:16) {
88
context: {},
99
cause: undefined,
@@ -39,7 +39,7 @@ ContextualError: There was an error in the extension "anonymous" (use named func
3939
at process.processTicksAndRejections (node:internal/process/task_queues:XX:XX)
4040
at async Object.run (/some/path/to/main.ts:XX:XX:22)
4141
at async executeDocument (/some/path/to/requestMethods.ts:XX:XX:18)
42-
at async executeRootTypeField (/some/path/to/requestMethods.ts:XX:XX:18)
42+
at async executeRootField (/some/path/to/requestMethods.ts:XX:XX:18)
4343
at async <anonymous> (/some/path/to/output_return-error_return-error-execution__return-error-execution.ts:XX:XX:3) {
4444
context: {
4545
hookName: 'encode',

examples/__outputs__/30_gql/gql_gql-document-node_gql-typed_gql-typed-graphql-document-node__gql-typed-graphql-document-node.output.txt

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)