@common-stack/graphql-api 6.0.6-alpha.5 → 6.0.6-alpha.58
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/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -12,7 +12,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12
12
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
13
13
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
14
14
|
/* harmony export */ });
|
|
15
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("scalar AnyObject\nscalar Date\nscalar Time\nscalar DateTime\nscalar Timestamp\nscalar URI\nscalar URIInput\nscalar Observable\nscalar JSON\nscalar JSONObject\n\
|
|
15
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("scalar AnyObject\nscalar Date\nscalar Time\nscalar DateTime\nscalar Timestamp\nscalar URI\nscalar URIInput\nscalar Observable\nscalar JSON\nscalar JSONObject\n\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}\n\ntype Mutation {\n dummy: Int\n}\n\ntype Subscription {\n dummy: Int\n}\n\n\ntype AdminIdeSettings {\n dummy: Int\n}\n\n\"\"\" All Moleculer Topic names are extended from this.\"\"\"\nenum MoleculerServiceName {\n dummy\n}\n\n#interface Node {\n# id: ID!\n#}\n\n\nschema {\n query: Query\n mutation: Mutation\n subscription: Subscription\n}\n\n");
|
|
16
16
|
|
|
17
17
|
/***/ }),
|
|
18
18
|
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;AAAA,iEAAe,mSAAmS,wBAAwB,8DAA8D,iEAAiE,mIAAmI,8FAA8F,0EAA0E,qDAAqD,qBAAqB,yCAAyC,eAAe,6CAA6C,kBAAkB,uBAAuB,gBAAgB,mFAAmF,mBAAmB,mBAAmB,uBAAuB,mBAAmB,6BAA6B,mBAAmB,+FAA+F,cAAc,qBAAqB,oBAAoB,cAAc,6EAA6E,KAAK;;;;;;;;;;;;;;;ACAr3C;AAEzC,MAAM,MAAM,GAAG,CAAC,6DAAU,CAAC,CAAC;;;;;;;;;;;;;;;;;;;ACFT;AACE;;;;;;;;;;;;;;;;;;;;;;;;ACDuC;AACU;AAC1B;AACQ;AACH;AAEjD,MAAM,SAAS,GAAG;IACrB,SAAS,EAAE,gEAAgB;IAC3B,IAAI,EAAE,yDAAW;IACjB,IAAI,EAAE,yDAAW;IACjB,SAAS,EAAE,iEAAgB;IAC3B,GAAG,EAAE,gEAAU,CAAC,KAAK,CAAC;IACtB,QAAQ,EAAE,gEAAU,CAAC,UAAU,CAAC;IAChC,QAAQ,EAAE,6DAAe;IACzB,IAAI,EAAE,0DAAW;IACjB,UAAU,EAAE,gEAAiB;CAChC,CAAC;AAEK,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;AClBnD,uBAAuB;AACyC;AAEhE,kFAAkF;AAC3E,MAAM,gBAAgB,GAAG,IAAI,sDAAiB,CAAC;IACpD,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,oDAAoD;IACjE,SAAS,EAAE,KA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AEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;;;;ACNoD;AACI;AAEnC;AACc;AACT;AACF;AAGxB,iEAAe,IAAI,8DAAO,CAAC;IACvB,MAAM;IACN,mBAAmB,EAAE,8CAAY;CACpC,CAAC","sources":["webpack://@common-stack/graphql-api/./src/api/graphql/root-schema.graphqls","webpack://@common-stack/graphql-api/./src/api/graphql/index.ts","webpack://@common-stack/graphql-api/./src/api/index.ts","webpack://@common-stack/graphql-api/./src/api/resolvers.ts","webpack://@common-stack/graphql-api/./src/scalars/AnyObject.ts","webpack://@common-stack/graphql-api/./src/scalars/GraphQLTimestamp.ts","webpack://@common-stack/graphql-api/./src/scalars/index.ts","webpack://@common-stack/graphql-api/./src/utils/cache-paginated-queries.factory.ts","webpack://@common-stack/graphql-api/./src/utils/index.ts","webpack://@common-stack/graphql-api/external commonjs \"@cdmbase/graphql-type-uri\"","webpack://@common-stack/graphql-api/external commonjs \"@common-stack/server-core\"","webpack://@common-stack/graphql-api/external commonjs \"graphql\"","webpack://@common-stack/graphql-api/external commonjs \"graphql-iso-date\"","webpack://@common-stack/graphql-api/external commonjs \"graphql-type-json\"","webpack://@common-stack/graphql-api/external commonjs \"graphql/language\"","webpack://@common-stack/graphql-api/webpack/bootstrap","webpack://@common-stack/graphql-api/webpack/runtime/compat get default export","webpack://@common-stack/graphql-api/webpack/runtime/define property getters","webpack://@common-stack/graphql-api/webpack/runtime/hasOwnProperty shorthand","webpack://@common-stack/graphql-api/webpack/runtime/make namespace object","webpack://@common-stack/graphql-api/./src/index.ts"],"sourcesContent":["export default \"scalar AnyObject\\nscalar Date\\nscalar Time\\nscalar DateTime\\nscalar Timestamp\\nscalar URI\\nscalar URIInput\\nscalar Observable\\nscalar JSON\\nscalar JSONObject\\n\\ndirective @cacheControl(maxAge: Int, scope: CacheControlScope) on FIELD_DEFINITION | OBJECT | INTERFACE\\nenum CacheControlScope {\\n PUBLIC\\n PRIVATE\\n}\\n\\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}\\n\\ntype Mutation {\\n dummy: Int\\n}\\n\\ntype Subscription {\\n dummy: Int\\n}\\n\\n\\ntype AdminIdeSettings {\\n dummy: Int\\n}\\n\\n\\\"\\\"\\\" All Moleculer Topic names are extended from this.\\\"\\\"\\\"\\nenum MoleculerServiceName {\\n dummy\\n}\\n\\n#interface Node {\\n# id: ID!\\n#}\\n\\n\\nschema {\\n query: Query\\n mutation: Mutation\\n subscription: Subscription\\n}\\n\\n\";","import rootSchema from './root-schema.graphqls';\n\nexport const schema = [rootSchema];\n","export * from './graphql';\nexport * from './resolvers';\n","import GraphQLJSON, { GraphQLJSONObject } from 'graphql-type-json';\nimport { GraphQLDate, GraphQLTime, GraphQLDateTime } from 'graphql-iso-date';\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 resolverFunc = (options) => resolvers;","// 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 => {\n return value;\n },\n parseValue: value => {\n return value;\n },\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\n","import { Kind } from 'graphql/language';\nimport { GraphQLScalarType } from 'graphql';\n\n\n// source from https://gist.github.com/langpavel/b30f3d507a47713b0c6e89016e4e9eb7\nfunction serializeDate(value) {\n if (value instanceof Date) {\n return value.getTime();\n } else if (typeof value === 'number') {\n return Math.trunc(value);\n } else 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 } else 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;","export * from './AnyObject';\n","import { TypePolicies } from '@apollo/client';\n\ninterface QueryOptionsInterface {\n name: string,\n keyArgs?: (string[] | string)[]\n skipKey?: string,\n limitKey?: string,\n}\n\n\nexport const DEFAULT_SKIP = 0;\nexport const DEFAULT_LIMIT = 10;\n\nexport const cachePaginatedQueriesFactory = (queries: (string | QueryOptionsInterface)[]): TypePolicies => {\n return 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}\n","export { cachePaginatedQueriesFactory } from './cache-paginated-queries.factory';\n","module.exports = require(\"@cdmbase/graphql-type-uri\");","module.exports = require(\"@common-stack/server-core\");","module.exports = require(\"graphql\");","module.exports = require(\"graphql-iso-date\");","module.exports = require(\"graphql-type-json\");","module.exports = require(\"graphql/language\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { Feature } from '@common-stack/server-core';\nimport { schema, resolvers, resolverFunc } from './api';\n\nexport { resolvers };\nexport { schema as rootSchemaDef };\nexport * from './scalars';\nexport * from './utils';\n\n\nexport default new Feature({\n schema,\n createResolversFunc: resolverFunc,\n})"],"names":[],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;AAAA,iEAAe,4NAA4N,iEAAiE,mIAAmI,8FAA8F,0EAA0E,qDAAqD,qBAAqB,yCAAyC,eAAe,6CAA6C,kBAAkB,uBAAuB,gBAAgB,mFAAmF,mBAAmB,mBAAmB,uBAAuB,mBAAmB,6BAA6B,mBAAmB,+FAA+F,cAAc,qBAAqB,oBAAoB,cAAc,6EAA6E,KAAK;;;;;;;;;;;;;;;ACAxtC;AAEzC,MAAM,MAAM,GAAG,CAAC,6DAAU,CAAC,CAAC;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EAAE,MAAM,EAAE,CAAC;gBACzC,CAAC;gBACD,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE;oBACnB,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;oBAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;oBAChD,MAAM,IAAI,GAAG,QAAQ,EAAE,IAAI,IAAI,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,KAAK,CAAC,CAAC;oBACzE,OAAO;wBACH,GAAG,QAAQ;wBACX,IAAI;qBACP;gBACL,CAAC;aACJ;SACJ;IACL,CAAC,EAAE,EAAE,CAAC;AACV,CAAC;;;;;;;;;;;;;;;;AC3CgF;;;;;;;;;;;ACAjF;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;;;;ACNoD;AACI;AAEnC;AACc;AACT;AACF;AAGxB,iEAAe,IAAI,8DAAO,CAAC;IACvB,MAAM;IACN,mBAAmB,EAAE,8CAAY;CACpC,CAAC","sources":["webpack://@common-stack/graphql-api/./src/api/graphql/root-schema.graphqls","webpack://@common-stack/graphql-api/./src/api/graphql/index.ts","webpack://@common-stack/graphql-api/./src/api/index.ts","webpack://@common-stack/graphql-api/./src/api/resolvers.ts","webpack://@common-stack/graphql-api/./src/scalars/AnyObject.ts","webpack://@common-stack/graphql-api/./src/scalars/GraphQLTimestamp.ts","webpack://@common-stack/graphql-api/./src/scalars/index.ts","webpack://@common-stack/graphql-api/./src/utils/cache-paginated-queries.factory.ts","webpack://@common-stack/graphql-api/./src/utils/index.ts","webpack://@common-stack/graphql-api/external commonjs \"@cdmbase/graphql-type-uri\"","webpack://@common-stack/graphql-api/external commonjs \"@common-stack/server-core\"","webpack://@common-stack/graphql-api/external commonjs \"graphql\"","webpack://@common-stack/graphql-api/external commonjs \"graphql-iso-date\"","webpack://@common-stack/graphql-api/external commonjs \"graphql-type-json\"","webpack://@common-stack/graphql-api/external commonjs \"graphql/language\"","webpack://@common-stack/graphql-api/webpack/bootstrap","webpack://@common-stack/graphql-api/webpack/runtime/compat get default export","webpack://@common-stack/graphql-api/webpack/runtime/define property getters","webpack://@common-stack/graphql-api/webpack/runtime/hasOwnProperty shorthand","webpack://@common-stack/graphql-api/webpack/runtime/make namespace object","webpack://@common-stack/graphql-api/./src/index.ts"],"sourcesContent":["export default \"scalar AnyObject\\nscalar Date\\nscalar Time\\nscalar DateTime\\nscalar Timestamp\\nscalar URI\\nscalar URIInput\\nscalar Observable\\nscalar JSON\\nscalar JSONObject\\n\\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}\\n\\ntype Mutation {\\n dummy: Int\\n}\\n\\ntype Subscription {\\n dummy: Int\\n}\\n\\n\\ntype AdminIdeSettings {\\n dummy: Int\\n}\\n\\n\\\"\\\"\\\" All Moleculer Topic names are extended from this.\\\"\\\"\\\"\\nenum MoleculerServiceName {\\n dummy\\n}\\n\\n#interface Node {\\n# id: ID!\\n#}\\n\\n\\nschema {\\n query: Query\\n mutation: Mutation\\n subscription: Subscription\\n}\\n\\n\";","import rootSchema from './root-schema.graphqls';\n\nexport const schema = [rootSchema];\n","export * from './graphql';\nexport * from './resolvers';\n","import GraphQLJSON, { GraphQLJSONObject } from 'graphql-type-json';\nimport { GraphQLDate, GraphQLTime, GraphQLDateTime } from 'graphql-iso-date';\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 resolverFunc = (options) => resolvers;","// 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 => {\n return value;\n },\n parseValue: value => {\n return value;\n },\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\n","import { Kind } from 'graphql/language';\nimport { GraphQLScalarType } from 'graphql';\n\n\n// source from https://gist.github.com/langpavel/b30f3d507a47713b0c6e89016e4e9eb7\nfunction serializeDate(value) {\n if (value instanceof Date) {\n return value.getTime();\n } else if (typeof value === 'number') {\n return Math.trunc(value);\n } else 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 } else 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;","export * from './AnyObject';\n","import { TypePolicies } from '@apollo/client';\n\ninterface QueryOptionsInterface {\n name: string,\n keyArgs?: (string[] | string)[]\n skipKey?: string,\n limitKey?: string,\n}\n\n\nexport const DEFAULT_SKIP = 0;\nexport const DEFAULT_LIMIT = 10;\n\nexport const cachePaginatedQueriesFactory = (queries: (string | QueryOptionsInterface)[]): TypePolicies => {\n return 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}\n","export { cachePaginatedQueriesFactory } from './cache-paginated-queries.factory';\n","module.exports = require(\"@cdmbase/graphql-type-uri\");","module.exports = require(\"@common-stack/server-core\");","module.exports = require(\"graphql\");","module.exports = require(\"graphql-iso-date\");","module.exports = require(\"graphql-type-json\");","module.exports = require(\"graphql/language\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { Feature } from '@common-stack/server-core';\nimport { schema, resolvers, resolverFunc } from './api';\n\nexport { resolvers };\nexport { schema as rootSchemaDef };\nexport * from './scalars';\nexport * from './utils';\n\n\nexport default new Feature({\n schema,\n createResolversFunc: resolverFunc,\n})"],"names":[],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@common-stack/graphql-api",
|
|
3
|
-
"version": "6.0.6-alpha.
|
|
3
|
+
"version": "6.0.6-alpha.58",
|
|
4
4
|
"description": "graphql api for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@cdm-logger/core": ">=7.0.12",
|
|
30
|
-
"@common-stack/server-core": "6.0.6-alpha.
|
|
30
|
+
"@common-stack/server-core": "6.0.6-alpha.50",
|
|
31
31
|
"lodash": "^4.17.21"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"typescript": {
|
|
37
37
|
"definition": "lib/index.d.ts"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "14e414617883209533985a494da7db7352ec4f91"
|
|
40
40
|
}
|