Skip to content

Commit 1482a89

Browse files
authored
feat: remove stream and defer directives (#1138)
1 parent 23d6080 commit 1482a89

Some content is hidden

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

41 files changed

+210
-296
lines changed

examples/55_generated/generated_alias.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ const year = day * 365.25
1212
const yearsAgo100 = new Date(Date.now() - year * 100).getTime()
1313
const yearsAgo1 = new Date(Date.now() - year).getTime()
1414

15+
// dprint-ignore
1516
const pokemons = await pokemon.query.$batch({
1617
pokemons: [
1718
[`elderPokemons`, {
19+
// ^^^^^^^^^^^^^^^
1820
$: { filter: { birthday: { lte: yearsAgo100 } } },
1921
name: true,
2022
}],
2123
[`babyPokemons`, {
24+
// ^^^^^^^^^^^^^^
2225
$: { filter: { birthday: { gte: yearsAgo1 } } },
2326
name: true,
2427
}],

examples/55_generated/generated_directive.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,26 @@ import { Pokemon } from '../$/generated-clients/pokemon/__.js'
77
import { showJson } from '../$/helpers.js'
88

99
const pokemon = Pokemon.create()
10-
// .anyware(({ pack }) => {
11-
// console.log(print(parse(pack.input.query)))
12-
// return pack()
13-
// })
1410

11+
// dprint-ignore
1512
const pokemons = await pokemon.query.$batch({
1613
___: {
17-
// $skip: true,
18-
// $defer: true,
14+
$skip: true,
15+
// ^^^^^^^^^^^^
1916
pokemons: {
2017
name: true,
2118
},
2219
},
2320
trainers: {
24-
// $stream: {
25-
// if: true,
26-
// initialCount: 0,
27-
// label: `trainers`,
28-
// },
2921
name: true,
3022
id: {
3123
$skip: true,
24+
// ^^^^^^^^^^^^
3225
},
3326
pokemon: {
3427
id: {
3528
$include: false,
29+
// ^^^^^^^^^^^^^^^^
3630
},
3731
name: true,
3832
},

examples/55_generated/generated_document.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { showJson } from '../$/helpers.js'
88
const pokemon = Pokemon.create()
99

1010
const pokemons = await pokemon.document({
11+
// ^^^^^^^^
1112
query: { // An operation type.
1213
pokemonsAndTrainers: { // A name chosen by you for this operation.
1314
trainers: { // A selection on a Query type field (aka. root field, entrypoint).
@@ -39,6 +40,6 @@ const pokemons = await pokemon.document({
3940
},
4041
},
4142
})
42-
.run(`pokemonsAndTrainers`)
43+
.run(`pokemonsAndTrainers`) // Set operation name to be executed and send request.
4344

4445
showJson(pokemons)

examples/55_generated/generated_root-field.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ import { showJson } from '../$/helpers.js'
88
const pokemon = Pokemon.create()
99

1010
const pokemons = await pokemon.query.pokemons({ name: true })
11+
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1112

1213
showJson(pokemons)

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': '1727398656266'
7+
'x-sent-at-time': '1727402243716'
88
},
99
signal: undefined,
1010
method: 'post',

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
headers: Headers {
1717
'content-type': 'application/graphql-response+json; charset=utf-8',
1818
'content-length': '104',
19-
date: 'Fri, 27 Sep 2024 00:57:36 GMT',
19+
date: 'Fri, 27 Sep 2024 01:57:23 GMT',
2020
connection: 'keep-alive',
2121
'keep-alive': 'timeout=5'
2222
},

examples/__outputs__/55_generated/generated_directive.output.txt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,5 @@
2020
}
2121
]
2222
}
23-
],
24-
"pokemons": [
25-
{
26-
"name": "Pikachu"
27-
},
28-
{
29-
"name": "Charizard"
30-
},
31-
{
32-
"name": "Squirtle"
33-
},
34-
{
35-
"name": "Bulbasaur"
36-
}
3723
]
3824
}

examples/__outputs__/60_extension/extension_opentelemetry__opentelemetry.output.txt

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
}
1010
},
1111
instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined },
12-
traceId: '244b6da7575c00d270d6b60798e72b7e',
13-
parentId: 'edb4fc3f1a36cb35',
12+
traceId: '00f7caa8f793fd361b4dd9d8bfac44a6',
13+
parentId: '389e0f006c1b18ee',
1414
traceState: undefined,
1515
name: 'encode',
16-
id: '41893153e418647a',
16+
id: 'bd3e0c33c7f0618a',
1717
kind: 0,
18-
timestamp: 1727398656738000,
19-
duration: 559.083,
18+
timestamp: 1727402244351000,
19+
duration: 815.833,
2020
attributes: {},
2121
status: { code: 0 },
2222
events: [],
@@ -33,14 +33,14 @@
3333
}
3434
},
3535
instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined },
36-
traceId: '244b6da7575c00d270d6b60798e72b7e',
37-
parentId: 'edb4fc3f1a36cb35',
36+
traceId: '00f7caa8f793fd361b4dd9d8bfac44a6',
37+
parentId: '389e0f006c1b18ee',
3838
traceState: undefined,
3939
name: 'pack',
40-
id: '7f4237b522a4a573',
40+
id: '55ba8c5ec3d2f8a3',
4141
kind: 0,
42-
timestamp: 1727398656741000,
43-
duration: 11605.459,
42+
timestamp: 1727402244355000,
43+
duration: 16379.75,
4444
attributes: {},
4545
status: { code: 0 },
4646
events: [],
@@ -57,14 +57,14 @@
5757
}
5858
},
5959
instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined },
60-
traceId: '244b6da7575c00d270d6b60798e72b7e',
61-
parentId: 'edb4fc3f1a36cb35',
60+
traceId: '00f7caa8f793fd361b4dd9d8bfac44a6',
61+
parentId: '389e0f006c1b18ee',
6262
traceState: undefined,
6363
name: 'exchange',
64-
id: '10602c9bbc43dd1d',
64+
id: 'bdb99e5752ccec59',
6565
kind: 0,
66-
timestamp: 1727398656753000,
67-
duration: 21156.417,
66+
timestamp: 1727402244373000,
67+
duration: 23841.417,
6868
attributes: {},
6969
status: { code: 0 },
7070
events: [],
@@ -81,14 +81,14 @@
8181
}
8282
},
8383
instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined },
84-
traceId: '244b6da7575c00d270d6b60798e72b7e',
85-
parentId: 'edb4fc3f1a36cb35',
84+
traceId: '00f7caa8f793fd361b4dd9d8bfac44a6',
85+
parentId: '389e0f006c1b18ee',
8686
traceState: undefined,
8787
name: 'unpack',
88-
id: '2306ef1e07c28f31',
88+
id: 'edf0e40528ece12f',
8989
kind: 0,
90-
timestamp: 1727398656774000,
91-
duration: 1144.458,
90+
timestamp: 1727402244397000,
91+
duration: 1305.875,
9292
attributes: {},
9393
status: { code: 0 },
9494
events: [],
@@ -105,14 +105,14 @@
105105
}
106106
},
107107
instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined },
108-
traceId: '244b6da7575c00d270d6b60798e72b7e',
109-
parentId: 'edb4fc3f1a36cb35',
108+
traceId: '00f7caa8f793fd361b4dd9d8bfac44a6',
109+
parentId: '389e0f006c1b18ee',
110110
traceState: undefined,
111111
name: 'decode',
112-
id: '7f538ab7279ff6be',
112+
id: '6d4d4750ecff5752',
113113
kind: 0,
114-
timestamp: 1727398656776000,
115-
duration: 189.833,
114+
timestamp: 1727402244398000,
115+
duration: 191.75,
116116
attributes: {},
117117
status: { code: 0 },
118118
events: [],
@@ -129,14 +129,14 @@
129129
}
130130
},
131131
instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined },
132-
traceId: '244b6da7575c00d270d6b60798e72b7e',
132+
traceId: '00f7caa8f793fd361b4dd9d8bfac44a6',
133133
parentId: undefined,
134134
traceState: undefined,
135135
name: 'request',
136-
id: 'edb4fc3f1a36cb35',
136+
id: '389e0f006c1b18ee',
137137
kind: 0,
138-
timestamp: 1727398656738000,
139-
duration: 38270.125,
138+
timestamp: 1727402244349000,
139+
duration: 49758.625,
140140
attributes: {},
141141
status: { code: 0 },
142142
events: [],

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@
126126
"devDependencies": {
127127
"@arethetypeswrong/cli": "^0.16.4",
128128
"@ark/attest": "^0.19.0",
129-
"@graphql-yoga/plugin-defer-stream": "^3.7.0",
130129
"@opentelemetry/api": "^1.9.0",
131130
"@opentelemetry/sdk-trace-base": "^1.26.0",
132131
"@opentelemetry/sdk-trace-node": "^1.26.0",

pnpm-lock.yaml

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)