@webiny/handler-graphql 5.21.0-beta.0 → 5.22.0-beta.2
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 +2 -2
- package/builtInTypes/DateTimeScalar.js +2 -2
- package/createGraphQLHandler.js +2 -2
- package/createGraphQLSchema.d.ts +1 -2
- package/createGraphQLSchema.js +2 -2
- package/debugPlugins.d.ts +3 -3
- package/index.d.ts +2 -2
- package/package.json +15 -15
- package/processRequestBody.d.ts +2 -1
- package/responses.d.ts +2 -2
- package/types.d.ts +5 -5
|
@@ -13,9 +13,9 @@ var _graphqlScalars = require("graphql-scalars");
|
|
|
13
13
|
|
|
14
14
|
var _graphql = require("graphql");
|
|
15
15
|
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
16
|
+
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; }
|
|
17
17
|
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
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
19
|
|
|
20
20
|
const DateScalar = new _graphql.GraphQLScalarType(_objectSpread(_objectSpread({}, _graphqlScalars.DateResolver), {}, {
|
|
21
21
|
serialize: value => {
|
|
@@ -13,9 +13,9 @@ var _graphqlScalars = require("graphql-scalars");
|
|
|
13
13
|
|
|
14
14
|
var _graphql = require("graphql");
|
|
15
15
|
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
16
|
+
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; }
|
|
17
17
|
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
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
19
|
|
|
20
20
|
const DateTimeScalar = new _graphql.GraphQLScalarType(_objectSpread(_objectSpread({}, _graphqlScalars.DateTimeResolver), {}, {
|
|
21
21
|
serialize: value => {
|
package/createGraphQLHandler.js
CHANGED
|
@@ -19,9 +19,9 @@ var _processRequestBody = _interopRequireDefault(require("./processRequestBody")
|
|
|
19
19
|
|
|
20
20
|
var _utils = require("@webiny/utils");
|
|
21
21
|
|
|
22
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
22
|
+
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; }
|
|
23
23
|
|
|
24
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
24
|
+
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; }
|
|
25
25
|
|
|
26
26
|
const DEFAULT_HEADERS = _objectSpread({
|
|
27
27
|
"Content-Type": "application/json",
|
package/createGraphQLSchema.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { Context } from "@webiny/handler/types";
|
|
2
1
|
import { HttpContext } from "@webiny/handler-http/types";
|
|
3
|
-
export declare const createGraphQLSchema: (context:
|
|
2
|
+
export declare const createGraphQLSchema: (context: HttpContext) => import("graphql").GraphQLSchema;
|
package/createGraphQLSchema.js
CHANGED
|
@@ -15,9 +15,9 @@ 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);
|
|
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
19
|
|
|
20
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
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
21
|
|
|
22
22
|
const createGraphQLSchema = context => {
|
|
23
23
|
const scalars = context.plugins.byType("graphql-scalar").map(item => item.scalar);
|
package/debugPlugins.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GraphQLAfterQueryPlugin, GraphQLBeforeQueryPlugin } from "./types";
|
|
2
|
-
import {
|
|
3
|
-
interface DebugContext extends
|
|
2
|
+
import { Context, ContextPlugin } from "@webiny/handler/types";
|
|
3
|
+
interface DebugContext extends Context {
|
|
4
4
|
debug: {
|
|
5
5
|
logs?: {
|
|
6
6
|
method: string;
|
|
@@ -8,5 +8,5 @@ interface DebugContext extends ContextInterface {
|
|
|
8
8
|
}[];
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
|
-
declare const _default: () => (ContextPlugin<DebugContext,
|
|
11
|
+
declare const _default: () => (ContextPlugin<DebugContext, Context, Context, Context, Context, Context, Context, Context, Context, Context> | GraphQLBeforeQueryPlugin<DebugContext> | GraphQLAfterQueryPlugin<DebugContext>)[];
|
|
12
12
|
export default _default;
|
package/index.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export * from "./errors";
|
|
|
5
5
|
export * from "./responses";
|
|
6
6
|
declare const _default: (options?: HandlerGraphQLOptions) => import("@webiny/plugins/types").PluginCollection[];
|
|
7
7
|
export default _default;
|
|
8
|
-
export declare const pipe: <TSource = any, TArgs = Record<string, any>, TContext = Context
|
|
9
|
-
export declare const compose: <TSource = any, TArgs = Record<string, any>, TContext = Context
|
|
8
|
+
export declare const pipe: <TSource = any, TArgs = Record<string, any>, TContext = Context>(...fns: any[]) => (resolver: import("graphql").GraphQLFieldResolver<TSource, TContext, TArgs>) => any;
|
|
9
|
+
export declare const compose: <TSource = any, TArgs = Record<string, any>, TContext = Context>(...fns: any[]) => (resolver: import("graphql").GraphQLFieldResolver<TSource, TContext, TArgs>) => any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/handler-graphql",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.22.0-beta.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -14,25 +14,25 @@
|
|
|
14
14
|
"Adrian Smijulj <adrian@webiny.com>"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@babel/runtime": "7.16.
|
|
17
|
+
"@babel/runtime": "7.16.7",
|
|
18
18
|
"@graphql-tools/schema": "7.1.5",
|
|
19
|
-
"@webiny/error": "5.
|
|
20
|
-
"@webiny/handler": "5.
|
|
21
|
-
"@webiny/handler-http": "5.
|
|
22
|
-
"@webiny/plugins": "5.
|
|
23
|
-
"@webiny/utils": "5.
|
|
19
|
+
"@webiny/error": "5.22.0-beta.2",
|
|
20
|
+
"@webiny/handler": "5.22.0-beta.2",
|
|
21
|
+
"@webiny/handler-http": "5.22.0-beta.2",
|
|
22
|
+
"@webiny/plugins": "5.22.0-beta.2",
|
|
23
|
+
"@webiny/utils": "5.22.0-beta.2",
|
|
24
24
|
"boolean": "3.1.4",
|
|
25
|
-
"graphql": "
|
|
25
|
+
"graphql": "15.8.0",
|
|
26
26
|
"graphql-scalars": "1.12.0",
|
|
27
27
|
"graphql-tag": "2.12.6"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@babel/cli": "^7.
|
|
31
|
-
"@babel/core": "^7.
|
|
32
|
-
"@babel/preset-env": "^7.
|
|
33
|
-
"@webiny/cli": "^5.
|
|
34
|
-
"@webiny/handler-args": "^5.
|
|
35
|
-
"@webiny/project-utils": "^5.
|
|
30
|
+
"@babel/cli": "^7.16.0",
|
|
31
|
+
"@babel/core": "^7.16.0",
|
|
32
|
+
"@babel/preset-env": "^7.16.4",
|
|
33
|
+
"@webiny/cli": "^5.22.0-beta.2",
|
|
34
|
+
"@webiny/handler-args": "^5.22.0-beta.2",
|
|
35
|
+
"@webiny/project-utils": "^5.22.0-beta.2",
|
|
36
36
|
"jest": "^26.6.3",
|
|
37
37
|
"jest-mock-console": "^1.0.0",
|
|
38
38
|
"rimraf": "^3.0.2",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"build": "yarn webiny run build",
|
|
47
47
|
"watch": "yarn webiny run watch"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "c472d20682885fb538354c206a148deaae14bfe8"
|
|
50
50
|
}
|
package/processRequestBody.d.ts
CHANGED
package/responses.d.ts
CHANGED
|
@@ -25,12 +25,12 @@ export declare class ListErrorResponse {
|
|
|
25
25
|
};
|
|
26
26
|
constructor(params: ErrorResponseParams);
|
|
27
27
|
}
|
|
28
|
-
export declare class Response<T
|
|
28
|
+
export declare class Response<T = any> {
|
|
29
29
|
data: T;
|
|
30
30
|
error: null;
|
|
31
31
|
constructor(data: T);
|
|
32
32
|
}
|
|
33
|
-
export declare class ListResponse<T
|
|
33
|
+
export declare class ListResponse<T, M> {
|
|
34
34
|
data: Array<T>;
|
|
35
35
|
meta: M;
|
|
36
36
|
error: null;
|
package/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GraphQLScalarType, GraphQLFieldResolver as BaseGraphQLFieldResolver, GraphQLSchema } from "graphql";
|
|
2
2
|
import { Plugin } from "@webiny/plugins/types";
|
|
3
|
-
import {
|
|
3
|
+
import { Context } from "@webiny/handler/types";
|
|
4
4
|
export interface GraphQLScalarPlugin extends Plugin {
|
|
5
5
|
type: "graphql-scalar";
|
|
6
6
|
scalar: GraphQLScalarType;
|
|
@@ -8,7 +8,7 @@ export interface GraphQLScalarPlugin extends Plugin {
|
|
|
8
8
|
export interface HandlerGraphQLOptions {
|
|
9
9
|
debug?: boolean | string;
|
|
10
10
|
}
|
|
11
|
-
export declare type GraphQLFieldResolver<TSource = any, TArgs = any, TContext =
|
|
11
|
+
export declare type GraphQLFieldResolver<TSource = any, TArgs = any, TContext = Context> = BaseGraphQLFieldResolver<TSource, TContext, TArgs>;
|
|
12
12
|
export declare type Types = string | (() => string | Promise<string>);
|
|
13
13
|
export interface GraphQLSchemaPluginTypeArgs {
|
|
14
14
|
context?: any;
|
|
@@ -22,7 +22,7 @@ export interface GraphQLSchemaDefinition<TContext> {
|
|
|
22
22
|
typeDefs: Types;
|
|
23
23
|
resolvers?: Resolvers<TContext>;
|
|
24
24
|
}
|
|
25
|
-
export interface GraphQLSchemaPlugin<TContext extends
|
|
25
|
+
export interface GraphQLSchemaPlugin<TContext extends Context = Context> extends Plugin {
|
|
26
26
|
type: "graphql-schema";
|
|
27
27
|
schema: GraphQLSchemaDefinition<TContext>;
|
|
28
28
|
}
|
|
@@ -31,7 +31,7 @@ export interface GraphQLRequestBody {
|
|
|
31
31
|
variables: Record<string, any>;
|
|
32
32
|
operationName: string;
|
|
33
33
|
}
|
|
34
|
-
export interface GraphQLBeforeQueryPlugin<TContext extends
|
|
34
|
+
export interface GraphQLBeforeQueryPlugin<TContext extends Context = Context> extends Plugin {
|
|
35
35
|
type: "graphql-before-query";
|
|
36
36
|
apply(params: {
|
|
37
37
|
body: GraphQLRequestBody;
|
|
@@ -39,7 +39,7 @@ export interface GraphQLBeforeQueryPlugin<TContext extends ContextInterface = Co
|
|
|
39
39
|
context: TContext;
|
|
40
40
|
}): void;
|
|
41
41
|
}
|
|
42
|
-
export interface GraphQLAfterQueryPlugin<TContext extends
|
|
42
|
+
export interface GraphQLAfterQueryPlugin<TContext extends Context = Context> extends Plugin {
|
|
43
43
|
type: "graphql-after-query";
|
|
44
44
|
apply(params: {
|
|
45
45
|
result: any;
|