@webiny/handler-graphql 6.5.1 → 6.5.2-beta.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.
@@ -7,9 +7,21 @@ export interface IGraphQLSchema {
7
7
  }
8
8
  /** Define custom GraphQL schema extensions. */
9
9
  export interface IGraphQLSchemaFactory {
10
+ /**
11
+ * Runs once per cached schema, not once per request. Resolvers added here must get request-scoped
12
+ * services through `addResolver({ dependencies })`, never from `this`.
13
+ */
10
14
  execute(builder: GraphQLSchemaBuilder.Interface): Promise<GraphQLSchemaBuilder.Interface>;
11
15
  }
12
- /** Define custom GraphQL schema extensions. */
16
+ /**
17
+ * Define custom GraphQL schema extensions.
18
+ *
19
+ * The built schema is cached across requests. Constructor dependencies are injected only for the
20
+ * request that builds it, so a resolver must never read them (`this.identityContext` and similar):
21
+ * every later request would run with that request's identity, tenant and use cases. Declare what a
22
+ * resolver needs in `builder.addResolver({ dependencies })`, which resolves it from the current
23
+ * request, and register the factory with `dependencies: []`.
24
+ */
13
25
  export declare const GraphQLSchemaFactory: import("@webiny/di").Abstraction<IGraphQLSchemaFactory>;
14
26
  export declare namespace GraphQLSchemaFactory {
15
27
  type Interface = IGraphQLSchemaFactory;
@@ -1 +1 @@
1
- {"version":3,"file":"graphql/abstractions.public.js","sources":["../../src/graphql/abstractions.public.ts"],"sourcesContent":["/**\n * This file contains abstraction for use by third party developers.\n */\nimport { createAbstraction } from \"@webiny/feature/api\";\nimport type {\n Resolvers as IResolvers,\n TypeDefs as ITypeDefs,\n ResolverDecorators as IResolverDecorators\n} from \"~/types.js\";\nimport type { GraphQLSchemaBuilder } from \"~/features/GraphQLSchemaBuilder/abstractions.js\";\n\nexport interface IGraphQLSchema {\n typeDefs?: ITypeDefs;\n resolvers?: IResolvers<any>;\n resolverDecorators?: IResolverDecorators;\n}\n\n/** Define custom GraphQL schema extensions. */\nexport interface IGraphQLSchemaFactory {\n execute(builder: GraphQLSchemaBuilder.Interface): Promise<GraphQLSchemaBuilder.Interface>;\n}\n\n/** Define custom GraphQL schema extensions. */\nexport const GraphQLSchemaFactory =\n createAbstraction<IGraphQLSchemaFactory>(\"GraphQLSchemaFactory\");\n\nexport namespace GraphQLSchemaFactory {\n export type Interface = IGraphQLSchemaFactory;\n export type SchemaBuilder = GraphQLSchemaBuilder.Interface;\n export type Return = Promise<GraphQLSchemaBuilder.Interface>;\n}\n"],"names":["GraphQLSchemaFactory","createAbstraction"],"mappings":";AAuBO,MAAMA,uBACTC,kBAAyC"}
1
+ {"version":3,"file":"graphql/abstractions.public.js","sources":["../../src/graphql/abstractions.public.ts"],"sourcesContent":["/**\n * This file contains abstraction for use by third party developers.\n */\nimport { createAbstraction } from \"@webiny/feature/api\";\nimport type {\n Resolvers as IResolvers,\n TypeDefs as ITypeDefs,\n ResolverDecorators as IResolverDecorators\n} from \"~/types.js\";\nimport type { GraphQLSchemaBuilder } from \"~/features/GraphQLSchemaBuilder/abstractions.js\";\n\nexport interface IGraphQLSchema {\n typeDefs?: ITypeDefs;\n resolvers?: IResolvers<any>;\n resolverDecorators?: IResolverDecorators;\n}\n\n/** Define custom GraphQL schema extensions. */\nexport interface IGraphQLSchemaFactory {\n /**\n * Runs once per cached schema, not once per request. Resolvers added here must get request-scoped\n * services through `addResolver({ dependencies })`, never from `this`.\n */\n execute(builder: GraphQLSchemaBuilder.Interface): Promise<GraphQLSchemaBuilder.Interface>;\n}\n\n/**\n * Define custom GraphQL schema extensions.\n *\n * The built schema is cached across requests. Constructor dependencies are injected only for the\n * request that builds it, so a resolver must never read them (`this.identityContext` and similar):\n * every later request would run with that request's identity, tenant and use cases. Declare what a\n * resolver needs in `builder.addResolver({ dependencies })`, which resolves it from the current\n * request, and register the factory with `dependencies: []`.\n */\nexport const GraphQLSchemaFactory =\n createAbstraction<IGraphQLSchemaFactory>(\"GraphQLSchemaFactory\");\n\nexport namespace GraphQLSchemaFactory {\n export type Interface = IGraphQLSchemaFactory;\n export type SchemaBuilder = GraphQLSchemaBuilder.Interface;\n export type Return = Promise<GraphQLSchemaBuilder.Interface>;\n}\n"],"names":["GraphQLSchemaFactory","createAbstraction"],"mappings":";AAmCO,MAAMA,uBACTC,kBAAyC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/handler-graphql",
3
- "version": "6.5.1",
3
+ "version": "6.5.2-beta.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -18,26 +18,26 @@
18
18
  "Adrian Smijulj <adrian@webiny.com>"
19
19
  ],
20
20
  "dependencies": {
21
- "@graphql-tools/merge": "10.0.6",
22
- "@graphql-tools/resolvers-composition": "8.0.6",
23
- "@graphql-tools/schema": "11.0.6",
24
- "@graphql-tools/utils": "13.1.3",
25
- "@webiny/api": "6.5.1",
21
+ "@graphql-tools/merge": "10.0.7",
22
+ "@graphql-tools/resolvers-composition": "8.0.7",
23
+ "@graphql-tools/schema": "11.0.7",
24
+ "@graphql-tools/utils": "13.2.0",
25
+ "@webiny/api": "6.5.2-beta.0",
26
26
  "@webiny/di": "1.1.0",
27
- "@webiny/error": "6.5.1",
28
- "@webiny/feature": "6.5.1",
29
- "@webiny/handler": "6.5.1",
30
- "@webiny/plugins": "6.5.1",
27
+ "@webiny/error": "6.5.2-beta.0",
28
+ "@webiny/feature": "6.5.2-beta.0",
29
+ "@webiny/handler": "6.5.2-beta.0",
30
+ "@webiny/plugins": "6.5.2-beta.0",
31
31
  "@webiny/stdlib": "0.0.20",
32
- "@webiny/utils": "6.5.1",
32
+ "@webiny/utils": "6.5.2-beta.0",
33
33
  "graphql": "16.14.2",
34
34
  "graphql-scalars": "2.0.1",
35
35
  "graphql-tag": "2.12.7",
36
36
  "zod": "4.6.7"
37
37
  },
38
38
  "devDependencies": {
39
- "@webiny/build-tools": "6.5.1",
40
- "@webiny/handler-aws": "6.5.1",
39
+ "@webiny/build-tools": "6.5.2-beta.0",
40
+ "@webiny/handler-aws": "6.5.2-beta.0",
41
41
  "rimraf": "6.1.3",
42
42
  "typescript": "7.0.2",
43
43
  "vitest": "5.0.5"