@alxia/graphql 0.16.5 → 0.18.0
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 +60 -62
- package/dist/endpoint.d.ts +14 -2
- package/dist/endpoint.d.ts.map +1 -1
- package/dist/executor.d.ts +20 -37
- package/dist/executor.d.ts.map +1 -1
- package/dist/explorer.d.ts +24 -0
- package/dist/explorer.d.ts.map +1 -0
- package/dist/graphql.d.ts +32 -95
- package/dist/graphql.d.ts.map +1 -1
- package/dist/handler.d.ts +7 -34
- package/dist/handler.d.ts.map +1 -1
- package/dist/index.d.ts +3 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +301 -1011
- package/dist/index.js.map +14 -23
- package/dist/once-per-request.d.ts +5 -0
- package/dist/once-per-request.d.ts.map +1 -1
- package/dist/operation.d.ts +2 -7
- package/dist/operation.d.ts.map +1 -1
- package/dist/options.d.ts +38 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/removed.d.ts +14 -0
- package/dist/removed.d.ts.map +1 -0
- package/dist/sandbox.d.ts +3 -17
- package/dist/sandbox.d.ts.map +1 -1
- package/dist/testing/client.d.ts +9 -7
- package/dist/testing/client.d.ts.map +1 -1
- package/dist/testing/index.js +5 -1
- package/dist/testing/index.js.map +3 -3
- package/dist/ws.d.ts +18 -30
- package/dist/ws.d.ts.map +1 -1
- package/docs/README.md +3 -2
- package/docs/guide/context.md +40 -32
- package/docs/guide/endpoint.md +42 -27
- package/docs/guide/executor.md +23 -8
- package/docs/guide/ide.md +27 -64
- package/docs/guide/{yoga.md → plugins.md} +87 -72
- package/docs/guide/production.md +115 -196
- package/docs/guide/testing.md +24 -24
- package/docs/guide/websockets.md +21 -14
- package/docs/migrating-to-graxia.md +283 -0
- package/docs/roadmap.md +7 -11
- package/docs/troubleshooting.md +231 -248
- package/package.json +15 -22
- package/dist/body-refusal.d.ts +0 -25
- package/dist/body-refusal.d.ts.map +0 -1
- package/dist/document-cache.d.ts +0 -39
- package/dist/document-cache.d.ts.map +0 -1
- package/dist/field-rate-limit/count.d.ts +0 -28
- package/dist/field-rate-limit/count.d.ts.map +0 -1
- package/dist/field-rate-limit/from-store.d.ts +0 -21
- package/dist/field-rate-limit/from-store.d.ts.map +0 -1
- package/dist/field-rate-limit/index.d.ts +0 -5
- package/dist/field-rate-limit/index.d.ts.map +0 -1
- package/dist/field-rate-limit/ipv6-network.d.ts +0 -8
- package/dist/field-rate-limit/ipv6-network.d.ts.map +0 -1
- package/dist/field-rate-limit/plugin.d.ts +0 -28
- package/dist/field-rate-limit/plugin.d.ts.map +0 -1
- package/dist/field-rate-limit/types.d.ts +0 -60
- package/dist/field-rate-limit/types.d.ts.map +0 -1
- package/dist/nesting.d.ts +0 -18
- package/dist/nesting.d.ts.map +0 -1
- package/dist/parse-limits.d.ts +0 -50
- package/dist/parse-limits.d.ts.map +0 -1
- package/dist/same-origin/index.d.ts +0 -2
- package/dist/same-origin/index.d.ts.map +0 -1
- package/dist/same-origin/same-origin.d.ts +0 -30
- package/dist/same-origin/same-origin.d.ts.map +0 -1
- package/dist/ws-operations.d.ts +0 -31
- package/dist/ws-operations.d.ts.map +0 -1
- package/dist/ws-server.d.ts +0 -32
- package/dist/ws-server.d.ts.map +0 -1
- package/dist/yoga.d.ts +0 -12
- package/dist/yoga.d.ts.map +0 -1
package/dist/handler.d.ts
CHANGED
|
@@ -1,38 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The endpoint behind `graphql()`: one Yoga per path it is served at, and
|
|
3
|
-
* the route handler that hands each request to it.
|
|
4
|
-
*/
|
|
1
|
+
/** The route handler of the endpoint behind `graphql()`: each request goes to graxia. */
|
|
5
2
|
import { type BaseContext, type StatusCode } from '@alxia/core';
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
export type
|
|
9
|
-
/**
|
|
10
|
-
* What GraphiQL's page may load: its scripts, styles and Monaco's
|
|
11
|
-
* workers from the exact version of `@graphql-yoga/graphiql` the page
|
|
12
|
-
* names, fetched and run as blobs; queries to this server alone; framed
|
|
13
|
-
* by no one. A page that names none (a `renderGraphiQL` of the app's own)
|
|
14
|
-
* gets this server alone. `@alxia/secure-headers` keeps a policy a
|
|
15
|
-
* response already has.
|
|
16
|
-
*/
|
|
17
|
-
export declare function graphiqlPolicy(html: string): string;
|
|
18
|
-
/**
|
|
19
|
-
* The Yoga serving `endpoint`, created on first use. One per path: a plugin
|
|
20
|
-
* mounted under a prefix serves the same routes at a longer path, and
|
|
21
|
-
* GraphiQL must ask that one.
|
|
22
|
-
*/
|
|
23
|
-
export declare function yogaServers<UserCtx extends YogaContext>(options: Omit<YogaServerOptions<YogaContext, UserCtx>, 'graphqlEndpoint'>, caches?: () => YogaServerOptions<YogaContext, UserCtx>['parserAndValidationCache']): (endpoint: string) => YogaServerInstance<YogaContext, UserCtx>;
|
|
24
|
-
/**
|
|
25
|
-
* What Yoga is handed as its server context: the route's context — the
|
|
26
|
-
* middlewares' work — minus what a resolver has no use for.
|
|
27
|
-
*/
|
|
3
|
+
import type { Graxia } from '@graxia/core';
|
|
4
|
+
import type { DevOfRequest } from './explorer';
|
|
5
|
+
export type GraphQLServerContext = Record<string, any>;
|
|
6
|
+
/** What graxia is handed as its server context: the route's, minus what a resolver has no use for. */
|
|
28
7
|
export declare function serverContext(ctx: Record<string, unknown>): Record<string, unknown>;
|
|
29
|
-
|
|
30
|
-
* The handler of the endpoint's `GET` and `POST`: Apollo Sandbox's page to
|
|
31
|
-
* a browser when `sandbox` is not `false`, else the request to Yoga, with
|
|
32
|
-
* the route's context — the middlewares' work, minus what a resolver has no use
|
|
33
|
-
* for — as Yoga's server context.
|
|
34
|
-
*/
|
|
35
|
-
export declare function graphqlHandler<UserCtx extends YogaContext>(yogaAt: (endpoint: string) => YogaServerInstance<YogaContext, UserCtx>, sandbox: SandboxOptions | false): (ctx: Record<string, unknown> & BaseContext & {
|
|
8
|
+
export declare function graphqlHandler(graxia: Graxia<any>, devs: DevOfRequest): (ctx: Record<string, unknown> & BaseContext & {
|
|
36
9
|
readonly route: string;
|
|
37
|
-
}) => Promise<import("@alxia/core").Reply<StatusCode,
|
|
10
|
+
}) => Promise<import("@alxia/core").Reply<StatusCode, ReadableStream<Uint8Array<ArrayBufferLike>>>>;
|
|
38
11
|
//# sourceMappingURL=handler.d.ts.map
|
package/dist/handler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../src/handler.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../src/handler.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EACN,KAAK,WAAW,EAEhB,KAAK,UAAU,EAEf,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEvD,sGAAsG;AACtG,wBAAgB,aAAa,CAC5B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAYzB;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,YAAY,IAEpE,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,WAAW,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,mGAaxE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
export { type CostlessStore, type FieldDecision, type FieldLimit, type FieldRateLimitOptions, type FieldRule, fieldRateLimit, type GraxiaErrorCode, limitFromStore, } from '@graxia/core';
|
|
1
2
|
export { type BoundedStreamOptions, boundedStream } from './bounded-stream';
|
|
2
3
|
export { type ExecutorCall, type ExecutorError, type ExecutorRequest, type ExecutorResult, type GraphQLExecutor, type GraphQLExecutorOptions, graphqlExecutor, } from './executor';
|
|
3
|
-
export { type
|
|
4
|
-
export { type GraphQLContext, type GraphQLOptions, type GraphQLWsContext, graphql, type ServerContext, } from './graphql';
|
|
4
|
+
export { type GraphQLContext, type GraphQLContextInit, type GraphQLOptions, type GraphQLWsContext, graphql, type ServerContext, } from './graphql';
|
|
5
5
|
export { clearRequestCache, freshPerMutation, oncePerRequest, } from './once-per-request';
|
|
6
|
-
export
|
|
7
|
-
export { renderSandbox, SANDBOX_POLICY, type SandboxOptions } from './sandbox';
|
|
6
|
+
export type { SandboxOptions } from './sandbox';
|
|
8
7
|
export type { GraphQLWsOptions } from './ws';
|
|
9
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,cAAc,EACd,KAAK,eAAe,EACpB,cAAc,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,oBAAoB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,eAAe,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,OAAO,EACP,KAAK,aAAa,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,GACd,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,YAAY,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAC"}
|