@webiny/handler-graphql 5.41.1 → 5.41.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/handler-graphql",
|
|
3
|
-
"version": "5.41.
|
|
3
|
+
"version": "5.41.2-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"@graphql-tools/resolvers-composition": "7.0.2",
|
|
20
20
|
"@graphql-tools/schema": "10.0.7",
|
|
21
21
|
"@graphql-tools/utils": "10.5.5",
|
|
22
|
-
"@webiny/api": "5.41.
|
|
23
|
-
"@webiny/error": "5.41.
|
|
24
|
-
"@webiny/handler": "5.41.
|
|
25
|
-
"@webiny/plugins": "5.41.
|
|
22
|
+
"@webiny/api": "5.41.2-beta.0",
|
|
23
|
+
"@webiny/error": "5.41.2-beta.0",
|
|
24
|
+
"@webiny/handler": "5.41.2-beta.0",
|
|
25
|
+
"@webiny/plugins": "5.41.2-beta.0",
|
|
26
26
|
"boolean": "3.2.0",
|
|
27
27
|
"graphql": "15.8.0",
|
|
28
28
|
"graphql-scalars": "1.12.0",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"@babel/cli": "7.24.1",
|
|
33
33
|
"@babel/core": "7.24.3",
|
|
34
34
|
"@babel/preset-env": "7.24.3",
|
|
35
|
-
"@webiny/cli": "5.41.
|
|
36
|
-
"@webiny/handler-aws": "5.41.
|
|
37
|
-
"@webiny/project-utils": "5.41.
|
|
35
|
+
"@webiny/cli": "5.41.2-beta.0",
|
|
36
|
+
"@webiny/handler-aws": "5.41.2-beta.0",
|
|
37
|
+
"@webiny/project-utils": "5.41.2-beta.0",
|
|
38
38
|
"jest": "29.7.0",
|
|
39
39
|
"jest-mock-console": "1.3.0",
|
|
40
40
|
"rimraf": "5.0.5",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"build": "yarn webiny run build",
|
|
50
50
|
"watch": "yarn webiny run watch"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "a259e2af938ceb1e2d35b2bef9edcee4459352de"
|
|
53
53
|
}
|
|
@@ -3,16 +3,19 @@ import { Plugin } from "@webiny/plugins";
|
|
|
3
3
|
import { GraphQLSchemaDefinition, ResolverDecorators, Resolvers, TypeDefs } from "../types";
|
|
4
4
|
export interface IGraphQLSchemaPlugin<TContext = Context> extends Plugin {
|
|
5
5
|
schema: GraphQLSchemaDefinition<TContext>;
|
|
6
|
+
isApplicable: (context: TContext) => boolean;
|
|
6
7
|
}
|
|
7
8
|
export interface GraphQLSchemaPluginConfig<TContext> {
|
|
8
9
|
typeDefs?: TypeDefs;
|
|
9
10
|
resolvers?: Resolvers<TContext>;
|
|
10
11
|
resolverDecorators?: ResolverDecorators;
|
|
12
|
+
isApplicable?: (context: TContext) => boolean;
|
|
11
13
|
}
|
|
12
14
|
export declare class GraphQLSchemaPlugin<TContext = Context> extends Plugin implements IGraphQLSchemaPlugin<TContext> {
|
|
13
15
|
static readonly type: string;
|
|
14
16
|
protected config: GraphQLSchemaPluginConfig<TContext>;
|
|
15
17
|
constructor(config: GraphQLSchemaPluginConfig<TContext>);
|
|
16
18
|
get schema(): GraphQLSchemaDefinition<TContext>;
|
|
19
|
+
isApplicable(context: TContext): boolean;
|
|
17
20
|
}
|
|
18
21
|
export declare const createGraphQLSchemaPlugin: <T = Context>(config: GraphQLSchemaPluginConfig<T>) => GraphQLSchemaPlugin<T>;
|
|
@@ -18,6 +18,12 @@ class GraphQLSchemaPlugin extends _plugins.Plugin {
|
|
|
18
18
|
resolverDecorators: this.config.resolverDecorators
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
+
isApplicable(context) {
|
|
22
|
+
if (this.config.isApplicable) {
|
|
23
|
+
return this.config.isApplicable(context);
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
21
27
|
}
|
|
22
28
|
exports.GraphQLSchemaPlugin = GraphQLSchemaPlugin;
|
|
23
29
|
const createGraphQLSchemaPlugin = config => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_plugins","require","GraphQLSchemaPlugin","Plugin","type","constructor","config","schema","typeDefs","resolvers","resolverDecorators","exports","createGraphQLSchemaPlugin"],"sources":["GraphQLSchemaPlugin.ts"],"sourcesContent":["import { Context } from \"@webiny/api/types\";\nimport { Plugin } from \"@webiny/plugins\";\nimport { GraphQLSchemaDefinition, ResolverDecorators, Resolvers, TypeDefs } from \"~/types\";\n\nexport interface IGraphQLSchemaPlugin<TContext = Context> extends Plugin {\n schema: GraphQLSchemaDefinition<TContext>;\n}\n\nexport interface GraphQLSchemaPluginConfig<TContext> {\n typeDefs?: TypeDefs;\n resolvers?: Resolvers<TContext>;\n resolverDecorators?: ResolverDecorators;\n}\n\nexport class GraphQLSchemaPlugin<TContext = Context>\n extends Plugin\n implements IGraphQLSchemaPlugin<TContext>\n{\n public static override readonly type: string = \"graphql-schema\";\n protected config: GraphQLSchemaPluginConfig<TContext>;\n\n constructor(config: GraphQLSchemaPluginConfig<TContext>) {\n super();\n this.config = config;\n }\n\n get schema(): GraphQLSchemaDefinition<TContext> {\n return {\n typeDefs: this.config.typeDefs || \"\",\n resolvers: this.config.resolvers,\n resolverDecorators: this.config.resolverDecorators\n };\n }\n}\n\nexport const createGraphQLSchemaPlugin = <T = Context>(config: GraphQLSchemaPluginConfig<T>) => {\n return new GraphQLSchemaPlugin<T>(config);\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;
|
|
1
|
+
{"version":3,"names":["_plugins","require","GraphQLSchemaPlugin","Plugin","type","constructor","config","schema","typeDefs","resolvers","resolverDecorators","isApplicable","context","exports","createGraphQLSchemaPlugin"],"sources":["GraphQLSchemaPlugin.ts"],"sourcesContent":["import { Context } from \"@webiny/api/types\";\nimport { Plugin } from \"@webiny/plugins\";\nimport { GraphQLSchemaDefinition, ResolverDecorators, Resolvers, TypeDefs } from \"~/types\";\n\nexport interface IGraphQLSchemaPlugin<TContext = Context> extends Plugin {\n schema: GraphQLSchemaDefinition<TContext>;\n isApplicable: (context: TContext) => boolean;\n}\n\nexport interface GraphQLSchemaPluginConfig<TContext> {\n typeDefs?: TypeDefs;\n resolvers?: Resolvers<TContext>;\n resolverDecorators?: ResolverDecorators;\n isApplicable?: (context: TContext) => boolean;\n}\n\nexport class GraphQLSchemaPlugin<TContext = Context>\n extends Plugin\n implements IGraphQLSchemaPlugin<TContext>\n{\n public static override readonly type: string = \"graphql-schema\";\n protected config: GraphQLSchemaPluginConfig<TContext>;\n\n constructor(config: GraphQLSchemaPluginConfig<TContext>) {\n super();\n this.config = config;\n }\n\n get schema(): GraphQLSchemaDefinition<TContext> {\n return {\n typeDefs: this.config.typeDefs || \"\",\n resolvers: this.config.resolvers,\n resolverDecorators: this.config.resolverDecorators\n };\n }\n\n isApplicable(context: TContext): boolean {\n if (this.config.isApplicable) {\n return this.config.isApplicable(context);\n }\n return true;\n }\n}\n\nexport const createGraphQLSchemaPlugin = <T = Context>(config: GraphQLSchemaPluginConfig<T>) => {\n return new GraphQLSchemaPlugin<T>(config);\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAeO,MAAMC,mBAAmB,SACpBC,eAAM,CAElB;EACI,OAAgCC,IAAI,GAAW,gBAAgB;EAG/DC,WAAWA,CAACC,MAA2C,EAAE;IACrD,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEA,IAAIC,MAAMA,CAAA,EAAsC;IAC5C,OAAO;MACHC,QAAQ,EAAE,IAAI,CAACF,MAAM,CAACE,QAAQ,IAAI,EAAE;MACpCC,SAAS,EAAE,IAAI,CAACH,MAAM,CAACG,SAAS;MAChCC,kBAAkB,EAAE,IAAI,CAACJ,MAAM,CAACI;IACpC,CAAC;EACL;EAEAC,YAAYA,CAACC,OAAiB,EAAW;IACrC,IAAI,IAAI,CAACN,MAAM,CAACK,YAAY,EAAE;MAC1B,OAAO,IAAI,CAACL,MAAM,CAACK,YAAY,CAACC,OAAO,CAAC;IAC5C;IACA,OAAO,IAAI;EACf;AACJ;AAACC,OAAA,CAAAX,mBAAA,GAAAA,mBAAA;AAEM,MAAMY,yBAAyB,GAAiBR,MAAoC,IAAK;EAC5F,OAAO,IAAIJ,mBAAmB,CAAII,MAAM,CAAC;AAC7C,CAAC;AAACO,OAAA,CAAAC,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|