@alxia/graphql 0.18.3 → 0.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/docs/migrating-to-graxia.md +11 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ bun add -d typescript
|
|
|
13
13
|
bun add @graxia/envelop @envelop/depth-limit # install yourself to use Envelop plugins
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
`@graxia/core` (`^0.10.0 || ^0.11.0 || ^0.12.0`), `@graxia/graphiql` (`^0.2.4`) and `graphql` (17.1 or later) are peers:
|
|
16
|
+
`@graxia/core` (`^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0`), `@graxia/graphiql` (`^0.2.4`) and `graphql` (17.1 or later) are peers:
|
|
17
17
|
the package declares no dependency. `@graxia/graphiql` serves the IDE and is
|
|
18
18
|
required. CSRF protection is graxia's default (on): a `GET` needs one of the
|
|
19
19
|
`x-graphql-csrf`, `graphql-require-preflight`, `apollo-require-preflight` or
|
|
@@ -26,7 +26,7 @@ bun add graphql@^17.1.0
|
|
|
26
26
|
|
|
27
27
|
| Before | After |
|
|
28
28
|
| --- | --- |
|
|
29
|
-
| `graphql-yoga` | `@graxia/core` `^0.10.0 \|\| ^0.11.0 \|\| ^0.12.0` (0.10 sets the HTTP status from errors again) |
|
|
29
|
+
| `graphql-yoga` | `@graxia/core` `^0.10.0 \|\| ^0.11.0 \|\| ^0.12.0 \|\| ^0.13.0` (0.10 sets the HTTP status from errors again) |
|
|
30
30
|
| `graphql-ws` (for `ws`) | nothing: graxia speaks `graphql-transport-ws` |
|
|
31
31
|
| bundled GraphiQL of Yoga | `@graxia/graphiql` `^0.2.4` (required) |
|
|
32
32
|
| Envelop plugins | not a peer: install `@graxia/envelop` yourself to use Envelop plugins |
|
|
@@ -69,6 +69,14 @@ schema (a directive the SDL already declares is kept). A `schema.graphql`
|
|
|
69
69
|
printed from the Yoga schema, or a snapshot of it, no longer matches: print it
|
|
70
70
|
again from the new schema and commit the result.
|
|
71
71
|
|
|
72
|
+
A schema that graphql's own `graphql()` or `execute()` also runs (a second
|
|
73
|
+
endpoint, a script, a spec that skips graxia) needs `incremental: false`.
|
|
74
|
+
On a schema that declares `@defer` and `@stream`, graphql's `graphql()` and
|
|
75
|
+
`execute()` throw "The provided schema unexpectedly contains experimental
|
|
76
|
+
directives (@defer or @stream)…", so every spec that runs that schema fails
|
|
77
|
+
at once. With `incremental: false` that schema serves no `@defer` or
|
|
78
|
+
`@stream`. See graxia's [schema guide](https://github.com/softistx/graxia/blob/develop/packages/core/docs/guide/schema.md).
|
|
79
|
+
|
|
72
80
|
```ts
|
|
73
81
|
// file: src/schema-maps.ts
|
|
74
82
|
import { createSchema } from '@graxia/core';
|
|
@@ -329,7 +337,8 @@ prefix, `GraphQLContext<typeof app>`, `oncePerRequest`, `freshPerMutation`,
|
|
|
329
337
|
3. Import `createSchema` from `@graxia/core` and curry it: `createSchema<Ctx>()({ … })`;
|
|
330
338
|
pass several resolver maps as an array, not a cast; print `schema.graphql`
|
|
331
339
|
again (graxia adds `@cost`, `@listSize` and, unless `incremental: false`,
|
|
332
|
-
`@defer`, `@stream`)
|
|
340
|
+
`@defer`, `@stream`); build with `incremental: false` a schema that
|
|
341
|
+
graphql's plain `graphql()` or `execute()` also runs.
|
|
333
342
|
4. Annotate the `context` option's argument with `ServerContext`, and read the
|
|
334
343
|
app's values from `serverContext`.
|
|
335
344
|
5. Rewrite each Yoga plugin (`definePlugin`) or wrap it (`fromEnvelop`), the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alxia/graphql",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.4",
|
|
4
4
|
"description": "GraphQL for alxia served by @graxia/core: its plugins, subscriptions over SSE or WebSocket and GraphiQL, behind the app's hooks, its resolvers reading the app's typed context",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"@alxia/telemetry": "^0.9.4",
|
|
53
53
|
"@envelop/core": "^6.0.1",
|
|
54
54
|
"@envelop/depth-limit": "^7.2.1",
|
|
55
|
-
"@graxia/core": "^0.
|
|
56
|
-
"@graxia/envelop": "^0.1.
|
|
57
|
-
"@graxia/graphiql": "^0.2.
|
|
55
|
+
"@graxia/core": "^0.13.0",
|
|
56
|
+
"@graxia/envelop": "^0.1.7",
|
|
57
|
+
"@graxia/graphiql": "^0.2.7",
|
|
58
58
|
"@softistx/telemetry": "^0.5.0",
|
|
59
59
|
"@types/bun": "^1.4.4",
|
|
60
60
|
"dataloader": "^2.2.3",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@alxia/core": "^0.27.0",
|
|
65
65
|
"graphql": "^17.1.0",
|
|
66
66
|
"typescript": "^6.0.3 || ^7.0.0",
|
|
67
|
-
"@graxia/core": "^0.10.0 || ^0.11.0 || ^0.12.0",
|
|
67
|
+
"@graxia/core": "^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0",
|
|
68
68
|
"@graxia/graphiql": "^0.2.4"
|
|
69
69
|
}
|
|
70
70
|
}
|