@rxdi/graphql 0.7.203 → 0.7.205
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GraphQLDirective, GraphQLSchema,
|
|
1
|
+
import { GraphQLDirective, GraphQLSchema, DirectiveLocation } from 'graphql';
|
|
2
2
|
/**
|
|
3
3
|
* Apply custom directives support in the graphql schema
|
|
4
4
|
*/
|
|
@@ -6,7 +6,7 @@ export declare const applySchemaCustomDirectives: (schema: GraphQLSchema) => Gra
|
|
|
6
6
|
export interface GraphQLCustomDirectiveInterface<T = {}, A = {}, K = {}> {
|
|
7
7
|
name: string;
|
|
8
8
|
description?: string;
|
|
9
|
-
locations:
|
|
9
|
+
locations: DirectiveLocation[];
|
|
10
10
|
args?: {
|
|
11
11
|
[key: string]: {
|
|
12
12
|
description: string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as formatError from 'apollo-errors';
|
|
2
1
|
import * as boom from '@hapi/boom';
|
|
3
2
|
export interface ServerErrors {
|
|
4
3
|
name: any;
|
|
@@ -11,8 +10,6 @@ export interface ServerErrors {
|
|
|
11
10
|
};
|
|
12
11
|
};
|
|
13
12
|
}
|
|
14
|
-
export declare const attachErrorHandlers: (error: any, returnNull?: boolean) => formatError.ErrorInfo;
|
|
15
|
-
export declare const clientErrors: typeof formatError;
|
|
16
13
|
export declare const Boom: typeof boom;
|
|
17
|
-
export declare function createError(name: any, message: string, data?: any): void;
|
|
14
|
+
export declare function createError(name: any, message: string, data?: any): void | Error;
|
|
18
15
|
export declare const errorUnauthorized: () => never;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.errorUnauthorized = exports.Boom =
|
|
3
|
+
exports.errorUnauthorized = exports.Boom = void 0;
|
|
4
4
|
exports.createError = createError;
|
|
5
|
-
const formatError = require("apollo-errors");
|
|
6
5
|
const boom = require("@hapi/boom");
|
|
7
|
-
exports.attachErrorHandlers = formatError.formatError;
|
|
8
|
-
exports.clientErrors = formatError;
|
|
9
6
|
exports.Boom = boom;
|
|
10
7
|
function createError(name, message, data) {
|
|
11
8
|
function guid() {
|
|
@@ -30,10 +27,9 @@ function createError(name, message, data) {
|
|
|
30
27
|
data = data || {};
|
|
31
28
|
data.eid = guid();
|
|
32
29
|
message = `(${data.eid}): ${message}`;
|
|
33
|
-
|
|
34
|
-
return new error();
|
|
30
|
+
return new Error(JSON.stringify({ name, message, data }));
|
|
35
31
|
}
|
|
36
32
|
const errorUnauthorized = function () {
|
|
37
|
-
throw
|
|
33
|
+
throw createError('unauthorized', 'You are unable to fetch data');
|
|
38
34
|
};
|
|
39
35
|
exports.errorUnauthorized = errorUnauthorized;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxdi/graphql",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.205",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/rxdi/graphql"
|
|
@@ -30,12 +30,11 @@
|
|
|
30
30
|
"module": "./dist/index.js",
|
|
31
31
|
"typings": "./dist/index.d.ts",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"apollo-errors": "1.9.0",
|
|
34
33
|
"@hapi/boom": "^10.0.1"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
|
-
"@rxdi/core": "^0.7.
|
|
38
|
-
"@rxdi/hapi": "^0.7.
|
|
36
|
+
"@rxdi/core": "^0.7.204",
|
|
37
|
+
"@rxdi/hapi": "^0.7.204",
|
|
39
38
|
"graphql": "^16.12.0",
|
|
40
39
|
"@types/graphql": "^14.5.0",
|
|
41
40
|
"@types/jest": "^24.0.22",
|