Re-gen package lock

This commit is contained in:
rijkvanzanten
2020-10-01 16:30:38 -04:00
parent c5b95de08d
commit c3ca7ad868
3 changed files with 28 additions and 5 deletions

5
api/package-lock.json generated
View File

@@ -3725,6 +3725,11 @@
"resolved": "https://registry.npmjs.org/graphql/-/graphql-15.3.0.tgz",
"integrity": "sha512-GTCJtzJmkFLWRfFJuoo9RWWa/FfamUHgiFosxi/X1Ani4AVWbeyBenZTNX6dM+7WSbbFfTo/25eh0LLkwHMw2w=="
},
"graphql-type-json": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/graphql-type-json/-/graphql-type-json-0.3.2.tgz",
"integrity": "sha512-J+vjof74oMlCWXSvt0DOf2APEdZOCdubEvGDUAlqH//VBYcOYsGgRW7Xzorr44LvkjiuvecWc8fChxuZZbChtg=="
},
"gtoken": {
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/gtoken/-/gtoken-5.0.3.tgz",

View File

@@ -92,6 +92,7 @@
"fs-extra": "^9.0.1",
"grant": "^5.3.0",
"graphql": "^15.3.0",
"graphql-type-json": "^0.3.2",
"icc": "^2.0.0",
"inquirer": "^7.3.3",
"joi": "^17.1.1",

View File

@@ -1,7 +1,7 @@
import Knex from 'knex';
import database from '../database';
import { AbstractServiceOptions, Accountability, Collection, Field, Relation, Query, AbstractService } from '../types';
import { GraphQLString, GraphQLSchema, GraphQLObjectType, GraphQLList, GraphQLResolveInfo, GraphQLID, FieldNode, GraphQLFieldConfigMap, GraphQLInt, IntValueNode, StringValueNode, BooleanValueNode, ArgumentNode } from 'graphql';
import { GraphQLString, GraphQLSchema, GraphQLObjectType, GraphQLList, GraphQLResolveInfo, GraphQLInputObjectType, GraphQLID, FieldNode, GraphQLFieldConfigMap, GraphQLInt, IntValueNode, StringValueNode, BooleanValueNode, ArgumentNode, GraphQLScalarType } from 'graphql';
import { getGraphQLType } from '../utils/get-graphql-type';
import { RelationsService } from './relations';
import { ItemsService } from './items';
@@ -21,6 +21,22 @@ import { SettingsService } from './settings';
import { UsersService } from './users';
import { WebhooksService } from './webhooks';
const GraphQLAny = new GraphQLScalarType({
name: 'Any',
description: 'Any object',
serialize(x) {
return JSON.stringify(x);
},
parseValue(x) {
return JSON.parse(x);
},
parseLiteral(ast: any) {
let obj: any = {};
ast.fields.forEach((x: any) => obj[x.name.value] = x.value.value);
return obj;
}
});
export class GraphQLService {
accountability: Accountability | null;
knex: Knex;
@@ -43,10 +59,9 @@ export class GraphQLService {
limit: {
type: GraphQLInt,
},
// filter: {
// type: GraphQL,
// },
// @TODO research "any object input" arg type
filter: {
type: GraphQLAny,
},
offset: {
type: GraphQLInt,
},
@@ -194,6 +209,8 @@ export class GraphQLService {
}
}
console.log(args);
const query: Query = sanitizeQuery(args, this.accountability);
const parseFields = (selections: FieldNode[], parent?: string): string[] => {