@common-stack/graphql-api 7.1.1-alpha.63 → 7.2.1-alpha.0
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/lib/api/graphql/cache-control.graphql.js +1 -0
- package/lib/api/graphql/cache-control.graphql.js.map +1 -0
- package/lib/api/graphql/common-schema.graphql.js +2 -0
- package/lib/api/graphql/common-schema.graphql.js.map +1 -0
- package/lib/api/graphql/index.js +2 -2
- package/lib/api/graphql/index.js.map +1 -1
- package/lib/api/resolvers.d.ts +12 -0
- package/lib/api/resolvers.js +12 -1
- package/lib/api/resolvers.js.map +1 -1
- package/lib/index.d.ts +0 -3
- package/lib/index.js +1 -4
- package/lib/index.js.map +1 -1
- package/lib/module.d.ts +3 -0
- package/lib/module.js +5 -0
- package/lib/module.js.map +1 -0
- package/lib/scalars/AnyObject.js.map +1 -1
- package/lib/scalars/GraphQLTimestamp.js.map +1 -1
- package/lib/utils/cache-paginated-queries.factory.js.map +1 -1
- package/package.json +3 -3
- package/lib/api/graphql/root-schema.graphqls.js +0 -2
- package/lib/api/graphql/root-schema.graphqls.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var cacheControleDirective = "directive @invalidateCache(queries:[String!]!) on MUTATION | FIELD_DEFINITION\n\nenum CacheControlScope {\n PUBLIC\n PRIVATE\n}\n\ndirective @cacheControl(\n maxAge: Int\n scope: CacheControlScope\n inheritMaxAge: Boolean\n) on FIELD_DEFINITION | OBJECT | INTERFACE | UNION";export{cacheControleDirective as default};//# sourceMappingURL=cache-control.graphql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache-control.graphql.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var commonSchema = "scalar AnyObject\nscalar Date\nscalar Time\nscalar DateTime\nscalar Timestamp\nscalar URI\nscalar URIInput\nscalar Observable\nscalar JSON\nscalar JSONObject\n\n\"\"\"\n An object with an ID.\n\"\"\"\ninterface Node {\n \"\"\"\n The ID of the node.\n \"\"\"\n id: ID!\n}\n\n# Pagination information. See https://facebook.github.io/relay/graphql/connections.htm#sec-undefined.PageInfo.\ntype PageInfo {\n # Whether there is a next page of nodes in the connection.\n hasNextPage: Boolean!\n}\n\n\"\"\"\n Represents a null return value.\n\"\"\"\ntype EmptyResponse {\n # A dummy null value.\n alwaysNil: String\n}\n\ntype FieldError {\n field: String!\n message: String!\n}\n\ninput Sort{\n key: String!,\n value: SortEnum!,\n}\n\nenum SortEnum{\n ASC,\n DESC\n}\n\ntype Query {\n \"\"\"\n Looks up a node by ID.\n \"\"\"\n node(id: ID!): Node\n}\n\ntype Mutation {\n dummy: Int\n}\n\ntype Subscription {\n dummy: Int\n}\n\ntype AdminIdeSettings {\n dummy: Int\n}\n\nenum ContributionSechemaId {\n dummy\n}\n\nenum ContributionExtensionName {\n dummy\n}\n\n\"\"\" All Moleculer Topic names are extended from this.\"\"\"\nenum MoleculerServiceName {\n dummy\n}\n\nenum MailTemplateId {\n dummy\n}\n\nenum MoleculerCronServiceName {\n dummy\n}\n\n\"\"\"\n Used for Settings passed in the ContainerModule\n\"\"\"\ninterface IResourceUtilizationSettings {\n subTopic: String\n adminApiNamespace: String\n}\n\n\"\"\"\nTo calculate geometry over an Eath-like sphere.\nList the `longitude` first and then `latitude`\n - Validate longitude values are between `-180` and `180`\n - Validate latitude values are between `-90` and `90`\n\"\"\"\ntype GeoLocation {\n coordinates: [Float]\n}\n\"\"\"\nInput geometry of the location.\nList the `longitude` first and then `latitude`\n - Validate longitude values are between `-180` and `180`\n - Validate latitude values are between `-90` and `90`\n\"\"\"\ninput GeoLocationInput {\n type: String = \"Point\"\n coordinates: [Float]\n}\n\nschema {\n query: Query\n mutation: Mutation\n subscription: Subscription\n}\n";
|
|
2
|
+
export{commonSchema as default};//# sourceMappingURL=common-schema.graphql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-schema.graphql.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/lib/api/graphql/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
const schema = [
|
|
1
|
+
import commonSchema from'./common-schema.graphql.js';import cacheControleDirective from'./cache-control.graphql.js';// @ts-ignore
|
|
2
|
+
const schema = [commonSchema, cacheControleDirective];export{schema};//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/api/graphql/index.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/api/graphql/index.ts"],"sourcesContent":["// @ts-ignore\nimport commonSchema from './common-schema.graphql';\n// @ts-ignore\nimport cacheControleDirective from './cache-control.graphql';\n\nexport const schema = [commonSchema, cacheControleDirective];\n"],"names":[],"mappings":"oHAAA;MAKa,MAAM,GAAG,CAAC,YAAY,EAAE,sBAAsB"}
|
package/lib/api/resolvers.d.ts
CHANGED
|
@@ -9,6 +9,12 @@ export declare const resolvers: {
|
|
|
9
9
|
JSON: import("graphql").GraphQLScalarType<unknown, unknown>;
|
|
10
10
|
JSONObject: import("graphql").GraphQLScalarType<unknown, unknown>;
|
|
11
11
|
};
|
|
12
|
+
export declare const directiveResolvers: {
|
|
13
|
+
invalidateCache(next: any, source: any, { queries }: {
|
|
14
|
+
queries: any;
|
|
15
|
+
}, context: any): any;
|
|
16
|
+
cacheControl(next: any, source: any, args: any, context: any): any;
|
|
17
|
+
};
|
|
12
18
|
export declare const resolverFunc: (options: any) => {
|
|
13
19
|
AnyObject: import("graphql").GraphQLScalarType<unknown, unknown>;
|
|
14
20
|
Date: import("graphql").GraphQLScalarType<Date, string>;
|
|
@@ -20,3 +26,9 @@ export declare const resolverFunc: (options: any) => {
|
|
|
20
26
|
JSON: import("graphql").GraphQLScalarType<unknown, unknown>;
|
|
21
27
|
JSONObject: import("graphql").GraphQLScalarType<unknown, unknown>;
|
|
22
28
|
};
|
|
29
|
+
export declare const directiveResolverFunc: (options: any) => {
|
|
30
|
+
invalidateCache(next: any, source: any, { queries }: {
|
|
31
|
+
queries: any;
|
|
32
|
+
}, context: any): any;
|
|
33
|
+
cacheControl(next: any, source: any, args: any, context: any): any;
|
|
34
|
+
};
|
package/lib/api/resolvers.js
CHANGED
|
@@ -9,4 +9,15 @@ import GraphQLJSON,{GraphQLJSONObject}from'graphql-type-json';import {GraphQLDat
|
|
|
9
9
|
JSON: GraphQLJSON,
|
|
10
10
|
JSONObject: GraphQLJSONObject,
|
|
11
11
|
};
|
|
12
|
-
const
|
|
12
|
+
const directiveResolvers = {
|
|
13
|
+
invalidateCache(next, source, { queries }, context) {
|
|
14
|
+
context.queriesToInvalidate = queries;
|
|
15
|
+
return next();
|
|
16
|
+
},
|
|
17
|
+
cacheControl(next, source, args, context) {
|
|
18
|
+
context.overallCachePolicy = args;
|
|
19
|
+
return next();
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
const resolverFunc = (options) => resolvers;
|
|
23
|
+
const directiveResolverFunc = (options) => directiveResolvers;export{directiveResolverFunc,directiveResolvers,resolverFunc,resolvers};//# sourceMappingURL=resolvers.js.map
|
package/lib/api/resolvers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvers.js","sources":["../../src/api/resolvers.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"resolvers.js","sources":["../../src/api/resolvers.ts"],"sourcesContent":["import GraphQLJSON, { GraphQLJSONObject } from 'graphql-type-json';\nimport { GraphQLDate, GraphQLTime, GraphQLDateTime } from 'graphql-scalars';\nimport GraphQLURI from '@cdmbase/graphql-type-uri';\nimport GraphqlTimestamp from '../scalars/GraphQLTimestamp';\nimport { GraphQLAnyObject } from '../scalars/AnyObject';\n\nexport const resolvers = {\n AnyObject: GraphQLAnyObject,\n Date: GraphQLDate,\n Time: GraphQLTime,\n Timestamp: GraphqlTimestamp,\n URI: GraphQLURI('URI'),\n URIInput: GraphQLURI('URIInput'),\n DateTime: GraphQLDateTime,\n JSON: GraphQLJSON,\n JSONObject: GraphQLJSONObject,\n};\n\nexport const directiveResolvers = {\n invalidateCache(next, source, { queries }, context) {\n context.queriesToInvalidate = queries;\n return next();\n },\n cacheControl(next, source, args, context) {\n context.overallCachePolicy = args;\n return next();\n },\n};\n\nexport const resolverFunc = (options) => resolvers;\n\nexport const directiveResolverFunc = (options) => directiveResolvers;\n"],"names":["GraphqlTimestamp"],"mappings":"uSAMa,MAAA,SAAS,GAAG;AACrB,IAAA,SAAS,EAAE,gBAAgB;AAC3B,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,SAAS,EAAEA,aAAgB;AAC3B,IAAA,GAAG,EAAE,UAAU,CAAC,KAAK,CAAC;AACtB,IAAA,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC;AAChC,IAAA,QAAQ,EAAE,eAAe;AACzB,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,UAAU,EAAE,iBAAiB;EAC/B;AAEW,MAAA,kBAAkB,GAAG;IAC9B,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,OAAO,EAAA;AAC9C,QAAA,OAAO,CAAC,mBAAmB,GAAG,OAAO,CAAC;QACtC,OAAO,IAAI,EAAE,CAAC;KACjB;AACD,IAAA,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAA;AACpC,QAAA,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAClC,OAAO,IAAI,EAAE,CAAC;KACjB;EACH;AAEW,MAAA,YAAY,GAAG,CAAC,OAAO,KAAK,UAAU;AAEtC,MAAA,qBAAqB,GAAG,CAAC,OAAO,KAAK"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { Feature } from '@common-stack/server-core';
|
|
2
1
|
import { schema, resolvers } from './api';
|
|
3
2
|
export { resolvers };
|
|
4
3
|
export { schema as rootSchemaDef };
|
|
5
4
|
export * from './scalars';
|
|
6
5
|
export * from './utils';
|
|
7
|
-
declare const _default: Feature<any, any>;
|
|
8
|
-
export default _default;
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
schema,
|
|
3
|
-
createResolversFunc: resolverFunc,
|
|
4
|
-
});export{index as default,schema as rootSchemaDef};//# sourceMappingURL=index.js.map
|
|
1
|
+
export{schema as rootSchemaDef}from'./api/graphql/index.js';export{resolvers}from'./api/resolvers.js';export{GraphQLAnyObject}from'./scalars/AnyObject.js';export{cachePaginatedQueriesFactory}from'./utils/cache-paginated-queries.factory.js';//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/lib/module.d.ts
ADDED
package/lib/module.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import {Feature}from'@common-stack/server-core';import {schema}from'./api/graphql/index.js';import {resolverFunc,directiveResolverFunc}from'./api/resolvers.js';var module = new Feature({
|
|
2
|
+
schema,
|
|
3
|
+
createResolversFunc: resolverFunc,
|
|
4
|
+
createDirectivesFunc: directiveResolverFunc,
|
|
5
|
+
});export{module as default};//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../src/module.ts"],"sourcesContent":["import { Feature } from '@common-stack/server-core';\nimport { schema, resolverFunc, directiveResolverFunc } from './api';\n\nexport default new Feature({\n schema,\n createResolversFunc: resolverFunc,\n createDirectivesFunc: directiveResolverFunc,\n});\n"],"names":[],"mappings":"gKAGA,aAAe,IAAI,OAAO,CAAC;IACvB,MAAM;AACN,IAAA,mBAAmB,EAAE,YAAY;AACjC,IAAA,oBAAoB,EAAE,qBAAqB;AAC9C,CAAA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnyObject.js","sources":["../../src/scalars/AnyObject.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"AnyObject.js","sources":["../../src/scalars/AnyObject.ts"],"sourcesContent":["// add any scalar types\nimport { GraphQLError, GraphQLScalarType, Kind } from 'graphql';\n\n// https://stackoverflow.com/questions/41557536/custom-map-keys-in-graphql-response\nexport const GraphQLAnyObject = new GraphQLScalarType({\n name: 'AnyObject',\n description: 'Any JSON object. This type bypasses type checking.',\n serialize: (value) => value,\n parseValue: (value) => value,\n parseLiteral: (ast) => {\n if (ast.kind !== Kind.OBJECT) {\n throw new GraphQLError(`Query error: Can only parse object but got a: ${ast.kind}`, [ast]);\n }\n return ast.fields;\n },\n});\n"],"names":[],"mappings":"0DAAA;AAGA;AACa,MAAA,gBAAgB,GAAG,IAAI,iBAAiB,CAAC;AAClD,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,WAAW,EAAE,oDAAoD;AACjE,IAAA,SAAS,EAAE,CAAC,KAAK,KAAK,KAAK;AAC3B,IAAA,UAAU,EAAE,CAAC,KAAK,KAAK,KAAK;AAC5B,IAAA,YAAY,EAAE,CAAC,GAAG,KAAI;QAClB,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,EAAE;AAC1B,YAAA,MAAM,IAAI,YAAY,CAAC,CAAA,8CAAA,EAAiD,GAAG,CAAC,IAAI,CAAA,CAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;SAC9F;QACD,OAAO,GAAG,CAAC,MAAM,CAAC;KACrB;AACJ,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphQLTimestamp.js","sources":["../../src/scalars/GraphQLTimestamp.ts"],"sourcesContent":[null],"names":[],"mappings":"qFAGA;AACA,SAAS,aAAa,CAAC,KAAK,EAAA;AACxB,IAAA,IAAI,KAAK,YAAY,IAAI,EAAE;AACvB,QAAA,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;KAC1B;AACD,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC3B,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KAC5B;AACD,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC3B,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KAC5B;AACD,IAAA,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,SAAS,CAAC,KAAK,EAAA;AACpB,IAAA,IAAI,KAAK,KAAK,IAAI,EAAE;AAChB,QAAA,OAAO,IAAI,CAAC;KACf;AAED,IAAA,IAAI;AACA,QAAA,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;KAC1B;IAAC,OAAO,GAAG,EAAE;AACV,QAAA,OAAO,IAAI,CAAC;KACf;AACL,CAAC;AAED,SAAS,oBAAoB,CAAC,GAAG,EAAA;IAC7B,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,GAAG,EAAE;QACvB,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACpC,QAAA,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;KACxB;IACD,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,EAAE;AAC1B,QAAA,OAAO,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KAC/B;AACD,IAAA,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,MAAM,aAAa,GAAG,IAAI,iBAAiB,CAAC;AACxC,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,WAAW,EACP,kEAAkE;QAClE,qDAAqD;AACzD,IAAA,SAAS,EAAE,aAAa;AACxB,IAAA,UAAU,EAAE,SAAS;AACrB,IAAA,YAAY,EAAE,oBAAoB;AACrC,CAAA"}
|
|
1
|
+
{"version":3,"file":"GraphQLTimestamp.js","sources":["../../src/scalars/GraphQLTimestamp.ts"],"sourcesContent":["import { Kind } from 'graphql/language/index.js';\nimport { GraphQLScalarType } from 'graphql';\n\n// source from https://gist.github.com/langpavel/b30f3d507a47713b0c6e89016e4e9eb7\nfunction serializeDate(value) {\n if (value instanceof Date) {\n return value.getTime();\n }\n if (typeof value === 'number') {\n return Math.trunc(value);\n }\n if (typeof value === 'string') {\n return Date.parse(value);\n }\n return null;\n}\n\nfunction parseDate(value) {\n if (value === null) {\n return null;\n }\n\n try {\n return new Date(value);\n } catch (err) {\n return null;\n }\n}\n\nfunction parseDateFromLiteral(ast) {\n if (ast.kind === Kind.INT) {\n const num = parseInt(ast.value, 10);\n return new Date(num);\n }\n if (ast.kind === Kind.STRING) {\n return parseDate(ast.value);\n }\n return null;\n}\n\nconst TimestampType = new GraphQLScalarType({\n name: 'Timestamp',\n description:\n 'The javascript `Date` as integer. Type represents date and time ' +\n 'as number of milliseconds from start of UNIX epoch.',\n serialize: serializeDate,\n parseValue: parseDate,\n parseLiteral: parseDateFromLiteral,\n});\n\nexport default TimestampType;\n"],"names":[],"mappings":"qFAGA;AACA,SAAS,aAAa,CAAC,KAAK,EAAA;AACxB,IAAA,IAAI,KAAK,YAAY,IAAI,EAAE;AACvB,QAAA,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;KAC1B;AACD,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC3B,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KAC5B;AACD,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC3B,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KAC5B;AACD,IAAA,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,SAAS,CAAC,KAAK,EAAA;AACpB,IAAA,IAAI,KAAK,KAAK,IAAI,EAAE;AAChB,QAAA,OAAO,IAAI,CAAC;KACf;AAED,IAAA,IAAI;AACA,QAAA,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;KAC1B;IAAC,OAAO,GAAG,EAAE;AACV,QAAA,OAAO,IAAI,CAAC;KACf;AACL,CAAC;AAED,SAAS,oBAAoB,CAAC,GAAG,EAAA;IAC7B,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,GAAG,EAAE;QACvB,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACpC,QAAA,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;KACxB;IACD,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,EAAE;AAC1B,QAAA,OAAO,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KAC/B;AACD,IAAA,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,MAAM,aAAa,GAAG,IAAI,iBAAiB,CAAC;AACxC,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,WAAW,EACP,kEAAkE;QAClE,qDAAqD;AACzD,IAAA,SAAS,EAAE,aAAa;AACxB,IAAA,UAAU,EAAE,SAAS;AACrB,IAAA,YAAY,EAAE,oBAAoB;AACrC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-paginated-queries.factory.js","sources":["../../src/utils/cache-paginated-queries.factory.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"cache-paginated-queries.factory.js","sources":["../../src/utils/cache-paginated-queries.factory.ts"],"sourcesContent":["import { TypePolicies } from '@apollo/client';\n\ninterface QueryOptionsInterface {\n name: string;\n keyArgs?: (string[] | string)[];\n skipKey?: string;\n limitKey?: string;\n}\n\nexport const DEFAULT_SKIP = 0;\nexport const DEFAULT_LIMIT = 10;\n\nexport const cachePaginatedQueriesFactory = (queries: (string | QueryOptionsInterface)[]): TypePolicies =>\n queries.reduce((acc, query) => {\n const queryName = typeof query === 'string' ? query : query.name;\n const keyArgs = typeof query === 'string' ? ['criteria', 'sort'] : query.keyArgs;\n const skipKey = typeof query === 'string' ? 'skip' : query.skipKey;\n const limitKey = typeof query === 'string' ? 'limit' : query.limitKey;\n return {\n ...acc,\n [queryName]: {\n keyArgs,\n merge(existing, incoming, { args }) {\n const skip = args.get(skipKey, DEFAULT_SKIP);\n const merged = existing?.data.length > 0 ? existing.data.slice(0) : [];\n incoming?.data.forEach((curr, index) => {\n merged[skip + index] = curr;\n });\n return { ...incoming, data: merged };\n },\n read(existing, { args }) {\n const skip = args.get(skipKey, DEFAULT_SKIP);\n const limit = args.get(limitKey, DEFAULT_LIMIT);\n const data = existing?.data && existing?.data?.slice(skip, skip + limit);\n return {\n ...existing,\n data,\n };\n },\n },\n };\n }, {});\n"],"names":[],"mappings":"AASO,MAAM,YAAY,GAAG,EAAE;AACvB,MAAM,aAAa,GAAG,GAAG;AAEnB,MAAA,4BAA4B,GAAG,CAAC,OAA2C,KACpF,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,KAAI;AAC1B,IAAA,MAAM,SAAS,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;IACjE,MAAM,OAAO,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;AACjF,IAAA,MAAM,OAAO,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC;AACnE,IAAA,MAAM,QAAQ,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC;IACtE,OAAO;AACH,QAAA,GAAG,GAAG;QACN,CAAC,SAAS,GAAG;YACT,OAAO;AACP,YAAA,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAA;gBAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;gBAC7C,MAAM,MAAM,GAAG,QAAQ,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;gBACvE,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,KAAI;AACnC,oBAAA,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC;AAChC,iBAAC,CAAC,CAAC;gBACH,OAAO,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;aACxC;AACD,YAAA,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAA;gBACnB,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;gBAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AAChD,gBAAA,MAAM,IAAI,GAAG,QAAQ,EAAE,IAAI,IAAI,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,KAAK,CAAC,CAAC;gBACzE,OAAO;AACH,oBAAA,GAAG,QAAQ;oBACX,IAAI;iBACP,CAAC;aACL;AACJ,SAAA;KACJ,CAAC;AACN,CAAC,EAAE,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@common-stack/graphql-api",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.1-alpha.0",
|
|
4
4
|
"description": "graphql api for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@cdm-logger/core": ">=7.0.12",
|
|
31
|
-
"@common-stack/server-core": "7.1.1-alpha.
|
|
31
|
+
"@common-stack/server-core": "7.1.1-alpha.63",
|
|
32
32
|
"lodash": "^4.17.21"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "533d5868c17a5ba3b624f7bff060f9817186182b",
|
|
38
38
|
"typescript": {
|
|
39
39
|
"definition": "lib/index.d.ts"
|
|
40
40
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var rootSchema = "scalar AnyObject\nscalar Date\nscalar Time\nscalar DateTime\nscalar Timestamp\nscalar URI\nscalar URIInput\nscalar Observable\nscalar JSON\nscalar JSONObject\n\n\"\"\"\n An object with an ID.\n\"\"\"\ninterface Node {\n \"\"\"\n The ID of the node.\n \"\"\"\n id: ID!\n}\n\n# Pagination information. See https://facebook.github.io/relay/graphql/connections.htm#sec-undefined.PageInfo.\ntype PageInfo {\n # Whether there is a next page of nodes in the connection.\n hasNextPage: Boolean!\n}\n\n\"\"\"\n Represents a null return value.\n\"\"\"\ntype EmptyResponse {\n # A dummy null value.\n alwaysNil: String\n}\n\ntype FieldError {\n field: String!\n message: String!\n}\n\ninput Sort{\n key: String!,\n value: SortEnum!,\n}\n\nenum SortEnum{\n ASC,\n DESC\n}\n\ntype Query {\n \"\"\"\n Looks up a node by ID.\n \"\"\"\n node(id: ID!): Node\n}\n\ntype Mutation {\n dummy: Int\n}\n\ntype Subscription {\n dummy: Int\n}\n\ntype AdminIdeSettings {\n dummy: Int\n}\n\nenum ContributionSechemaId {\n dummy\n}\n\nenum ContributionExtensionName {\n dummy\n}\n\n\"\"\" All Moleculer Topic names are extended from this.\"\"\"\nenum MoleculerServiceName {\n dummy\n}\n\nenum MailTemplateId {\n dummy\n}\n\nenum MoleculerCronServiceName {\n dummy\n}\n\ntype GeoLocation {\n coordinates: [Float]\n}\n\nschema {\n query: Query\n mutation: Mutation\n subscription: Subscription\n}\n";
|
|
2
|
-
export{rootSchema as default};//# sourceMappingURL=root-schema.graphqls.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"root-schema.graphqls.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|