@webiny/handler-graphql 5.33.5 → 5.34.0-beta.1
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/builtInTypes/DateScalar.js +3 -7
- package/builtInTypes/DateScalar.js.map +1 -1
- package/builtInTypes/DateTimeScalar.js +3 -7
- package/builtInTypes/DateTimeScalar.js.map +1 -1
- package/builtInTypes/DateTimeZScalar.js +1 -1
- package/builtInTypes/NumberScalar.js +1 -1
- package/builtInTypes/RefInputScalar.d.ts +1 -1
- package/builtInTypes/RefInputScalar.js +3 -3
- package/builtInTypes/RefInputScalar.js.map +1 -1
- package/builtInTypes/TimeScalar.js +1 -1
- package/createGraphQLHandler.d.ts +1 -1
- package/createGraphQLHandler.js +30 -8
- package/createGraphQLHandler.js.map +1 -1
- package/createGraphQLSchema.js +6 -12
- package/createGraphQLSchema.js.map +1 -1
- package/errors.js +1 -1
- package/index.d.ts +1 -11
- package/index.js +17 -14
- package/index.js.map +1 -1
- package/package.json +14 -13
- package/plugins/GraphQLSchemaPlugin.js +1 -1
- package/processRequestBody.js.map +1 -1
- package/responses.js +1 -1
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.DateScalar = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
11
|
|
|
12
12
|
var _graphqlScalars = require("graphql-scalars");
|
|
13
13
|
|
|
14
14
|
var _graphql = require("graphql");
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
|
-
|
|
20
|
-
const DateScalar = new _graphql.GraphQLScalarType(_objectSpread(_objectSpread({}, _graphqlScalars.DateResolver), {}, {
|
|
16
|
+
const DateScalar = new _graphql.GraphQLScalarType((0, _objectSpread2.default)((0, _objectSpread2.default)({}, _graphqlScalars.DateResolver), {}, {
|
|
21
17
|
serialize: value => {
|
|
22
18
|
if (!value) {
|
|
23
19
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DateScalar","GraphQLScalarType","DateResolver","serialize","value","date","Date","toISOString","slice","ex"],"sources":["DateScalar.ts"],"sourcesContent":["import { DateResolver } from \"graphql-scalars\";\nimport { GraphQLScalarType } from \"graphql\";\nexport const DateScalar = new GraphQLScalarType({\n ...DateResolver,\n serialize: value => {\n if (!value) {\n return null;\n }\n try {\n const date = new Date(value);\n return date.toISOString().slice(0, 10);\n } catch (ex) {\n if (value.toISOString) {\n return value.toISOString().slice(0, 10);\n }\n throw ex;\n }\n }\n});\n"],"mappings":";;;;;;;;;;;AAAA;;AACA
|
|
1
|
+
{"version":3,"names":["DateScalar","GraphQLScalarType","DateResolver","serialize","value","date","Date","toISOString","slice","ex"],"sources":["DateScalar.ts"],"sourcesContent":["import { DateResolver } from \"graphql-scalars\";\nimport { GraphQLScalarType } from \"graphql\";\nexport const DateScalar = new GraphQLScalarType({\n ...DateResolver,\n serialize: value => {\n if (!value) {\n return null;\n }\n try {\n const date = new Date(value);\n return date.toISOString().slice(0, 10);\n } catch (ex) {\n if (value.toISOString) {\n return value.toISOString().slice(0, 10);\n }\n throw ex;\n }\n }\n});\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACO,MAAMA,UAAU,GAAG,IAAIC,0BAAJ,6DACnBC,4BADmB;EAEtBC,SAAS,EAAEC,KAAK,IAAI;IAChB,IAAI,CAACA,KAAL,EAAY;MACR,OAAO,IAAP;IACH;;IACD,IAAI;MACA,MAAMC,IAAI,GAAG,IAAIC,IAAJ,CAASF,KAAT,CAAb;MACA,OAAOC,IAAI,CAACE,WAAL,GAAmBC,KAAnB,CAAyB,CAAzB,EAA4B,EAA5B,CAAP;IACH,CAHD,CAGE,OAAOC,EAAP,EAAW;MACT,IAAIL,KAAK,CAACG,WAAV,EAAuB;QACnB,OAAOH,KAAK,CAACG,WAAN,GAAoBC,KAApB,CAA0B,CAA1B,EAA6B,EAA7B,CAAP;MACH;;MACD,MAAMC,EAAN;IACH;EACJ;AAfqB,GAAnB"}
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.DateTimeScalar = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
11
|
|
|
12
12
|
var _graphqlScalars = require("graphql-scalars");
|
|
13
13
|
|
|
14
14
|
var _graphql = require("graphql");
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
|
-
|
|
20
|
-
const DateTimeScalar = new _graphql.GraphQLScalarType(_objectSpread(_objectSpread({}, _graphqlScalars.DateTimeResolver), {}, {
|
|
16
|
+
const DateTimeScalar = new _graphql.GraphQLScalarType((0, _objectSpread2.default)((0, _objectSpread2.default)({}, _graphqlScalars.DateTimeResolver), {}, {
|
|
21
17
|
serialize: value => {
|
|
22
18
|
if (!value) {
|
|
23
19
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DateTimeScalar","GraphQLScalarType","DateTimeResolver","serialize","value","date","Date","toISOString","ex"],"sources":["DateTimeScalar.ts"],"sourcesContent":["import { DateTimeResolver } from \"graphql-scalars\";\nimport { GraphQLScalarType } from \"graphql\";\nexport const DateTimeScalar = new GraphQLScalarType({\n ...DateTimeResolver,\n serialize: value => {\n if (!value) {\n return null;\n }\n try {\n const date = new Date(value);\n return date.toISOString();\n } catch (ex) {\n if (value.toISOString) {\n return value.toISOString();\n }\n throw ex;\n }\n }\n});\n"],"mappings":";;;;;;;;;;;AAAA;;AACA
|
|
1
|
+
{"version":3,"names":["DateTimeScalar","GraphQLScalarType","DateTimeResolver","serialize","value","date","Date","toISOString","ex"],"sources":["DateTimeScalar.ts"],"sourcesContent":["import { DateTimeResolver } from \"graphql-scalars\";\nimport { GraphQLScalarType } from \"graphql\";\nexport const DateTimeScalar = new GraphQLScalarType({\n ...DateTimeResolver,\n serialize: value => {\n if (!value) {\n return null;\n }\n try {\n const date = new Date(value);\n return date.toISOString();\n } catch (ex) {\n if (value.toISOString) {\n return value.toISOString();\n }\n throw ex;\n }\n }\n});\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACO,MAAMA,cAAc,GAAG,IAAIC,0BAAJ,6DACvBC,gCADuB;EAE1BC,SAAS,EAAEC,KAAK,IAAI;IAChB,IAAI,CAACA,KAAL,EAAY;MACR,OAAO,IAAP;IACH;;IACD,IAAI;MACA,MAAMC,IAAI,GAAG,IAAIC,IAAJ,CAASF,KAAT,CAAb;MACA,OAAOC,IAAI,CAACE,WAAL,EAAP;IACH,CAHD,CAGE,OAAOC,EAAP,EAAW;MACT,IAAIJ,KAAK,CAACG,WAAV,EAAuB;QACnB,OAAOH,KAAK,CAACG,WAAN,EAAP;MACH;;MACD,MAAMC,EAAN;IACH;EACJ;AAfyB,GAAvB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { GraphQLScalarType } from "graphql";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const RefInputScalar: GraphQLScalarType;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.RefInputScalar = void 0;
|
|
7
7
|
|
|
8
8
|
var _graphql = require("graphql");
|
|
9
9
|
|
|
@@ -15,7 +15,7 @@ const isMongoId = value => {
|
|
|
15
15
|
throw new Error("Must be a valid Mongo ID!");
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const RefInputScalar = new _graphql.GraphQLScalarType({
|
|
19
19
|
name: "RefInput",
|
|
20
20
|
description: "A custom input type to be used with references. Supports plain ID and `{ id: ID }` Object literal.",
|
|
21
21
|
serialize: value => {
|
|
@@ -62,4 +62,4 @@ const RefInput = new _graphql.GraphQLScalarType({
|
|
|
62
62
|
throw new Error("Invalid RefInput value!");
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
|
-
exports.
|
|
65
|
+
exports.RefInputScalar = RefInputScalar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isMongoId","value","test","Error","
|
|
1
|
+
{"version":3,"names":["isMongoId","value","test","Error","RefInputScalar","GraphQLScalarType","name","description","serialize","id","parseValue","parseLiteral","ast","kind","i","fields","length"],"sources":["RefInputScalar.ts"],"sourcesContent":["import { GraphQLScalarType } from \"graphql\";\n\nconst isMongoId = (value: any): string => {\n if (/^[0-9a-fA-F]{24}$/.test(value)) {\n return value;\n }\n\n throw new Error(\"Must be a valid Mongo ID!\");\n};\n\nexport const RefInputScalar = new GraphQLScalarType({\n name: \"RefInput\",\n description:\n \"A custom input type to be used with references. Supports plain ID and `{ id: ID }` Object literal.\",\n serialize: value => {\n if (!value || value.id === null) {\n return null;\n }\n\n return typeof value === \"string\" ? value : value.id;\n },\n parseValue: value => {\n if (!value || value.id === null) {\n return null;\n }\n\n if (typeof value === \"string\") {\n return isMongoId(value);\n }\n\n if (\"id\" in value) {\n return isMongoId(value.id);\n }\n\n throw new Error(\"Invalid RefInput value!\");\n },\n parseLiteral: ast => {\n if (ast.kind === \"StringValue\") {\n return isMongoId(ast.value);\n }\n\n if (ast.kind === \"ObjectValue\") {\n for (let i = 0; i < ast.fields.length; i++) {\n const { name, value } = ast.fields[i];\n if (name.value === \"id\") {\n // @ts-ignore\n return isMongoId(value.value);\n }\n }\n }\n\n throw new Error(\"Invalid RefInput value!\");\n }\n});\n"],"mappings":";;;;;;;AAAA;;AAEA,MAAMA,SAAS,GAAIC,KAAD,IAAwB;EACtC,IAAI,oBAAoBC,IAApB,CAAyBD,KAAzB,CAAJ,EAAqC;IACjC,OAAOA,KAAP;EACH;;EAED,MAAM,IAAIE,KAAJ,CAAU,2BAAV,CAAN;AACH,CAND;;AAQO,MAAMC,cAAc,GAAG,IAAIC,0BAAJ,CAAsB;EAChDC,IAAI,EAAE,UAD0C;EAEhDC,WAAW,EACP,oGAH4C;EAIhDC,SAAS,EAAEP,KAAK,IAAI;IAChB,IAAI,CAACA,KAAD,IAAUA,KAAK,CAACQ,EAAN,KAAa,IAA3B,EAAiC;MAC7B,OAAO,IAAP;IACH;;IAED,OAAO,OAAOR,KAAP,KAAiB,QAAjB,GAA4BA,KAA5B,GAAoCA,KAAK,CAACQ,EAAjD;EACH,CAV+C;EAWhDC,UAAU,EAAET,KAAK,IAAI;IACjB,IAAI,CAACA,KAAD,IAAUA,KAAK,CAACQ,EAAN,KAAa,IAA3B,EAAiC;MAC7B,OAAO,IAAP;IACH;;IAED,IAAI,OAAOR,KAAP,KAAiB,QAArB,EAA+B;MAC3B,OAAOD,SAAS,CAACC,KAAD,CAAhB;IACH;;IAED,IAAI,QAAQA,KAAZ,EAAmB;MACf,OAAOD,SAAS,CAACC,KAAK,CAACQ,EAAP,CAAhB;IACH;;IAED,MAAM,IAAIN,KAAJ,CAAU,yBAAV,CAAN;EACH,CAzB+C;EA0BhDQ,YAAY,EAAEC,GAAG,IAAI;IACjB,IAAIA,GAAG,CAACC,IAAJ,KAAa,aAAjB,EAAgC;MAC5B,OAAOb,SAAS,CAACY,GAAG,CAACX,KAAL,CAAhB;IACH;;IAED,IAAIW,GAAG,CAACC,IAAJ,KAAa,aAAjB,EAAgC;MAC5B,KAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGF,GAAG,CAACG,MAAJ,CAAWC,MAA/B,EAAuCF,CAAC,EAAxC,EAA4C;QACxC,MAAM;UAAER,IAAF;UAAQL;QAAR,IAAkBW,GAAG,CAACG,MAAJ,CAAWD,CAAX,CAAxB;;QACA,IAAIR,IAAI,CAACL,KAAL,KAAe,IAAnB,EAAyB;UACrB;UACA,OAAOD,SAAS,CAACC,KAAK,CAACA,KAAP,CAAhB;QACH;MACJ;IACJ;;IAED,MAAM,IAAIE,KAAJ,CAAU,yBAAV,CAAN;EACH;AA1C+C,CAAtB,CAAvB"}
|
package/createGraphQLHandler.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -9,24 +9,42 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _boolean = require("boolean");
|
|
11
11
|
|
|
12
|
+
var _handler = require("@webiny/handler");
|
|
13
|
+
|
|
14
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
15
|
+
|
|
12
16
|
var _createGraphQLSchema = require("./createGraphQLSchema");
|
|
13
17
|
|
|
14
18
|
var _debugPlugins = _interopRequireDefault(require("./debugPlugins"));
|
|
15
19
|
|
|
16
20
|
var _processRequestBody = _interopRequireDefault(require("./processRequestBody"));
|
|
17
21
|
|
|
18
|
-
var _handler = require("@webiny/handler");
|
|
19
|
-
|
|
20
22
|
const DEFAULT_CACHE_MAX_AGE = 30758400; // 1 year
|
|
21
23
|
|
|
22
|
-
/**
|
|
23
|
-
* TODO Until we figure out how to better convert incoming body, we will leave it as any.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
24
|
const createRequestBody = body => {
|
|
25
|
+
/**
|
|
26
|
+
* We are trusting that the body payload is correct.
|
|
27
|
+
* The `processRequestBody` will fail if it is not.
|
|
28
|
+
*/
|
|
27
29
|
return typeof body === "string" ? JSON.parse(body) : body;
|
|
28
30
|
};
|
|
29
31
|
|
|
32
|
+
const formatErrorPayload = error => {
|
|
33
|
+
if (error instanceof _error.default) {
|
|
34
|
+
return {
|
|
35
|
+
message: error.message,
|
|
36
|
+
code: error.code,
|
|
37
|
+
data: error.data
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
name: error.name,
|
|
43
|
+
message: error.message,
|
|
44
|
+
stack: error.stack
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
30
48
|
var _default = (options = {}) => {
|
|
31
49
|
let schema = undefined;
|
|
32
50
|
const debug = (0, _boolean.boolean)(options.debug);
|
|
@@ -43,7 +61,11 @@ var _default = (options = {}) => {
|
|
|
43
61
|
});
|
|
44
62
|
onPost(path, async (request, reply) => {
|
|
45
63
|
if (!schema) {
|
|
46
|
-
|
|
64
|
+
try {
|
|
65
|
+
schema = (0, _createGraphQLSchema.createGraphQLSchema)(context);
|
|
66
|
+
} catch (ex) {
|
|
67
|
+
return reply.code(500).send(formatErrorPayload(ex));
|
|
68
|
+
}
|
|
47
69
|
}
|
|
48
70
|
|
|
49
71
|
const body = createRequestBody(request.body);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DEFAULT_CACHE_MAX_AGE","createRequestBody","body","JSON","parse","options","schema","undefined","debug","boolean","path","route","RoutePlugin","onPost","onOptions","context","_","reply","status","headers","send","request","createGraphQLSchema","
|
|
1
|
+
{"version":3,"names":["DEFAULT_CACHE_MAX_AGE","createRequestBody","body","JSON","parse","formatErrorPayload","error","WebinyError","message","code","data","name","stack","options","schema","undefined","debug","boolean","path","route","RoutePlugin","onPost","onOptions","context","_","reply","status","headers","send","request","createGraphQLSchema","ex","result","processRequestBody","debugPlugins","type"],"sources":["createGraphQLHandler.ts"],"sourcesContent":["import { boolean } from \"boolean\";\nimport { GraphQLSchema } from \"graphql\";\nimport { RoutePlugin } from \"@webiny/handler\";\nimport WebinyError from \"@webiny/error\";\nimport { PluginCollection } from \"@webiny/plugins/types\";\nimport { GraphQLRequestBody, HandlerGraphQLOptions } from \"./types\";\nimport { createGraphQLSchema } from \"./createGraphQLSchema\";\nimport debugPlugins from \"./debugPlugins\";\nimport processRequestBody from \"./processRequestBody\";\n\nconst DEFAULT_CACHE_MAX_AGE = 30758400; // 1 year\n\nconst createRequestBody = (body: unknown): GraphQLRequestBody | GraphQLRequestBody[] => {\n /**\n * We are trusting that the body payload is correct.\n * The `processRequestBody` will fail if it is not.\n */\n return typeof body === \"string\" ? JSON.parse(body) : body;\n};\n\nconst formatErrorPayload = (error: Error) => {\n if (error instanceof WebinyError) {\n return {\n message: error.message,\n code: error.code,\n data: error.data\n };\n }\n\n return {\n name: error.name,\n message: error.message,\n stack: error.stack\n };\n};\n\nexport default (options: HandlerGraphQLOptions = {}): PluginCollection => {\n let schema: GraphQLSchema | undefined = undefined;\n\n const debug = boolean(options.debug);\n\n const path = options?.path || \"/graphql\";\n\n const route = new RoutePlugin(async ({ onPost, onOptions, context }) => {\n onOptions(path, async (_, reply) => {\n return reply\n .status(204)\n .headers({\n \"Cache-Control\": `public, max-age=${DEFAULT_CACHE_MAX_AGE}`\n })\n .send({});\n });\n onPost(path, async (request, reply) => {\n if (!schema) {\n try {\n schema = createGraphQLSchema(context);\n } catch (ex) {\n return reply.code(500).send(formatErrorPayload(ex));\n }\n }\n const body = createRequestBody(request.body);\n const result = await processRequestBody(body, schema, context);\n return reply.status(200).send(result);\n });\n });\n\n route.name = \"handler.graphql.route.default\";\n\n return [\n ...(debug ? debugPlugins() : []),\n {\n type: \"wcp-telemetry-tracker\"\n },\n route\n ];\n};\n"],"mappings":";;;;;;;;;AAAA;;AAEA;;AACA;;AAGA;;AACA;;AACA;;AAEA,MAAMA,qBAAqB,GAAG,QAA9B,C,CAAwC;;AAExC,MAAMC,iBAAiB,GAAIC,IAAD,IAA8D;EACpF;AACJ;AACA;AACA;EACI,OAAO,OAAOA,IAAP,KAAgB,QAAhB,GAA2BC,IAAI,CAACC,KAAL,CAAWF,IAAX,CAA3B,GAA8CA,IAArD;AACH,CAND;;AAQA,MAAMG,kBAAkB,GAAIC,KAAD,IAAkB;EACzC,IAAIA,KAAK,YAAYC,cAArB,EAAkC;IAC9B,OAAO;MACHC,OAAO,EAAEF,KAAK,CAACE,OADZ;MAEHC,IAAI,EAAEH,KAAK,CAACG,IAFT;MAGHC,IAAI,EAAEJ,KAAK,CAACI;IAHT,CAAP;EAKH;;EAED,OAAO;IACHC,IAAI,EAAEL,KAAK,CAACK,IADT;IAEHH,OAAO,EAAEF,KAAK,CAACE,OAFZ;IAGHI,KAAK,EAAEN,KAAK,CAACM;EAHV,CAAP;AAKH,CAdD;;eAgBe,CAACC,OAA8B,GAAG,EAAlC,KAA2D;EACtE,IAAIC,MAAiC,GAAGC,SAAxC;EAEA,MAAMC,KAAK,GAAG,IA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KHhB,KALG,CAAP;AAOH,C"}
|
package/createGraphQLSchema.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.createGraphQLSchema = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
11
|
|
|
12
12
|
var _graphqlTag = _interopRequireDefault(require("graphql-tag"));
|
|
13
13
|
|
|
@@ -15,10 +15,6 @@ var _schema = require("@graphql-tools/schema");
|
|
|
15
15
|
|
|
16
16
|
var _builtInTypes = require("./builtInTypes");
|
|
17
17
|
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
-
|
|
20
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
-
|
|
22
18
|
const createGraphQLSchema = context => {
|
|
23
19
|
const scalars = context.plugins.byType("graphql-scalar").map(item => item.scalar);
|
|
24
20
|
const typeDefs = [(0, _graphqlTag.default)`
|
|
@@ -34,29 +30,27 @@ const createGraphQLSchema = context => {
|
|
|
34
30
|
scalar DateTime
|
|
35
31
|
scalar Time
|
|
36
32
|
`];
|
|
37
|
-
const resolvers = [
|
|
33
|
+
const resolvers = [(0, _objectSpread2.default)((0, _objectSpread2.default)({}, scalars.reduce((acc, s) => {
|
|
38
34
|
acc[s.name] = s;
|
|
39
35
|
return acc;
|
|
40
36
|
}, {})), {}, {
|
|
41
37
|
JSON: _builtInTypes.JsonScalar,
|
|
42
38
|
Long: _builtInTypes.LongScalar,
|
|
43
|
-
RefInput: _builtInTypes.
|
|
39
|
+
RefInput: _builtInTypes.RefInputScalar,
|
|
44
40
|
Number: _builtInTypes.NumberScalar,
|
|
45
41
|
Any: _builtInTypes.AnyScalar,
|
|
46
42
|
DateTime: _builtInTypes.DateTimeScalar,
|
|
47
43
|
Date: _builtInTypes.DateScalar,
|
|
48
44
|
Time: _builtInTypes.TimeScalar
|
|
49
45
|
})];
|
|
50
|
-
const
|
|
46
|
+
const plugins = context.plugins.byType("graphql-schema");
|
|
51
47
|
|
|
52
|
-
for (
|
|
53
|
-
const plugin = gqlPlugins[i];
|
|
48
|
+
for (const plugin of plugins) {
|
|
54
49
|
/**
|
|
55
50
|
* TODO @ts-refactor
|
|
56
51
|
* Figure out correct types on typeDefs and resolvers
|
|
57
52
|
*/
|
|
58
53
|
// @ts-ignore
|
|
59
|
-
|
|
60
54
|
typeDefs.push(plugin.schema.typeDefs); // @ts-ignore
|
|
61
55
|
|
|
62
56
|
resolvers.push(plugin.schema.resolvers);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createGraphQLSchema","context","scalars","plugins","byType","map","item","scalar","typeDefs","gql","name","join","resolvers","reduce","acc","s","JSON","JsonScalar","Long","LongScalar","RefInput","Number","NumberScalar","Any","AnyScalar","DateTime","DateTimeScalar","Date","DateScalar","Time","TimeScalar","
|
|
1
|
+
{"version":3,"names":["createGraphQLSchema","context","scalars","plugins","byType","map","item","scalar","typeDefs","gql","name","join","resolvers","reduce","acc","s","JSON","JsonScalar","Long","LongScalar","RefInput","RefInputScalar","Number","NumberScalar","Any","AnyScalar","DateTime","DateTimeScalar","Date","DateScalar","Time","TimeScalar","plugin","push","schema","makeExecutableSchema","inheritResolversFromInterfaces"],"sources":["createGraphQLSchema.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { makeExecutableSchema } from \"@graphql-tools/schema\";\nimport { GraphQLScalarPlugin, GraphQLSchemaPlugin } from \"./types\";\nimport { Context } from \"@webiny/api/types\";\nimport {\n RefInputScalar,\n NumberScalar,\n AnyScalar,\n DateScalar,\n DateTimeScalar,\n JsonScalar,\n TimeScalar,\n LongScalar\n} from \"./builtInTypes\";\nimport { GraphQLScalarType } from \"graphql/type/definition\";\n\nexport const createGraphQLSchema = (context: Context) => {\n const scalars = context.plugins\n .byType<GraphQLScalarPlugin>(\"graphql-scalar\")\n .map(item => item.scalar);\n\n const typeDefs = [\n gql`\n type Query\n type Mutation\n ${scalars.map(scalar => `scalar ${scalar.name}`).join(\" \")}\n scalar JSON\n scalar Long\n scalar RefInput\n scalar Number\n scalar Any\n scalar Date\n scalar DateTime\n scalar Time\n `\n ];\n\n const resolvers = [\n {\n ...scalars.reduce<Record<string, GraphQLScalarType>>((acc, s) => {\n acc[s.name] = s;\n return acc;\n }, {}),\n JSON: JsonScalar,\n Long: LongScalar,\n RefInput: RefInputScalar,\n Number: NumberScalar,\n Any: AnyScalar,\n DateTime: DateTimeScalar,\n Date: DateScalar,\n Time: TimeScalar\n }\n ];\n\n const plugins = context.plugins.byType<GraphQLSchemaPlugin>(\"graphql-schema\");\n for (const plugin of plugins) {\n /**\n * TODO @ts-refactor\n * Figure out correct types on typeDefs and resolvers\n */\n // @ts-ignore\n typeDefs.push(plugin.schema.typeDefs);\n // @ts-ignore\n resolvers.push(plugin.schema.resolvers);\n }\n\n return makeExecutableSchema({\n typeDefs,\n resolvers,\n inheritResolversFromInterfaces: true\n });\n};\n"],"mappings":";;;;;;;;;;;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BwB,8BAA8B,EAAE;EAHR,CAArB,CAAP;AAKH,CAvDM"}
|
package/errors.js
CHANGED
package/index.d.ts
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { HandlerGraphQLOptions } from "./types";
|
|
2
|
-
import { Context } from "@webiny/api/types";
|
|
3
|
-
import { GraphQLFieldResolver } from "./types";
|
|
4
|
-
/**
|
|
5
|
-
* Can be anything.
|
|
6
|
-
* TODO: Figure out if required at all.
|
|
7
|
-
*/
|
|
8
|
-
interface Callable {
|
|
9
|
-
(params: any): any;
|
|
10
|
-
}
|
|
11
2
|
export * from "./errors";
|
|
12
3
|
export * from "./responses";
|
|
4
|
+
export * from "./plugins";
|
|
13
5
|
declare const _default: (options?: HandlerGraphQLOptions) => import("@webiny/plugins/types").PluginCollection[];
|
|
14
6
|
export default _default;
|
|
15
|
-
export declare const pipe: <TSource = any, TArgs = Record<string, any>, TContext = Context>(...fns: Callable[]) => (resolver: GraphQLFieldResolver<TSource, TArgs, TContext>) => GraphQLFieldResolver<TSource, TArgs, TContext>;
|
|
16
|
-
export declare const compose: <TSource = any, TArgs = Record<string, any>, TContext = Context>(...fns: Callable[]) => (resolver: GraphQLFieldResolver<TSource, TArgs, TContext>) => GraphQLFieldResolver<TSource, TArgs, TContext>;
|
package/index.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
var _exportNames = {
|
|
9
|
-
|
|
10
|
-
compose: true
|
|
11
|
-
};
|
|
12
|
-
exports.pipe = exports.default = exports.compose = void 0;
|
|
8
|
+
var _exportNames = {};
|
|
9
|
+
exports.default = void 0;
|
|
13
10
|
|
|
14
11
|
var _createGraphQLHandler = _interopRequireDefault(require("./createGraphQLHandler"));
|
|
15
12
|
|
|
@@ -41,14 +38,20 @@ Object.keys(_responses).forEach(function (key) {
|
|
|
41
38
|
});
|
|
42
39
|
});
|
|
43
40
|
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
exports.default = _default;
|
|
47
|
-
|
|
48
|
-
const pipe = (...fns) => resolver => fns.reduce((v, f) => f(v), resolver);
|
|
41
|
+
var _plugins = require("./plugins");
|
|
49
42
|
|
|
50
|
-
|
|
43
|
+
Object.keys(_plugins).forEach(function (key) {
|
|
44
|
+
if (key === "default" || key === "__esModule") return;
|
|
45
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
46
|
+
if (key in exports && exports[key] === _plugins[key]) return;
|
|
47
|
+
Object.defineProperty(exports, key, {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function () {
|
|
50
|
+
return _plugins[key];
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
});
|
|
51
54
|
|
|
52
|
-
|
|
55
|
+
var _default = (options = {}) => [(0, _createGraphQLHandler.default)(options)];
|
|
53
56
|
|
|
54
|
-
exports.
|
|
57
|
+
exports.default = _default;
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["options","createGraphQLHandler"
|
|
1
|
+
{"version":3,"names":["options","createGraphQLHandler"],"sources":["index.ts"],"sourcesContent":["import { HandlerGraphQLOptions } from \"./types\";\nimport createGraphQLHandler from \"./createGraphQLHandler\";\n\nexport * from \"./errors\";\nexport * from \"./responses\";\nexport * from \"./plugins\";\n\nexport default (options: HandlerGraphQLOptions = {}) => [createGraphQLHandler(options)];\n"],"mappings":";;;;;;;;;;AACA;;AAEA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;eAEe,CAACA,OAA8B,GAAG,EAAlC,KAAyC,CAAC,IAAAC,6BAAA,EAAqBD,OAArB,CAAD,C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/handler-graphql",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.34.0-beta.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -14,27 +14,28 @@
|
|
|
14
14
|
"Adrian Smijulj <adrian@webiny.com>"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@babel/runtime": "7.
|
|
17
|
+
"@babel/runtime": "7.19.0",
|
|
18
18
|
"@graphql-tools/schema": "7.1.5",
|
|
19
|
-
"@webiny/api": "5.
|
|
20
|
-
"@webiny/error": "5.
|
|
21
|
-
"@webiny/handler": "5.
|
|
22
|
-
"@webiny/plugins": "5.
|
|
19
|
+
"@webiny/api": "5.34.0-beta.1",
|
|
20
|
+
"@webiny/error": "5.34.0-beta.1",
|
|
21
|
+
"@webiny/handler": "5.34.0-beta.1",
|
|
22
|
+
"@webiny/plugins": "5.34.0-beta.1",
|
|
23
23
|
"boolean": "3.2.0",
|
|
24
24
|
"graphql": "15.8.0",
|
|
25
25
|
"graphql-scalars": "1.12.0",
|
|
26
26
|
"graphql-tag": "2.12.6"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@babel/cli": "^7.
|
|
30
|
-
"@babel/core": "^7.
|
|
31
|
-
"@babel/preset-env": "^7.
|
|
32
|
-
"@webiny/cli": "^5.
|
|
33
|
-
"@webiny/handler-aws": "^5.
|
|
34
|
-
"@webiny/project-utils": "^5.
|
|
29
|
+
"@babel/cli": "^7.19.3",
|
|
30
|
+
"@babel/core": "^7.19.3",
|
|
31
|
+
"@babel/preset-env": "^7.19.4",
|
|
32
|
+
"@webiny/cli": "^5.34.0-beta.1",
|
|
33
|
+
"@webiny/handler-aws": "^5.34.0-beta.1",
|
|
34
|
+
"@webiny/project-utils": "^5.34.0-beta.1",
|
|
35
35
|
"jest": "^28.1.0",
|
|
36
36
|
"jest-mock-console": "^1.0.0",
|
|
37
37
|
"rimraf": "^3.0.2",
|
|
38
|
+
"ttypescript": "^1.5.15",
|
|
38
39
|
"typescript": "4.7.4"
|
|
39
40
|
},
|
|
40
41
|
"publishConfig": {
|
|
@@ -45,5 +46,5 @@
|
|
|
45
46
|
"build": "yarn webiny run build",
|
|
46
47
|
"watch": "yarn webiny run watch"
|
|
47
48
|
},
|
|
48
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "1ee2a7338a865a67e24eb42d16bf0b6091195286"
|
|
49
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["processRequestBody","body","schema","context","query","variables","operationName","plugins","byType","forEach","pl","apply","result","graphql","requestBody","Array","isArray","i","length","push"],"sources":["processRequestBody.ts"],"sourcesContent":["import { ExecutionResult, graphql, GraphQLSchema } from \"graphql\";\nimport { GraphQLAfterQueryPlugin, GraphQLBeforeQueryPlugin, GraphQLRequestBody } from \"
|
|
1
|
+
{"version":3,"names":["processRequestBody","body","schema","context","query","variables","operationName","plugins","byType","forEach","pl","apply","result","graphql","requestBody","Array","isArray","i","length","push"],"sources":["processRequestBody.ts"],"sourcesContent":["import { ExecutionResult, graphql, GraphQLSchema } from \"graphql\";\nimport { GraphQLAfterQueryPlugin, GraphQLBeforeQueryPlugin, GraphQLRequestBody } from \"~/types\";\nimport { Context } from \"@webiny/api/types\";\n\nconst processRequestBody = async (\n body: GraphQLRequestBody,\n schema: GraphQLSchema,\n context: Context\n) => {\n const { query, variables, operationName } = body;\n\n context.plugins\n .byType<GraphQLBeforeQueryPlugin>(\"graphql-before-query\")\n .forEach(pl => pl.apply({ body, schema, context }));\n\n const result = await graphql(schema, query, {}, context, variables, operationName);\n\n context.plugins.byType<GraphQLAfterQueryPlugin>(\"graphql-after-query\").forEach(pl => {\n pl.apply({ result, body, schema, context });\n });\n\n return result;\n};\n\nexport default async (\n requestBody: GraphQLRequestBody | GraphQLRequestBody[],\n schema: GraphQLSchema,\n context: Context\n): Promise<ExecutionResult[] | ExecutionResult> => {\n if (Array.isArray(requestBody) === true) {\n const result: ExecutionResult[] = [];\n for (let i = 0; i < (requestBody as GraphQLRequestBody[]).length; i++) {\n result.push(\n await processRequestBody((requestBody as GraphQLRequestBody[])[i], schema, context)\n );\n }\n return result;\n }\n return await processRequestBody(requestBody as GraphQLRequestBody, schema, context);\n};\n"],"mappings":";;;;;;;AAAA;;AAIA,MAAMA,kBAAkB,GAAG,OACvBC,IADuB,EAEvBC,MAFuB,EAGvBC,OAHuB,KAItB;EACD,MAAM;IAAEC,KAAF;IAASC,SAAT;IAAoBC;EAApB,IAAsCL,IAA5C;EAEAE,OAAO,CAACI,OAAR,CACKC,MADL,CACsC,sBADtC,EAEKC,OAFL,CAEaC,EAAE,IAAIA,EAAE,CAACC,KAAH,CAAS;IAAEV,IAAF;IAAQC,MAAR;IAAgBC;EAAhB,CAAT,CAFnB;EAIA,MAAMS,MAAM,GAAG,MAAM,IAAAC,gBAAA,EAAQX,MAAR,EAAgBE,KAAhB,EAAuB,EAAvB,EAA2BD,OAA3B,EAAoCE,SAApC,EAA+CC,aAA/C,CAArB;EAEAH,OAAO,CAACI,OAAR,CAAgBC,MAAhB,CAAgD,qBAAhD,EAAuEC,OAAvE,CAA+EC,EAAE,IAAI;IACjFA,EAAE,CAACC,KAAH,CAAS;MAAEC,MAAF;MAAUX,IAAV;MAAgBC,MAAhB;MAAwBC;IAAxB,CAAT;EACH,CAFD;EAIA,OAAOS,MAAP;AACH,CAlBD;;eAoBe,OACXE,WADW,EAEXZ,MAFW,EAGXC,OAHW,KAIoC;EAC/C,IAAIY,KAAK,CAACC,OAAN,CAAcF,WAAd,MAA+B,IAAnC,EA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