@orion-js/graphql 3.0.14 → 3.0.20
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/LICENSE +1 -1
- package/lib/buildSchema/getArgs/getField.js +2 -1
- package/lib/buildSchema/getType/BigIntScalar.d.ts +1 -1
- package/lib/buildSchema/getType/DateScalar.d.ts +1 -1
- package/lib/buildSchema/getType/JSONScalar.d.ts +1 -1
- package/lib/resolversSchemas/getBasicResultQuery.js +2 -1
- package/lib/resolversSchemas/index.d.ts +1 -4
- package/lib/resolversSchemas/params.d.ts +1 -4
- package/lib/types/startGraphQL.d.ts +2 -2
- package/package.json +15 -14
- package/yarn-error.log +2 -1
package/LICENSE
CHANGED
|
@@ -8,6 +8,7 @@ const isArray_1 = __importDefault(require("lodash/isArray"));
|
|
|
8
8
|
const graphql_1 = require("graphql");
|
|
9
9
|
const schema_1 = require("@orion-js/schema");
|
|
10
10
|
const getScalar_1 = __importDefault(require("../getType/getScalar"));
|
|
11
|
+
const getStaticFields_1 = require("../../resolversSchemas/getStaticFields");
|
|
11
12
|
const storedModelInput = {};
|
|
12
13
|
const getModelInput = function (model, fields) {
|
|
13
14
|
if (storedModelInput[model.name]) {
|
|
@@ -32,7 +33,7 @@ function getParams(type) {
|
|
|
32
33
|
if (!model || !model.__isModel)
|
|
33
34
|
throw new Error(`A type is not a Model`);
|
|
34
35
|
const fields = {};
|
|
35
|
-
for (const field of
|
|
36
|
+
for (const field of (0, getStaticFields_1.getStaticFields)(model)) {
|
|
36
37
|
fields[field.key] = {
|
|
37
38
|
type: getParams(field.type)
|
|
38
39
|
};
|
|
@@ -4,13 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const isArray_1 = __importDefault(require("lodash/isArray"));
|
|
7
|
+
const getStaticFields_1 = require("./getStaticFields");
|
|
7
8
|
async function getBasicQuery(field) {
|
|
8
9
|
if (!field.type)
|
|
9
10
|
return '';
|
|
10
11
|
if (((0, isArray_1.default)(field.type) && field.type[0].__model) || field.type.__model) {
|
|
11
12
|
const model = (0, isArray_1.default)(field.type) ? field.type[0].__model : field.type.__model;
|
|
12
13
|
const fields = [];
|
|
13
|
-
for (const field of
|
|
14
|
+
for (const field of (0, getStaticFields_1.getStaticFields)(model)) {
|
|
14
15
|
fields.push(await getBasicQuery(field));
|
|
15
16
|
}
|
|
16
17
|
const key = field.key ? `${field.key} ` : '';
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
params: import("@orion-js/resolvers").Resolver<({ mutation, name }: {
|
|
3
|
-
mutation: any;
|
|
4
|
-
name: any;
|
|
5
|
-
}, viewer: any) => Promise<{
|
|
2
|
+
params: import("@orion-js/resolvers").Resolver<({ mutation, name }: any, viewer: any) => Promise<{
|
|
6
3
|
resolver: any;
|
|
7
4
|
name: any;
|
|
8
5
|
}>, undefined>;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
declare const _default: import("@orion-js/resolvers").Resolver<({ mutation, name }: {
|
|
2
|
-
mutation: any;
|
|
3
|
-
name: any;
|
|
4
|
-
}, viewer: any) => Promise<{
|
|
1
|
+
declare const _default: import("@orion-js/resolvers").Resolver<({ mutation, name }: any, viewer: any) => Promise<{
|
|
5
2
|
resolver: any;
|
|
6
3
|
name: any;
|
|
7
4
|
}>, undefined>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GlobalResolversMap } from '@orion-js/models';
|
|
2
2
|
import { express } from '@orion-js/http';
|
|
3
3
|
import { SubscriptionMap } from './subscription';
|
|
4
4
|
import { GraphQLOptions } from 'apollo-server-core';
|
|
@@ -8,7 +8,7 @@ export interface StartGraphQLOptions extends Omit<GraphQLOptions, SchemaOmits> {
|
|
|
8
8
|
/**
|
|
9
9
|
* A map with all the global resolvers
|
|
10
10
|
*/
|
|
11
|
-
resolvers:
|
|
11
|
+
resolvers: GlobalResolversMap;
|
|
12
12
|
/**
|
|
13
13
|
* A Map with all global subscriptions
|
|
14
14
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orion-js/graphql",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.20",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"author": "nicolaslopezj",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,27 +9,28 @@
|
|
|
9
9
|
"prepare": "yarn run build",
|
|
10
10
|
"clean": "rm -rf ./lib",
|
|
11
11
|
"build": "yarn run clean && tsc",
|
|
12
|
-
"watch": "
|
|
12
|
+
"watch": "tsc -w",
|
|
13
|
+
"upgrade-interactive": "yarn upgrade-interactive"
|
|
13
14
|
},
|
|
14
15
|
"dependencies": {
|
|
15
|
-
"@orion-js/helpers": "^3.0.
|
|
16
|
-
"@orion-js/http": "^3.0.
|
|
17
|
-
"@orion-js/models": "^3.0.
|
|
18
|
-
"@orion-js/resolvers": "^3.0.
|
|
19
|
-
"@orion-js/schema": "^3.0.
|
|
20
|
-
"@orion-js/typed-model": "^3.0.
|
|
21
|
-
"apollo-server-core": "3.
|
|
16
|
+
"@orion-js/helpers": "^3.0.17",
|
|
17
|
+
"@orion-js/http": "^3.0.17",
|
|
18
|
+
"@orion-js/models": "^3.0.20",
|
|
19
|
+
"@orion-js/resolvers": "^3.0.17",
|
|
20
|
+
"@orion-js/schema": "^3.0.17",
|
|
21
|
+
"@orion-js/typed-model": "^3.0.20",
|
|
22
|
+
"apollo-server-core": "3.5.0",
|
|
22
23
|
"graphql-iso-date": "^3.6.1",
|
|
23
|
-
"graphql-subscriptions": "^
|
|
24
|
+
"graphql-subscriptions": "^2.0.0",
|
|
24
25
|
"lodash": "^4.17.21",
|
|
25
|
-
"subscriptions-transport-ws": "^0.
|
|
26
|
+
"subscriptions-transport-ws": "^0.11.0"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
|
-
"@apollo/client": "^3.4.
|
|
29
|
+
"@apollo/client": "^3.4.17",
|
|
29
30
|
"@types/jest": "^27.0.2",
|
|
30
31
|
"@types/lodash": "4.14.176",
|
|
31
32
|
"@types/supertest": "2.0.11",
|
|
32
|
-
"graphql": "^
|
|
33
|
+
"graphql": "^16.0.1",
|
|
33
34
|
"jest": "27.3.1",
|
|
34
35
|
"mock-socket-with-protocol": "^7.1.1",
|
|
35
36
|
"supertest": "^6.1.6",
|
|
@@ -42,5 +43,5 @@
|
|
|
42
43
|
"publishConfig": {
|
|
43
44
|
"access": "public"
|
|
44
45
|
},
|
|
45
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "ed37da2a1a61a9a4c0b9935d77e29d83a423e199"
|
|
46
47
|
}
|
package/yarn-error.log
CHANGED
|
@@ -38,7 +38,8 @@ npm manifest:
|
|
|
38
38
|
"prepare": "yarn run build",
|
|
39
39
|
"clean": "rm -rf ./lib",
|
|
40
40
|
"build": "yarn run clean && tsc",
|
|
41
|
-
"watch": "
|
|
41
|
+
"watch": "tsc -w",
|
|
42
|
+
"upgrade-interactive": "yarn upgrade-interactive"
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
44
45
|
"@orion-js/helpers": "^3.0.0-alpha.11",
|