UNPKG

899 kBSource Map (JSON)View Raw
1{"version":3,"file":"bundle.umd.js","sources":["../../../node_modules/tslib/tslib.es6.js","../../apollo-client/src/core/networkStatus.ts","../../apollo-client/node_modules/zen-observable-ts/src/zenObservable.ts","../../apollo-client/node_modules/apollo-link/src/linkUtils.ts","../../apollo-client/node_modules/apollo-link/src/link.ts","../../apollo-client/src/util/Observable.ts","../../apollo-client/src/errors/ApolloError.ts","../../apollo-client/src/core/types.ts","../../apollo-client/src/core/ObservableQuery.ts","../../apollo-client/node_modules/apollo-link-dedup/src/dedupLink.ts","../../apollo-client/src/data/mutations.ts","../../apollo-client/src/data/queries.ts","../../apollo-client/src/core/QueryManager.ts","../../apollo-client/src/data/store.ts","../../apollo-client/src/version.ts","../../apollo-client/src/ApolloClient.ts","../node_modules/zen-observable-ts/src/zenObservable.ts","../node_modules/apollo-link/src/linkUtils.ts","../node_modules/apollo-link/src/link.ts","../../apollo-cache-inmemory/src/fixPolyfills.ts","../../apollo-cache/src/utils.ts","../../apollo-cache/src/cache.ts","../../apollo-cache-inmemory/src/fragmentMatcher.ts","../../apollo-cache-inmemory/src/cacheKeys.ts","../../apollo-cache-inmemory/src/depTrackingCache.ts","../../apollo-cache-inmemory/src/readFromStore.ts","../../apollo-cache-inmemory/src/objectCache.ts","../../apollo-cache-inmemory/src/writeToStore.ts","../../apollo-cache-inmemory/src/inMemoryCache.ts","../node_modules/apollo-link-http-common/src/index.ts","../node_modules/apollo-link-http/src/httpLink.ts","../../../node_modules/graphql/jsutils/defineToJSON.mjs","../../../node_modules/graphql/jsutils/defineToStringTag.mjs","../../../node_modules/graphql/jsutils/instanceOf.mjs","../../../node_modules/graphql/jsutils/inspect.mjs","../../../node_modules/graphql/jsutils/invariant.mjs","../../../node_modules/graphql/jsutils/keyMap.mjs","../../../node_modules/graphql/language/kinds.mjs","../../../node_modules/graphql/jsutils/keyValMap.mjs","../../../node_modules/graphql/jsutils/isInvalid.mjs","../../../node_modules/graphql/utilities/valueFromASTUntyped.mjs","../../../node_modules/graphql/type/definition.mjs","../../../node_modules/graphql/jsutils/isFinite.mjs","../../../node_modules/graphql/jsutils/isInteger.mjs","../../../node_modules/graphql/type/scalars.mjs","../../../node_modules/graphql/language/directiveLocation.mjs","../../../node_modules/graphql/type/directives.mjs","../../../node_modules/graphql/jsutils/objectValues.mjs","../../../node_modules/iterall/index.mjs","../../../node_modules/graphql/jsutils/isNullish.mjs","../../../node_modules/graphql/utilities/astFromValue.mjs","../../../node_modules/graphql/language/visitor.mjs","../../../node_modules/graphql/language/printer.mjs","../../../node_modules/graphql/type/introspection.mjs","../../../node_modules/graphql/jsutils/find.mjs","../../../node_modules/graphql/type/schema.mjs","../../../node_modules/graphql/language/location.mjs","../../../node_modules/graphql/error/printError.mjs","../../../node_modules/graphql/error/GraphQLError.mjs","../../../node_modules/graphql/utilities/assertValidName.mjs","../../../node_modules/graphql/utilities/typeComparators.mjs","../../../node_modules/graphql/language/source.mjs","../../../node_modules/graphql/error/syntaxError.mjs","../../../node_modules/graphql/error/locatedError.mjs","../../../node_modules/graphql/error/formatError.mjs","../../../node_modules/graphql/error/index.mjs","../../../node_modules/graphql/language/blockStringValue.mjs","../../../node_modules/graphql/language/lexer.mjs","../../../node_modules/graphql/language/parser.mjs","../../../node_modules/graphql/utilities/typeFromAST.mjs","../../../node_modules/graphql/utilities/TypeInfo.mjs","../../../node_modules/graphql/language/predicates.mjs","../../../node_modules/graphql/validation/rules/ExecutableDefinitions.mjs","../../../node_modules/graphql/validation/rules/UniqueOperationNames.mjs","../../../node_modules/graphql/validation/rules/LoneAnonymousOperation.mjs","../../../node_modules/graphql/validation/rules/SingleFieldSubscriptions.mjs","../../../node_modules/graphql/jsutils/suggestionList.mjs","../../../node_modules/graphql/jsutils/orList.mjs","../../../node_modules/graphql/jsutils/quotedOrList.mjs","../../../node_modules/graphql/validation/rules/KnownTypeNames.mjs","../../../node_modules/graphql/validation/rules/FragmentsOnCompositeTypes.mjs","../../../node_modules/graphql/validation/rules/VariablesAreInputTypes.mjs","../../../node_modules/graphql/validation/rules/ScalarLeafs.mjs","../../../node_modules/graphql/validation/rules/FieldsOnCorrectType.mjs","../../../node_modules/graphql/validation/rules/UniqueFragmentNames.mjs","../../../node_modules/graphql/validation/rules/KnownFragmentNames.mjs","../../../node_modules/graphql/validation/rules/NoUnusedFragments.mjs","../../../node_modules/graphql/validation/rules/PossibleFragmentSpreads.mjs","../../../node_modules/graphql/validation/rules/NoFragmentCycles.mjs","../../../node_modules/graphql/validation/rules/UniqueVariableNames.mjs","../../../node_modules/graphql/validation/rules/NoUndefinedVariables.mjs","../../../node_modules/graphql/validation/rules/NoUnusedVariables.mjs","../../../node_modules/graphql/validation/rules/KnownDirectives.mjs","../../../node_modules/graphql/validation/rules/UniqueDirectivesPerLocation.mjs","../../../node_modules/graphql/validation/rules/UniqueArgumentNames.mjs","../../../node_modules/graphql/validation/rules/ValuesOfCorrectType.mjs","../../../node_modules/graphql/validation/rules/VariablesInAllowedPosition.mjs","../../../node_modules/graphql/validation/rules/UniqueInputFieldNames.mjs","../../../node_modules/graphql/validation/rules/LoneSchemaDefinition.mjs","../../../node_modules/graphql/validation/specifiedRules.mjs","../../../node_modules/graphql/validation/ValidationContext.mjs","../../../node_modules/graphql/validation/validate.mjs","../../../node_modules/graphql/jsutils/isPromise.mjs","../../../node_modules/graphql/jsutils/memoize3.mjs","../../../node_modules/graphql/jsutils/promiseForObject.mjs","../../../node_modules/graphql/jsutils/promiseReduce.mjs","../../../node_modules/graphql/utilities/getOperationRootType.mjs","../../../node_modules/graphql/utilities/valueFromAST.mjs","../../../node_modules/graphql/execution/values.mjs","../../../node_modules/graphql/graphql.mjs","../../../node_modules/graphql/type/index.mjs","../../../node_modules/graphql/language/index.mjs","../../../node_modules/graphql/execution/index.mjs","../../../node_modules/graphql/subscription/subscribe.mjs","../../../node_modules/graphql/subscription/index.mjs","../../../node_modules/graphql/validation/index.mjs","../../../node_modules/graphql/utilities/introspectionQuery.mjs","../../../node_modules/graphql/utilities/getOperationAST.mjs","../../../node_modules/graphql/utilities/introspectionFromSchema.mjs","../../../node_modules/graphql/utilities/buildClientSchema.mjs","../../../node_modules/graphql/utilities/schemaPrinter.mjs","../../../node_modules/graphql/utilities/isValidJSValue.mjs","../../../node_modules/graphql/utilities/isValidLiteralValue.mjs","../../../node_modules/graphql/utilities/concatAST.mjs","../../../node_modules/graphql/utilities/separateOperations.mjs","../../../node_modules/graphql/utilities/findBreakingChanges.mjs","../../../node_modules/graphql/utilities/findDeprecatedUsages.mjs","../../../node_modules/graphql/utilities/index.mjs","../../../node_modules/graphql/index.mjs","../node_modules/apollo-link-state/src/utils.ts","../node_modules/apollo-link-state/src/index.ts","../node_modules/apollo-link-error/src/index.ts","../src/index.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","/**\n * The current status of a query’s execution in our system.\n */\nexport enum NetworkStatus {\n /**\n * The query has never been run before and the query is now currently running. A query will still\n * have this network status even if a partial data result was returned from the cache, but a\n * query was dispatched anyway.\n */\n loading = 1,\n\n /**\n * If `setVariables` was called and a query was fired because of that then the network status\n * will be `setVariables` until the result of that query comes back.\n */\n setVariables = 2,\n\n /**\n * Indicates that `fetchMore` was called on this query and that the query created is currently in\n * flight.\n */\n fetchMore = 3,\n\n /**\n * Similar to the `setVariables` network status. It means that `refetch` was called on a query\n * and the refetch request is currently in flight.\n */\n refetch = 4,\n\n /**\n * Indicates that a polling query is currently in flight. So for example if you are polling a\n * query every 10 seconds then the network status will switch to `poll` every 10 seconds whenever\n * a poll request has been sent but not resolved.\n */\n poll = 6,\n\n /**\n * No request is in flight for this query, and no errors happened. Everything is OK.\n */\n ready = 7,\n\n /**\n * No request is in flight for this query, but one or more errors were detected.\n */\n error = 8,\n}\n\n/**\n * Returns true if there is currently a network request in flight according to a given network\n * status.\n */\nexport function isNetworkRequestInFlight(\n networkStatus: NetworkStatus,\n): boolean {\n return networkStatus < 7;\n}\n","/* tslint:disable */\n\nimport zenObservable from 'zen-observable';\n\nnamespace Observable {\n\n}\n\nimport { ZenObservable } from './types';\n\nexport { ZenObservable };\n\nexport type Observer<T> = ZenObservable.Observer<T>;\nexport type Subscriber<T> = ZenObservable.Subscriber<T>;\nexport type ObservableLike<T> = ZenObservable.ObservableLike<T>;\n\nexport const Observable: {\n new <T>(subscriber: Subscriber<T>): Observable<T>;\n from<R>(\n observable: Observable<R> | ZenObservable.ObservableLike<R> | ArrayLike<R>,\n ): Observable<R>;\n of<R>(...args: Array<R>): Observable<R>;\n} = <any>zenObservable;\n\nexport interface Observable<T> {\n subscribe(\n observerOrNext: ((value: T) => void) | ZenObservable.Observer<T>,\n error?: (error: any) => void,\n complete?: () => void,\n ): ZenObservable.Subscription;\n\n forEach(fn: (value: T) => void): Promise<void>;\n\n map<R>(fn: (value: T) => R): Observable<R>;\n\n filter(fn: (value: T) => boolean): Observable<T>;\n\n reduce<R = T>(\n fn: (previousValue: R | T, currentValue: T) => R | T,\n initialValue?: R | T,\n ): Observable<R | T>;\n\n flatMap<R>(fn: (value: T) => ZenObservable.ObservableLike<R>): Observable<R>;\n\n from<R>(\n observable: Observable<R> | ZenObservable.ObservableLike<R> | ArrayLike<R>,\n ): Observable<R>;\n of<R>(...args: Array<R>): Observable<R>;\n}\n","import { getOperationName } from 'apollo-utilities';\nimport Observable from 'zen-observable-ts';\nimport { print } from 'graphql/language/printer';\n\nimport { GraphQLRequest, Operation } from './types';\nimport { ApolloLink } from './link';\n\nexport function validateOperation(operation: GraphQLRequest): GraphQLRequest {\n const OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (let key of Object.keys(operation)) {\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw new Error(`illegal argument: ${key}`);\n }\n }\n\n return operation;\n}\n\nexport class LinkError extends Error {\n public link: ApolloLink;\n constructor(message?: string, link?: ApolloLink) {\n super(message);\n this.link = link;\n }\n}\n\nexport function isTerminating(link: ApolloLink): boolean {\n return link.request.length <= 1;\n}\n\nexport function toPromise<R>(observable: Observable<R>): Promise<R> {\n let completed = false;\n return new Promise<R>((resolve, reject) => {\n observable.subscribe({\n next: data => {\n if (completed) {\n console.warn(\n `Promise Wrapper does not support multiple results from Observable`,\n );\n } else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\n\n// backwards compat\nexport const makePromise = toPromise;\n\nexport function fromPromise<T>(promise: Promise<T>): Observable<T> {\n return new Observable<T>(observer => {\n promise\n .then((value: T) => {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\n\nexport function fromError<T>(errorValue: any): Observable<T> {\n return new Observable<T>(observer => {\n observer.error(errorValue);\n });\n}\n\nexport function transformOperation(operation: GraphQLRequest): GraphQLRequest {\n const transformedOperation: GraphQLRequest = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n\n // best guess at an operation name\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query)\n : '';\n }\n\n return transformedOperation as Operation;\n}\n\nexport function createOperation(\n starting: any,\n operation: GraphQLRequest,\n): Operation {\n let context = { ...starting };\n const setContext = next => {\n if (typeof next === 'function') {\n context = { ...context, ...next(context) };\n } else {\n context = { ...context, ...next };\n }\n };\n const getContext = () => ({ ...context });\n\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n\n Object.defineProperty(operation, 'toKey', {\n enumerable: false,\n value: () => getKey(operation),\n });\n\n return operation as Operation;\n}\n\nexport function getKey(operation: GraphQLRequest) {\n // XXX we're assuming here that variables will be serialized in the same order.\n // that might not always be true\n return `${print(operation.query)}|${JSON.stringify(operation.variables)}|${\n operation.operationName\n }`;\n}\n","import Observable from 'zen-observable-ts';\n\nimport {\n GraphQLRequest,\n NextLink,\n Operation,\n RequestHandler,\n FetchResult,\n} from './types';\n\nimport {\n validateOperation,\n isTerminating,\n LinkError,\n transformOperation,\n createOperation,\n} from './linkUtils';\n\nconst passthrough = (op, forward) => (forward ? forward(op) : Observable.of());\n\nconst toLink = (handler: RequestHandler | ApolloLink) =>\n typeof handler === 'function' ? new ApolloLink(handler) : handler;\n\nexport const empty = (): ApolloLink =>\n new ApolloLink((op, forward) => Observable.of());\n\nexport const from = (links: ApolloLink[]): ApolloLink => {\n if (links.length === 0) return empty();\n\n return links.map(toLink).reduce((x, y) => x.concat(y));\n};\n\nexport const split = (\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right: ApolloLink | RequestHandler = new ApolloLink(passthrough),\n): ApolloLink => {\n const leftLink = toLink(left);\n const rightLink = toLink(right);\n\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(operation => {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n } else {\n return new ApolloLink((operation, forward) => {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n};\n\n// join two Links together\nexport const concat = (\n first: ApolloLink | RequestHandler,\n second: ApolloLink | RequestHandler,\n) => {\n const firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n console.warn(\n new LinkError(\n `You are calling concat on a terminating link, which will have no effect`,\n firstLink,\n ),\n );\n return firstLink;\n }\n const nextLink = toLink(second);\n\n if (isTerminating(nextLink)) {\n return new ApolloLink(\n operation =>\n firstLink.request(\n operation,\n op => nextLink.request(op) || Observable.of(),\n ) || Observable.of(),\n );\n } else {\n return new ApolloLink((operation, forward) => {\n return (\n firstLink.request(operation, op => {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of()\n );\n });\n }\n};\n\nexport class ApolloLink {\n public static empty = empty;\n public static from = from;\n public static split = split;\n public static execute = execute;\n\n constructor(request?: RequestHandler) {\n if (request) this.request = request;\n }\n\n public split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right: ApolloLink | RequestHandler = new ApolloLink(passthrough),\n ): ApolloLink {\n return this.concat(split(test, left, right));\n }\n\n public concat(next: ApolloLink | RequestHandler): ApolloLink {\n return concat(this, next);\n }\n\n public request(\n operation: Operation,\n forward?: NextLink,\n ): Observable<FetchResult> | null {\n throw new Error('request is not implemented');\n }\n}\n\nexport function execute(\n link: ApolloLink,\n operation: GraphQLRequest,\n): Observable<FetchResult> {\n return (\n link.request(\n createOperation(\n operation.context,\n transformOperation(validateOperation(operation)),\n ),\n ) || Observable.of()\n );\n}\n","// This simplified polyfill attempts to follow the ECMAScript Observable proposal.\n// See https://github.com/zenparsing/es-observable\nimport { Observable as LinkObservable } from 'apollo-link';\n\nexport type Subscription = ZenObservable.Subscription;\nexport type Observer<T> = ZenObservable.Observer<T>;\n\nimport $$observable from 'symbol-observable';\n\n// rxjs interopt\nexport class Observable<T> extends LinkObservable<T> {\n public [$$observable]() {\n return this;\n }\n\n public ['@@observable' as any]() {\n return this;\n }\n}\n","import { GraphQLError } from 'graphql';\n\nexport function isApolloError(err: Error): err is ApolloError {\n return err.hasOwnProperty('graphQLErrors');\n}\n\n// Sets the error message on this error according to the\n// the GraphQL and network errors that are present.\n// If the error message has already been set through the\n// constructor or otherwise, this function is a nop.\nconst generateErrorMessage = (err: ApolloError) => {\n let message = '';\n // If we have GraphQL errors present, add that to the error message.\n if (Array.isArray(err.graphQLErrors) && err.graphQLErrors.length !== 0) {\n err.graphQLErrors.forEach((graphQLError: GraphQLError) => {\n const errorMessage = graphQLError\n ? graphQLError.message\n : 'Error message not found.';\n message += `GraphQL error: ${errorMessage}\\n`;\n });\n }\n\n if (err.networkError) {\n message += 'Network error: ' + err.networkError.message + '\\n';\n }\n\n // strip newline from the end of the message\n message = message.replace(/\\n$/, '');\n return message;\n};\n\nexport class ApolloError extends Error {\n public message: string;\n public graphQLErrors: ReadonlyArray<GraphQLError>;\n public networkError: Error | null;\n\n // An object that can be used to provide some additional information\n // about an error, e.g. specifying the type of error this is. Used\n // internally within Apollo Client.\n public extraInfo: any;\n\n // Constructs an instance of ApolloError given a GraphQLError\n // or a network error. Note that one of these has to be a valid\n // value or the constructed error will be meaningless.\n constructor({\n graphQLErrors,\n networkError,\n errorMessage,\n extraInfo,\n }: {\n graphQLErrors?: ReadonlyArray<GraphQLError>;\n networkError?: Error | null;\n errorMessage?: string;\n extraInfo?: any;\n }) {\n super(errorMessage);\n this.graphQLErrors = graphQLErrors || [];\n this.networkError = networkError || null;\n\n if (!errorMessage) {\n this.message = generateErrorMessage(this);\n } else {\n this.message = errorMessage;\n }\n\n this.extraInfo = extraInfo;\n\n // We're not using `Object.setPrototypeOf` here as it isn't fully\n // supported on Android (see issue #3236).\n (this as any).__proto__ = ApolloError.prototype;\n }\n}\n","import { DocumentNode, GraphQLError } from 'graphql';\nimport { QueryStoreValue } from '../data/queries';\nimport { NetworkStatus } from './networkStatus';\nimport { FetchResult } from 'apollo-link';\n\nexport type QueryListener = (\n queryStoreValue: QueryStoreValue,\n newData?: any,\n) => void;\n\nexport type OperationVariables = { [key: string]: any };\n\nexport type PureQueryOptions = {\n query: DocumentNode;\n variables?: { [key: string]: any };\n context?: any;\n};\n\nexport type ApolloQueryResult<T> = {\n data: T;\n errors?: ReadonlyArray<GraphQLError>;\n loading: boolean;\n networkStatus: NetworkStatus;\n stale: boolean;\n};\n\nexport enum FetchType {\n normal = 1,\n refetch = 2,\n poll = 3,\n}\n\n// This is part of the public API, people write these functions in `updateQueries`.\nexport type MutationQueryReducer<T> = (\n previousResult: Record<string, any>,\n options: {\n mutationResult: FetchResult<T>;\n queryName: string | undefined;\n queryVariables: Record<string, any>;\n },\n) => Record<string, any>;\n\nexport type MutationQueryReducersMap<T = { [key: string]: any }> = {\n [queryName: string]: MutationQueryReducer<T>;\n};\n","import { isEqual, tryFunctionOrLogError, cloneDeep } from 'apollo-utilities';\nimport { GraphQLError } from 'graphql';\nimport { NetworkStatus, isNetworkRequestInFlight } from './networkStatus';\nimport { Observable, Observer, Subscription } from '../util/Observable';\nimport { ApolloError } from '../errors/ApolloError';\nimport { QueryManager } from './QueryManager';\nimport { ApolloQueryResult, FetchType, OperationVariables } from './types';\nimport {\n ModifiableWatchQueryOptions,\n WatchQueryOptions,\n FetchMoreQueryOptions,\n SubscribeToMoreOptions,\n ErrorPolicy,\n UpdateQueryFn,\n} from './watchQueryOptions';\n\nimport { QueryStoreValue } from '../data/queries';\n\nexport type ApolloCurrentResult<T> = {\n data: T | {};\n errors?: ReadonlyArray<GraphQLError>;\n loading: boolean;\n networkStatus: NetworkStatus;\n error?: ApolloError;\n partial?: boolean;\n};\n\nexport interface FetchMoreOptions<\n TData = any,\n TVariables = OperationVariables\n> {\n updateQuery: (\n previousQueryResult: TData,\n options: {\n fetchMoreResult?: TData;\n variables?: TVariables;\n },\n ) => TData;\n}\n\nexport interface UpdateQueryOptions<TVariables> {\n variables?: TVariables;\n}\n\nexport const hasError = (\n storeValue: QueryStoreValue,\n policy: ErrorPolicy = 'none',\n) =>\n storeValue &&\n ((storeValue.graphQLErrors &&\n storeValue.graphQLErrors.length > 0 &&\n policy === 'none') ||\n storeValue.networkError);\n\nexport class ObservableQuery<\n TData = any,\n TVariables = OperationVariables\n> extends Observable<ApolloQueryResult<TData>> {\n public options: WatchQueryOptions<TVariables>;\n public queryId: string;\n /**\n *\n * The current value of the variables for this query. Can change.\n */\n public variables: TVariables;\n\n private shouldSubscribe: boolean;\n private isTornDown: boolean;\n private queryManager: QueryManager<any>;\n private observers: Observer<ApolloQueryResult<TData>>[];\n private subscriptionHandles: Subscription[];\n\n private lastResult: ApolloQueryResult<TData>;\n private lastResultSnapshot: ApolloQueryResult<TData>;\n private lastError: ApolloError;\n\n constructor({\n queryManager,\n options,\n shouldSubscribe = true,\n }: {\n queryManager: QueryManager<any>;\n options: WatchQueryOptions<TVariables>;\n shouldSubscribe?: boolean;\n }) {\n super((observer: Observer<ApolloQueryResult<TData>>) =>\n this.onSubscribe(observer),\n );\n\n // active state\n this.isTornDown = false;\n\n // query information\n this.options = options;\n this.variables = options.variables || ({} as TVariables);\n this.queryId = queryManager.generateQueryId();\n this.shouldSubscribe = shouldSubscribe;\n\n // related classes\n this.queryManager = queryManager;\n\n // interal data stores\n this.observers = [];\n this.subscriptionHandles = [];\n }\n\n public result(): Promise<ApolloQueryResult<TData>> {\n const that = this;\n return new Promise((resolve, reject) => {\n let subscription: Subscription;\n const observer: Observer<ApolloQueryResult<TData>> = {\n next(result: ApolloQueryResult<TData>) {\n resolve(result);\n\n // Stop the query within the QueryManager if we can before\n // this function returns.\n //\n // We do this in order to prevent observers piling up within\n // the QueryManager. Notice that we only fully unsubscribe\n // from the subscription in a setTimeout(..., 0) call. This call can\n // actually be handled by the browser at a much later time. If queries\n // are fired in the meantime, observers that should have been removed\n // from the QueryManager will continue to fire, causing an unnecessary\n // performance hit.\n if (!that.observers.some(obs => obs !== observer)) {\n that.queryManager.removeQuery(that.queryId);\n }\n\n setTimeout(() => {\n subscription.unsubscribe();\n }, 0);\n },\n error(error: any) {\n reject(error);\n },\n };\n subscription = that.subscribe(observer);\n });\n }\n\n /**\n * Return the result of the query from the local cache as well as some fetching status\n * `loading` and `networkStatus` allow to know if a request is in flight\n * `partial` lets you know if the result from the local cache is complete or partial\n * @return {data: Object, error: ApolloError, loading: boolean, networkStatus: number, partial: boolean}\n */\n public currentResult(): ApolloCurrentResult<TData> {\n if (this.isTornDown) {\n return {\n data: this.lastError ? {} : this.lastResult ? this.lastResult.data : {},\n error: this.lastError,\n loading: false,\n networkStatus: NetworkStatus.error,\n };\n }\n\n const queryStoreValue = this.queryManager.queryStore.get(this.queryId);\n\n if (hasError(queryStoreValue, this.options.errorPolicy)) {\n return {\n data: {},\n loading: false,\n networkStatus: queryStoreValue.networkStatus,\n error: new ApolloError({\n graphQLErrors: queryStoreValue.graphQLErrors,\n networkError: queryStoreValue.networkError,\n }),\n };\n }\n\n const { data, partial } = this.queryManager.getCurrentQueryResult(this);\n\n const queryLoading =\n !queryStoreValue ||\n queryStoreValue.networkStatus === NetworkStatus.loading;\n\n // We need to be careful about the loading state we show to the user, to try\n // and be vaguely in line with what the user would have seen from .subscribe()\n // but to still provide useful information synchronously when the query\n // will not end up hitting the server.\n // See more: https://github.com/apollostack/apollo-client/issues/707\n // Basically: is there a query in flight right now (modolo the next tick)?\n const loading =\n (this.options.fetchPolicy === 'network-only' && queryLoading) ||\n (partial && this.options.fetchPolicy !== 'cache-only');\n\n // if there is nothing in the query store, it means this query hasn't fired yet or it has been cleaned up. Therefore the\n // network status is dependent on queryLoading.\n let networkStatus: NetworkStatus;\n if (queryStoreValue) {\n networkStatus = queryStoreValue.networkStatus;\n } else {\n networkStatus = loading ? NetworkStatus.loading : NetworkStatus.ready;\n }\n\n const result = {\n data,\n loading: isNetworkRequestInFlight(networkStatus),\n networkStatus,\n } as ApolloQueryResult<TData>;\n\n if (\n queryStoreValue &&\n queryStoreValue.graphQLErrors &&\n this.options.errorPolicy === 'all'\n ) {\n result.errors = queryStoreValue.graphQLErrors;\n }\n\n if (!partial) {\n this.lastResult = { ...result, stale: false };\n this.lastResultSnapshot = cloneDeep(this.lastResult);\n }\n\n return { ...result, partial } as ApolloCurrentResult<TData>;\n }\n\n // Compares newResult to the snapshot we took of this.lastResult when it was\n // first received.\n public isDifferentFromLastResult(newResult: ApolloQueryResult<TData>) {\n const { lastResultSnapshot: snapshot } = this;\n return !(\n snapshot &&\n newResult &&\n snapshot.networkStatus === newResult.networkStatus &&\n snapshot.stale === newResult.stale &&\n isEqual(snapshot.data, newResult.data)\n );\n }\n\n // Returns the last result that observer.next was called with. This is not the same as\n // currentResult! If you're not sure which you need, then you probably need currentResult.\n public getLastResult(): ApolloQueryResult<TData> {\n return this.lastResult;\n }\n\n public getLastError(): ApolloError {\n return this.lastError;\n }\n\n public resetLastResults(): void {\n delete this.lastResult;\n delete this.lastResultSnapshot;\n delete this.lastError;\n this.isTornDown = false;\n }\n\n /**\n * Update the variables of this observable query, and fetch the new results.\n * This method should be preferred over `setVariables` in most use cases.\n *\n * @param variables: The new set of variables. If there are missing variables,\n * the previous values of those variables will be used.\n */\n public refetch(variables?: TVariables): Promise<ApolloQueryResult<TData>> {\n const { fetchPolicy } = this.options;\n // early return if trying to read from cache during refetch\n if (fetchPolicy === 'cache-only') {\n return Promise.reject(\n new Error(\n 'cache-only fetchPolicy option should not be used together with query refetch.',\n ),\n );\n }\n\n if (!isEqual(this.variables, variables)) {\n // update observable variables\n this.variables = Object.assign({}, this.variables, variables);\n }\n\n if (!isEqual(this.options.variables, this.variables)) {\n // Update the existing options with new variables\n this.options.variables = Object.assign(\n {},\n this.options.variables,\n this.variables,\n );\n }\n\n // Override fetchPolicy for this call only\n // only network-only and no-cache are safe to use\n const isNetworkFetchPolicy =\n fetchPolicy === 'network-only' || fetchPolicy === 'no-cache';\n\n const combinedOptions: WatchQueryOptions = {\n ...this.options,\n fetchPolicy: isNetworkFetchPolicy ? fetchPolicy : 'network-only',\n };\n\n return this.queryManager\n .fetchQuery(this.queryId, combinedOptions, FetchType.refetch)\n .then(result => result as ApolloQueryResult<TData>);\n }\n\n public fetchMore<K extends keyof TVariables>(\n fetchMoreOptions: FetchMoreQueryOptions<TVariables, K> &\n FetchMoreOptions<TData, TVariables>,\n ): Promise<ApolloQueryResult<TData>> {\n // early return if no update Query\n if (!fetchMoreOptions.updateQuery) {\n throw new Error(\n 'updateQuery option is required. This function defines how to update the query data with the new results.',\n );\n }\n\n let combinedOptions: any;\n\n return Promise.resolve()\n .then(() => {\n const qid = this.queryManager.generateQueryId();\n\n if (fetchMoreOptions.query) {\n // fetch a new query\n combinedOptions = fetchMoreOptions;\n } else {\n // fetch the same query with a possibly new variables\n combinedOptions = {\n ...this.options,\n ...fetchMoreOptions,\n variables: Object.assign(\n {},\n this.variables,\n fetchMoreOptions.variables,\n ),\n };\n }\n\n combinedOptions.fetchPolicy = 'network-only';\n\n return this.queryManager.fetchQuery(\n qid,\n combinedOptions as WatchQueryOptions,\n FetchType.normal,\n this.queryId,\n );\n })\n .then(fetchMoreResult => {\n this.updateQuery((previousResult: any) =>\n fetchMoreOptions.updateQuery(previousResult, {\n fetchMoreResult: fetchMoreResult.data as TData,\n variables: combinedOptions.variables,\n }),\n );\n\n return fetchMoreResult as ApolloQueryResult<TData>;\n });\n }\n\n // XXX the subscription variables are separate from the query variables.\n // if you want to update subscription variables, right now you have to do that separately,\n // and you can only do it by stopping the subscription and then subscribing again with new variables.\n public subscribeToMore<TSubscriptionData = TData>(\n options: SubscribeToMoreOptions<TData, TVariables, TSubscriptionData>,\n ) {\n const subscription = this.queryManager\n .startGraphQLSubscription({\n query: options.document,\n variables: options.variables,\n })\n .subscribe({\n next: (subscriptionData: { data: TSubscriptionData }) => {\n if (options.updateQuery) {\n this.updateQuery((previous, { variables }) =>\n (options.updateQuery as UpdateQueryFn<\n TData,\n TVariables,\n TSubscriptionData\n >)(previous, {\n subscriptionData,\n variables,\n }),\n );\n }\n },\n error: (err: any) => {\n if (options.onError) {\n options.onError(err);\n return;\n }\n console.error('Unhandled GraphQL subscription error', err);\n },\n });\n\n this.subscriptionHandles.push(subscription);\n\n return () => {\n const i = this.subscriptionHandles.indexOf(subscription);\n if (i >= 0) {\n this.subscriptionHandles.splice(i, 1);\n subscription.unsubscribe();\n }\n };\n }\n\n // Note: if the query is not active (there are no subscribers), the promise\n // will return null immediately.\n public setOptions(\n opts: ModifiableWatchQueryOptions,\n ): Promise<ApolloQueryResult<TData>> {\n const oldOptions = this.options;\n this.options = Object.assign({}, this.options, opts) as WatchQueryOptions<\n TVariables\n >;\n\n if (opts.pollInterval) {\n this.startPolling(opts.pollInterval);\n } else if (opts.pollInterval === 0) {\n this.stopPolling();\n }\n\n // If fetchPolicy went from cache-only to something else, or from something else to network-only\n const tryFetch: boolean =\n (oldOptions.fetchPolicy !== 'network-only' &&\n opts.fetchPolicy === 'network-only') ||\n (oldOptions.fetchPolicy === 'cache-only' &&\n opts.fetchPolicy !== 'cache-only') ||\n (oldOptions.fetchPolicy === 'standby' &&\n opts.fetchPolicy !== 'standby') ||\n false;\n\n return this.setVariables(\n this.options.variables as TVariables,\n tryFetch,\n opts.fetchResults,\n );\n }\n\n /**\n * This is for *internal* use only. Most users should instead use `refetch`\n * in order to be properly notified of results even when they come from cache.\n *\n * Update the variables of this observable query, and fetch the new results\n * if they've changed. If you want to force new results, use `refetch`.\n *\n * Note: the `next` callback will *not* fire if the variables have not changed\n * or if the result is coming from cache.\n *\n * Note: the promise will return the old results immediately if the variables\n * have not changed.\n *\n * Note: the promise will return null immediately if the query is not active\n * (there are no subscribers).\n *\n * @private\n *\n * @param variables: The new set of variables. If there are missing variables,\n * the previous values of those variables will be used.\n *\n * @param tryFetch: Try and fetch new results even if the variables haven't\n * changed (we may still just hit the store, but if there's nothing in there\n * this will refetch)\n *\n * @param fetchResults: Option to ignore fetching results when updating variables\n */\n public setVariables(\n variables: TVariables,\n tryFetch: boolean = false,\n fetchResults = true,\n ): Promise<ApolloQueryResult<TData>> {\n // since setVariables restarts the subscription, we reset the tornDown status\n this.isTornDown = false;\n\n const newVariables = variables ? variables : this.variables;\n\n if (isEqual(newVariables, this.variables) && !tryFetch) {\n // If we have no observers, then we don't actually want to make a network\n // request. As soon as someone observes the query, the request will kick\n // off. For now, we just store any changes. (See #1077)\n if (this.observers.length === 0 || !fetchResults) {\n return new Promise(resolve => resolve());\n }\n return this.result();\n } else {\n this.variables = newVariables;\n this.options.variables = newVariables;\n\n // See comment above\n if (this.observers.length === 0) {\n return new Promise(resolve => resolve());\n }\n\n // Use the same options as before, but with new variables\n return this.queryManager\n .fetchQuery(this.queryId, {\n ...this.options,\n variables: this.variables,\n } as WatchQueryOptions)\n .then(result => result as ApolloQueryResult<TData>);\n }\n }\n\n public updateQuery(\n mapFn: (\n previousQueryResult: TData,\n options: UpdateQueryOptions<TVariables>,\n ) => TData,\n ): void {\n const {\n previousResult,\n variables,\n document,\n } = this.queryManager.getQueryWithPreviousResult(this.queryId);\n\n const newResult = tryFunctionOrLogError(() =>\n mapFn(previousResult, { variables: variables as TVariables }),\n );\n\n if (newResult) {\n this.queryManager.dataStore.markUpdateQueryResult(\n document,\n variables,\n newResult,\n );\n this.queryManager.broadcastQueries();\n }\n }\n\n public stopPolling() {\n this.queryManager.stopPollingQuery(this.queryId);\n this.options.pollInterval = undefined;\n }\n\n public startPolling(pollInterval: number) {\n if (\n this.options.fetchPolicy === 'cache-first' ||\n this.options.fetchPolicy === 'cache-only'\n ) {\n throw new Error(\n 'Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.',\n );\n }\n\n this.options.pollInterval = pollInterval;\n this.queryManager.startPollingQuery(this.options, this.queryId);\n }\n\n private onSubscribe(observer: Observer<ApolloQueryResult<TData>>) {\n // Zen Observable has its own error function, in order to log correctly\n // we need to declare a custom error if nothing is passed\n if (\n (observer as any)._subscription &&\n (observer as any)._subscription._observer &&\n !(observer as any)._subscription._observer.error\n ) {\n (observer as any)._subscription._observer.error = (\n error: ApolloError,\n ) => {\n console.error('Unhandled error', error.message, error.stack);\n };\n }\n\n this.observers.push(observer);\n\n // Deliver initial result\n if (observer.next && this.lastResult) observer.next(this.lastResult);\n if (observer.error && this.lastError) observer.error(this.lastError);\n\n // setup the query if it hasn't been done before\n if (this.observers.length === 1) this.setUpQuery();\n\n return () => {\n this.observers = this.observers.filter(obs => obs !== observer);\n\n if (this.observers.length === 0) {\n this.tearDownQuery();\n }\n };\n }\n\n private setUpQuery() {\n if (this.shouldSubscribe) {\n this.queryManager.addObservableQuery<TData>(this.queryId, this);\n }\n\n if (!!this.options.pollInterval) {\n if (\n this.options.fetchPolicy === 'cache-first' ||\n this.options.fetchPolicy === 'cache-only'\n ) {\n throw new Error(\n 'Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.',\n );\n }\n\n this.queryManager.startPollingQuery(this.options, this.queryId);\n }\n\n const observer: Observer<ApolloQueryResult<TData>> = {\n next: (result: ApolloQueryResult<TData>) => {\n this.lastResult = result;\n this.lastResultSnapshot = cloneDeep(result);\n this.observers.forEach(obs => obs.next && obs.next(result));\n },\n error: (error: ApolloError) => {\n this.lastError = error;\n this.observers.forEach(obs => obs.error && obs.error(error));\n },\n };\n\n this.queryManager.startQuery<TData>(\n this.queryId,\n this.options,\n this.queryManager.queryListenerForObserver(\n this.queryId,\n this.options,\n observer,\n ),\n );\n }\n\n private tearDownQuery() {\n this.isTornDown = true;\n this.queryManager.stopPollingQuery(this.queryId);\n\n // stop all active GraphQL subscriptions\n this.subscriptionHandles.forEach(sub => sub.unsubscribe());\n this.subscriptionHandles = [];\n\n this.queryManager.removeObservableQuery(this.queryId);\n\n this.queryManager.stopQuery(this.queryId);\n\n this.observers = [];\n }\n}\n","import {\n ApolloLink,\n Operation,\n NextLink,\n FetchResult,\n Observable,\n} from 'apollo-link';\n\n/*\n * Expects context to contain the forceFetch field if no dedup\n */\nexport class DedupLink extends ApolloLink {\n private inFlightRequestObservables: Map<\n string,\n Observable<FetchResult>\n > = new Map();\n private subscribers: Map<string, any> = new Map();\n\n public request(\n operation: Operation,\n forward: NextLink,\n ): Observable<FetchResult> {\n // sometimes we might not want to deduplicate a request, for example when we want to force fetch it.\n if (operation.getContext().forceFetch) {\n return forward(operation);\n }\n\n const key = operation.toKey();\n\n const cleanup = operationKey => {\n this.inFlightRequestObservables.delete(operationKey);\n const prev = this.subscribers.get(operationKey);\n return prev;\n };\n\n if (!this.inFlightRequestObservables.get(key)) {\n // this is a new request, i.e. we haven't deduplicated it yet\n // call the next link\n const singleObserver = forward(operation);\n let subscription;\n\n const sharedObserver = new Observable(observer => {\n // this will still be called by each subscriber regardless of\n // deduplication status\n let prev = this.subscribers.get(key);\n if (!prev) prev = { next: [], error: [], complete: [] };\n\n this.subscribers.set(key, {\n next: prev.next.concat([observer.next.bind(observer)]),\n error: prev.error.concat([observer.error.bind(observer)]),\n complete: prev.complete.concat([observer.complete.bind(observer)]),\n });\n\n if (!subscription) {\n subscription = singleObserver.subscribe({\n next: result => {\n const previous = cleanup(key);\n this.subscribers.delete(key);\n if (previous) {\n previous.next.forEach(next => next(result));\n previous.complete.forEach(complete => complete());\n }\n },\n error: error => {\n const previous = cleanup(key);\n this.subscribers.delete(key);\n if (previous) previous.error.forEach(err => err(error));\n },\n });\n }\n\n return () => {\n if (subscription) subscription.unsubscribe();\n this.inFlightRequestObservables.delete(key);\n };\n });\n\n this.inFlightRequestObservables.set(key, sharedObserver);\n }\n\n // return shared Observable\n return this.inFlightRequestObservables.get(key);\n }\n}\n","import { DocumentNode } from 'graphql';\n\nexport class MutationStore {\n private store: { [mutationId: string]: MutationStoreValue } = {};\n\n public getStore(): { [mutationId: string]: MutationStoreValue } {\n return this.store;\n }\n\n public get(mutationId: string): MutationStoreValue {\n return this.store[mutationId];\n }\n\n public initMutation(\n mutationId: string,\n mutation: DocumentNode,\n variables: Object | undefined,\n ) {\n this.store[mutationId] = {\n mutation,\n variables: variables || {},\n loading: true,\n error: null,\n };\n }\n\n public markMutationError(mutationId: string, error: Error) {\n const mutation = this.store[mutationId];\n\n if (!mutation) {\n return;\n }\n\n mutation.loading = false;\n mutation.error = error;\n }\n\n public markMutationResult(mutationId: string) {\n const mutation = this.store[mutationId];\n\n if (!mutation) {\n return;\n }\n\n mutation.loading = false;\n mutation.error = null;\n }\n\n public reset() {\n this.store = {};\n }\n}\n\nexport interface MutationStoreValue {\n mutation: DocumentNode;\n variables: Object;\n loading: boolean;\n error: Error | null;\n}\n","import { DocumentNode, GraphQLError, ExecutionResult } from 'graphql';\nimport { isEqual } from 'apollo-utilities';\n\nimport { NetworkStatus } from '../core/networkStatus';\n\nexport type QueryStoreValue = {\n document: DocumentNode;\n variables: Object;\n previousVariables?: Object | null;\n networkStatus: NetworkStatus;\n networkError?: Error | null;\n graphQLErrors?: ReadonlyArray<GraphQLError>;\n metadata: any;\n};\n\nexport class QueryStore {\n private store: { [queryId: string]: QueryStoreValue } = {};\n\n public getStore(): { [queryId: string]: QueryStoreValue } {\n return this.store;\n }\n\n public get(queryId: string): QueryStoreValue {\n return this.store[queryId];\n }\n\n public initQuery(query: {\n queryId: string;\n document: DocumentNode;\n storePreviousVariables: boolean;\n variables: Object;\n isPoll: boolean;\n isRefetch: boolean;\n metadata: any;\n fetchMoreForQueryId: string | undefined;\n }) {\n const previousQuery = this.store[query.queryId];\n\n if (\n previousQuery &&\n previousQuery.document !== query.document &&\n !isEqual(previousQuery.document, query.document)\n ) {\n // XXX we're throwing an error here to catch bugs where a query gets overwritten by a new one.\n // we should implement a separate action for refetching so that QUERY_INIT may never overwrite\n // an existing query (see also: https://github.com/apollostack/apollo-client/issues/732)\n throw new Error(\n 'Internal Error: may not update existing query string in store',\n );\n }\n\n let isSetVariables = false;\n\n let previousVariables: Object | null = null;\n if (\n query.storePreviousVariables &&\n previousQuery &&\n previousQuery.networkStatus !== NetworkStatus.loading\n // if the previous query was still loading, we don't want to remember it at all.\n ) {\n if (!isEqual(previousQuery.variables, query.variables)) {\n isSetVariables = true;\n previousVariables = previousQuery.variables;\n }\n }\n\n // TODO break this out into a separate function\n let networkStatus;\n if (isSetVariables) {\n networkStatus = NetworkStatus.setVariables;\n } else if (query.isPoll) {\n networkStatus = NetworkStatus.poll;\n } else if (query.isRefetch) {\n networkStatus = NetworkStatus.refetch;\n // TODO: can we determine setVariables here if it's a refetch and the variables have changed?\n } else {\n networkStatus = NetworkStatus.loading;\n }\n\n let graphQLErrors: ReadonlyArray<GraphQLError> = [];\n if (previousQuery && previousQuery.graphQLErrors) {\n graphQLErrors = previousQuery.graphQLErrors;\n }\n\n // XXX right now if QUERY_INIT is fired twice, like in a refetch situation, we just overwrite\n // the store. We probably want a refetch action instead, because I suspect that if you refetch\n // before the initial fetch is done, you'll get an error.\n this.store[query.queryId] = {\n document: query.document,\n variables: query.variables,\n previousVariables,\n networkError: null,\n graphQLErrors: graphQLErrors,\n networkStatus,\n metadata: query.metadata,\n };\n\n // If the action had a `moreForQueryId` property then we need to set the\n // network status on that query as well to `fetchMore`.\n //\n // We have a complement to this if statement in the query result and query\n // error action branch, but importantly *not* in the client result branch.\n // This is because the implementation of `fetchMore` *always* sets\n // `fetchPolicy` to `network-only` so we would never have a client result.\n if (\n typeof query.fetchMoreForQueryId === 'string' &&\n this.store[query.fetchMoreForQueryId]\n ) {\n this.store[query.fetchMoreForQueryId].networkStatus =\n NetworkStatus.fetchMore;\n }\n }\n\n public markQueryResult(\n queryId: string,\n result: ExecutionResult,\n fetchMoreForQueryId: string | undefined,\n ) {\n if (!this.store || !this.store[queryId]) return;\n\n this.store[queryId].networkError = null;\n this.store[queryId].graphQLErrors =\n result.errors && result.errors.length ? result.errors : [];\n this.store[queryId].previousVariables = null;\n this.store[queryId].networkStatus = NetworkStatus.ready;\n\n // If we have a `fetchMoreForQueryId` then we need to update the network\n // status for that query. See the branch for query initialization for more\n // explanation about this process.\n if (\n typeof fetchMoreForQueryId === 'string' &&\n this.store[fetchMoreForQueryId]\n ) {\n this.store[fetchMoreForQueryId].networkStatus = NetworkStatus.ready;\n }\n }\n\n public markQueryError(\n queryId: string,\n error: Error,\n fetchMoreForQueryId: string | undefined,\n ) {\n if (!this.store || !this.store[queryId]) return;\n\n this.store[queryId].networkError = error;\n this.store[queryId].networkStatus = NetworkStatus.error;\n\n // If we have a `fetchMoreForQueryId` then we need to update the network\n // status for that query. See the branch for query initialization for more\n // explanation about this process.\n if (typeof fetchMoreForQueryId === 'string') {\n this.markQueryResultClient(fetchMoreForQueryId, true);\n }\n }\n\n public markQueryResultClient(queryId: string, complete: boolean) {\n if (!this.store || !this.store[queryId]) return;\n\n this.store[queryId].networkError = null;\n this.store[queryId].previousVariables = null;\n this.store[queryId].networkStatus = complete\n ? NetworkStatus.ready\n : NetworkStatus.loading;\n }\n\n public stopQuery(queryId: string) {\n delete this.store[queryId];\n }\n\n public reset(observableQueryIds: string[]) {\n // keep only the queries with query ids that are associated with observables\n this.store = Object.keys(this.store)\n .filter(queryId => {\n return observableQueryIds.indexOf(queryId) > -1;\n })\n .reduce(\n (res, key) => {\n // XXX set loading to true so listeners don't trigger unless they want results with partial data\n res[key] = {\n ...this.store[key],\n networkStatus: NetworkStatus.loading,\n };\n\n return res;\n },\n {} as { [queryId: string]: QueryStoreValue },\n );\n }\n}\n","import { execute, ApolloLink, FetchResult } from 'apollo-link';\nimport { ExecutionResult, DocumentNode } from 'graphql';\nimport { DedupLink as Deduplicator } from 'apollo-link-dedup';\nimport { Cache } from 'apollo-cache';\nimport {\n assign,\n getDefaultValues,\n getMutationDefinition,\n getOperationDefinition,\n getOperationName,\n getQueryDefinition,\n isProduction,\n hasDirectives,\n} from 'apollo-utilities';\n\nimport { isApolloError, ApolloError } from '../errors/ApolloError';\n\nimport { Observer, Subscription, Observable } from '../util/Observable';\n\nimport { QueryWithUpdater, DataStore } from '../data/store';\nimport { MutationStore } from '../data/mutations';\nimport { QueryStore, QueryStoreValue } from '../data/queries';\n\nimport {\n QueryOptions,\n WatchQueryOptions,\n SubscriptionOptions,\n MutationOptions,\n} from './watchQueryOptions';\nimport { ObservableQuery } from './ObservableQuery';\nimport { NetworkStatus, isNetworkRequestInFlight } from './networkStatus';\nimport {\n QueryListener,\n ApolloQueryResult,\n FetchType,\n OperationVariables,\n} from './types';\nimport { graphQLResultHasError } from 'apollo-utilities';\n\nexport interface QueryInfo {\n listeners: QueryListener[];\n invalidated: boolean;\n newData: Cache.DiffResult<any> | null;\n document: DocumentNode | null;\n lastRequestId: number | null;\n // A map going from queryId to an observer for a query issued by watchQuery. We use\n // these to keep track of queries that are inflight and error on the observers associated\n // with them in case of some destabalizing action (e.g. reset of the Apollo store).\n observableQuery: ObservableQuery<any> | null;\n subscriptions: Subscription[];\n cancel?: (() => void);\n}\n\nexport class QueryManager<TStore> {\n public link: ApolloLink;\n public mutationStore: MutationStore = new MutationStore();\n public queryStore: QueryStore = new QueryStore();\n public dataStore: DataStore<TStore>;\n\n private deduplicator: ApolloLink;\n private queryDeduplication: boolean;\n private clientAwareness: Record<string, string> = {};\n\n private onBroadcast: () => void;\n\n private ssrMode: boolean;\n\n // let's not start at zero to avoid pain with bad checks\n private idCounter = 1;\n\n // XXX merge with ObservableQuery but that needs to be expanded to support mutations and\n // subscriptions as well\n private queries: Map<string, QueryInfo> = new Map();\n\n // A set of Promise reject functions for fetchQuery promises that have not\n // yet been resolved, used to keep track of in-flight queries so that we can\n // reject them in case a destabilizing event occurs (e.g. Apollo store reset).\n private fetchQueryRejectFns = new Set<Function>();\n\n // A map going from the name of a query to an observer issued for it by watchQuery. This is\n // generally used to refetches for refetchQueries and to update mutation results through\n // updateQueries.\n private queryIdsByName: { [queryName: string]: string[] } = {};\n\n constructor({\n link,\n queryDeduplication = false,\n store,\n onBroadcast = () => undefined,\n ssrMode = false,\n clientAwareness = {},\n }: {\n link: ApolloLink;\n queryDeduplication?: boolean;\n store: DataStore<TStore>;\n onBroadcast?: () => void;\n ssrMode?: boolean;\n clientAwareness?: Record<string, string>;\n }) {\n this.link = link;\n this.deduplicator = ApolloLink.from([new Deduplicator(), link]);\n this.queryDeduplication = queryDeduplication;\n this.dataStore = store;\n this.onBroadcast = onBroadcast;\n this.clientAwareness = clientAwareness;\n this.ssrMode = ssrMode;\n }\n\n public mutate<T>({\n mutation,\n variables,\n optimisticResponse,\n updateQueries: updateQueriesByName,\n refetchQueries = [],\n awaitRefetchQueries = false,\n update: updateWithProxyFn,\n errorPolicy = 'none',\n fetchPolicy,\n context = {},\n }: MutationOptions): Promise<FetchResult<T>> {\n if (!mutation) {\n throw new Error(\n 'mutation option is required. You must specify your GraphQL document in the mutation option.',\n );\n }\n\n if (fetchPolicy && fetchPolicy !== 'no-cache') {\n throw new Error(\n \"fetchPolicy for mutations currently only supports the 'no-cache' policy\",\n );\n }\n\n const mutationId = this.generateQueryId();\n const cache = this.dataStore.getCache();\n (mutation = cache.transformDocument(mutation)),\n (variables = assign(\n {},\n getDefaultValues(getMutationDefinition(mutation)),\n variables,\n ));\n\n this.setQuery(mutationId, () => ({ document: mutation }));\n\n // Create a map of update queries by id to the query instead of by name.\n const generateUpdateQueriesInfo: () => {\n [queryId: string]: QueryWithUpdater;\n } = () => {\n const ret: { [queryId: string]: QueryWithUpdater } = {};\n\n if (updateQueriesByName) {\n Object.keys(updateQueriesByName).forEach(queryName =>\n (this.queryIdsByName[queryName] || []).forEach(queryId => {\n ret[queryId] = {\n updater: updateQueriesByName[queryName],\n query: this.queryStore.get(queryId),\n };\n }),\n );\n }\n\n return ret;\n };\n\n this.mutationStore.initMutation(mutationId, mutation, variables);\n\n this.dataStore.markMutationInit({\n mutationId,\n document: mutation,\n variables: variables || {},\n updateQueries: generateUpdateQueriesInfo(),\n update: updateWithProxyFn,\n optimisticResponse,\n });\n\n this.broadcastQueries();\n\n return new Promise((resolve, reject) => {\n let storeResult: FetchResult<T> | null;\n let error: ApolloError;\n\n const operation = this.buildOperationForLink(mutation, variables, {\n ...context,\n optimisticResponse,\n });\n\n const completeMutation = () => {\n if (error) {\n this.mutationStore.markMutationError(mutationId, error);\n }\n\n this.dataStore.markMutationComplete({\n mutationId,\n optimisticResponse,\n });\n\n this.broadcastQueries();\n\n if (error) {\n return Promise.reject(error);\n }\n\n // allow for conditional refetches\n // XXX do we want to make this the only API one day?\n if (typeof refetchQueries === 'function') {\n refetchQueries = refetchQueries(storeResult as ExecutionResult);\n }\n\n const refetchQueryPromises: Promise<\n ApolloQueryResult<any>[] | ApolloQueryResult<{}>\n >[] = [];\n\n for (const refetchQuery of refetchQueries) {\n if (typeof refetchQuery === 'string') {\n const promise = this.refetchQueryByName(refetchQuery);\n if (promise) {\n refetchQueryPromises.push(promise);\n }\n continue;\n }\n\n const queryOptions: QueryOptions = {\n query: refetchQuery.query,\n variables: refetchQuery.variables,\n fetchPolicy: 'network-only',\n };\n\n if (refetchQuery.context) {\n queryOptions.context = refetchQuery.context;\n }\n\n refetchQueryPromises.push(this.query(queryOptions));\n }\n\n return Promise.all(\n awaitRefetchQueries ? refetchQueryPromises : [],\n ).then(() => {\n this.setQuery(mutationId, () => ({ document: undefined }));\n\n if (\n errorPolicy === 'ignore' &&\n storeResult &&\n graphQLResultHasError(storeResult)\n ) {\n delete storeResult.errors;\n }\n\n return storeResult as FetchResult<T>;\n });\n };\n\n execute(this.link, operation).subscribe({\n next: (result: ExecutionResult) => {\n if (graphQLResultHasError(result) && errorPolicy === 'none') {\n error = new ApolloError({\n graphQLErrors: result.errors,\n });\n return;\n }\n\n this.mutationStore.markMutationResult(mutationId);\n\n if (fetchPolicy !== 'no-cache') {\n this.dataStore.markMutationResult({\n mutationId,\n result,\n document: mutation,\n variables: variables || {},\n updateQueries: generateUpdateQueriesInfo(),\n update: updateWithProxyFn,\n });\n }\n storeResult = result as FetchResult<T>;\n },\n\n error: (err: Error) => {\n this.mutationStore.markMutationError(mutationId, err);\n this.dataStore.markMutationComplete({\n mutationId,\n optimisticResponse,\n });\n this.broadcastQueries();\n\n this.setQuery(mutationId, () => ({ document: undefined }));\n reject(\n new ApolloError({\n networkError: err,\n }),\n );\n },\n\n complete: () => completeMutation().then(resolve, reject),\n });\n });\n }\n\n public fetchQuery<T>(\n queryId: string,\n options: WatchQueryOptions,\n fetchType?: FetchType,\n // This allows us to track if this is a query spawned by a `fetchMore`\n // call for another query. We need this data to compute the `fetchMore`\n // network status for the query this is fetching for.\n fetchMoreForQueryId?: string,\n ): Promise<FetchResult<T>> {\n const {\n variables = {},\n metadata = null,\n fetchPolicy = 'cache-first', // cache-first is the default fetch policy.\n } = options;\n const cache = this.dataStore.getCache();\n\n const query = cache.transformDocument(options.query);\n\n let storeResult: any;\n let needToFetch: boolean =\n fetchPolicy === 'network-only' || fetchPolicy === 'no-cache';\n\n // If this is not a force fetch, we want to diff the query against the\n // store before we fetch it from the network interface.\n // TODO we hit the cache even if the policy is network-first. This could be unnecessary if the network is up.\n if (\n fetchType !== FetchType.refetch &&\n fetchPolicy !== 'network-only' &&\n fetchPolicy !== 'no-cache'\n ) {\n const { complete, result } = this.dataStore.getCache().diff({\n query,\n variables,\n returnPartialData: true,\n optimistic: false,\n });\n\n // If we're in here, only fetch if we have missing fields\n needToFetch = !complete || fetchPolicy === 'cache-and-network';\n storeResult = result;\n }\n\n let shouldFetch =\n needToFetch && fetchPolicy !== 'cache-only' && fetchPolicy !== 'standby';\n\n // we need to check to see if this is an operation that uses the @live directive\n if (hasDirectives(['live'], query)) shouldFetch = true;\n\n const requestId = this.generateRequestId();\n\n // set up a watcher to listen to cache updates\n const cancel = this.updateQueryWatch(queryId, query, options);\n\n // Initialize query in store with unique requestId\n this.setQuery(queryId, () => ({\n document: query,\n lastRequestId: requestId,\n invalidated: true,\n cancel,\n }));\n\n this.invalidate(true, fetchMoreForQueryId);\n\n this.queryStore.initQuery({\n queryId,\n document: query,\n storePreviousVariables: shouldFetch,\n variables,\n isPoll: fetchType === FetchType.poll,\n isRefetch: fetchType === FetchType.refetch,\n metadata,\n fetchMoreForQueryId,\n });\n\n this.broadcastQueries();\n\n // If there is no part of the query we need to fetch from the server (or,\n // fetchPolicy is cache-only), we just write the store result as the final result.\n const shouldDispatchClientResult =\n !shouldFetch || fetchPolicy === 'cache-and-network';\n\n if (shouldDispatchClientResult) {\n this.queryStore.markQueryResultClient(queryId, !shouldFetch);\n\n this.invalidate(true, queryId, fetchMoreForQueryId);\n\n this.broadcastQueries();\n }\n\n if (shouldFetch) {\n const networkResult = this.fetchRequest({\n requestId,\n queryId,\n document: query,\n options,\n fetchMoreForQueryId,\n }).catch(error => {\n // This is for the benefit of `refetch` promises, which currently don't get their errors\n // through the store like watchQuery observers do\n if (isApolloError(error)) {\n throw error;\n } else {\n const { lastRequestId } = this.getQuery(queryId);\n if (requestId >= (lastRequestId || 1)) {\n this.queryStore.markQueryError(queryId, error, fetchMoreForQueryId);\n\n this.invalidate(true, queryId, fetchMoreForQueryId);\n\n this.broadcastQueries();\n }\n\n throw new ApolloError({ networkError: error });\n }\n });\n\n // we don't return the promise for cache-and-network since it is already\n // returned below from the cache\n if (fetchPolicy !== 'cache-and-network') {\n return networkResult;\n } else {\n // however we need to catch the error so it isn't unhandled in case of\n // network error\n networkResult.catch(() => {});\n }\n }\n\n // If we have no query to send to the server, we should return the result\n // found within the store.\n return Promise.resolve<ExecutionResult>({ data: storeResult });\n }\n\n // Returns a query listener that will update the given observer based on the\n // results (or lack thereof) for a particular query.\n public queryListenerForObserver<T>(\n queryId: string,\n options: WatchQueryOptions,\n observer: Observer<ApolloQueryResult<T>>,\n ): QueryListener {\n let previouslyHadError: boolean = false;\n return (\n queryStoreValue: QueryStoreValue,\n newData?: Cache.DiffResult<T>,\n ) => {\n // we're going to take a look at the data, so the query is no longer invalidated\n this.invalidate(false, queryId);\n\n // The query store value can be undefined in the event of a store\n // reset.\n if (!queryStoreValue) return;\n\n const { observableQuery } = this.getQuery(queryId);\n\n const fetchPolicy = observableQuery\n ? observableQuery.options.fetchPolicy\n : options.fetchPolicy;\n\n // don't watch the store for queries on standby\n if (fetchPolicy === 'standby') return;\n\n const errorPolicy = observableQuery\n ? observableQuery.options.errorPolicy\n : options.errorPolicy;\n\n const lastResult = observableQuery\n ? observableQuery.getLastResult()\n : null;\n\n const lastError = observableQuery ? observableQuery.getLastError() : null;\n\n let shouldNotifyIfLoading =\n (!newData && queryStoreValue.previousVariables != null) ||\n fetchPolicy === 'cache-only' ||\n fetchPolicy === 'cache-and-network';\n\n // if this caused by a cache broadcast but the query is still in flight\n // don't notify the observer\n // if (\n // isCacheBroadcast &&\n // isNetworkRequestInFlight(queryStoreValue.networkStatus)\n // ) {\n // shouldNotifyIfLoading = false;\n // }\n\n const networkStatusChanged = Boolean(\n lastResult &&\n queryStoreValue.networkStatus !== lastResult.networkStatus,\n );\n\n const errorStatusChanged =\n errorPolicy &&\n (lastError && lastError.graphQLErrors) !==\n queryStoreValue.graphQLErrors &&\n errorPolicy !== 'none';\n\n if (\n !isNetworkRequestInFlight(queryStoreValue.networkStatus) ||\n (networkStatusChanged && options.notifyOnNetworkStatusChange) ||\n shouldNotifyIfLoading\n ) {\n // If we have either a GraphQL error or a network error, we create\n // an error and tell the observer about it.\n if (\n ((!errorPolicy || errorPolicy === 'none') &&\n queryStoreValue.graphQLErrors &&\n queryStoreValue.graphQLErrors.length > 0) ||\n queryStoreValue.networkError\n ) {\n const apolloError = new ApolloError({\n graphQLErrors: queryStoreValue.graphQLErrors,\n networkError: queryStoreValue.networkError,\n });\n previouslyHadError = true;\n if (observer.error) {\n try {\n observer.error(apolloError);\n } catch (e) {\n // Throw error outside this control flow to avoid breaking Apollo's state\n setTimeout(() => {\n throw e;\n }, 0);\n }\n } else {\n // Throw error outside this control flow to avoid breaking Apollo's state\n setTimeout(() => {\n throw apolloError;\n }, 0);\n if (!isProduction()) {\n /* tslint:disable-next-line */\n console.info(\n 'An unhandled error was thrown because no error handler is registered ' +\n 'for the query ' +\n JSON.stringify(queryStoreValue.document),\n );\n }\n }\n return;\n }\n\n try {\n let data: any;\n let isMissing: boolean;\n\n if (newData) {\n // As long as we're using the cache, clear out the latest\n // `newData`, since it will now become the current data. We need\n // to keep the `newData` stored with the query when using\n // `no-cache` since `getCurrentQueryResult` attemps to pull from\n // `newData` first, following by trying the cache (which won't\n // find a hit for `no-cache`).\n if (fetchPolicy !== 'no-cache') {\n this.setQuery(queryId, () => ({ newData: null }));\n }\n\n data = newData.result;\n isMissing = !newData.complete || false;\n } else {\n if (lastResult && lastResult.data && !errorStatusChanged) {\n data = lastResult.data;\n isMissing = false;\n } else {\n const { document } = this.getQuery(queryId);\n const readResult = this.dataStore.getCache().diff({\n query: document as DocumentNode,\n variables:\n queryStoreValue.previousVariables ||\n queryStoreValue.variables,\n optimistic: true,\n });\n\n data = readResult.result;\n isMissing = !readResult.complete;\n }\n }\n\n let resultFromStore: ApolloQueryResult<T>;\n\n // If there is some data missing and the user has told us that they\n // do not tolerate partial data then we want to return the previous\n // result and mark it as stale.\n if (isMissing && fetchPolicy !== 'cache-only') {\n resultFromStore = {\n data: lastResult && lastResult.data,\n loading: isNetworkRequestInFlight(queryStoreValue.networkStatus),\n networkStatus: queryStoreValue.networkStatus,\n stale: true,\n };\n } else {\n resultFromStore = {\n data,\n loading: isNetworkRequestInFlight(queryStoreValue.networkStatus),\n networkStatus: queryStoreValue.networkStatus,\n stale: false,\n };\n }\n\n // if the query wants updates on errors we need to add it to the result\n if (\n errorPolicy === 'all' &&\n queryStoreValue.graphQLErrors &&\n queryStoreValue.graphQLErrors.length > 0\n ) {\n resultFromStore.errors = queryStoreValue.graphQLErrors;\n }\n\n if (observer.next) {\n if (\n previouslyHadError ||\n !observableQuery ||\n observableQuery.isDifferentFromLastResult(resultFromStore)\n ) {\n try {\n observer.next(resultFromStore);\n } catch (e) {\n // Throw error outside this control flow to avoid breaking Apollo's state\n setTimeout(() => {\n throw e;\n }, 0);\n }\n }\n }\n previouslyHadError = false;\n } catch (error) {\n previouslyHadError = true;\n if (observer.error)\n observer.error(new ApolloError({ networkError: error }));\n return;\n }\n }\n };\n }\n\n // The shouldSubscribe option is a temporary fix that tells us whether watchQuery was called\n // directly (i.e. through ApolloClient) or through the query method within QueryManager.\n // Currently, the query method uses watchQuery in order to handle non-network errors correctly\n // but we don't want to keep track observables issued for the query method since those aren't\n // supposed to be refetched in the event of a store reset. Once we unify error handling for\n // network errors and non-network errors, the shouldSubscribe option will go away.\n\n public watchQuery<T, TVariables = OperationVariables>(\n options: WatchQueryOptions,\n shouldSubscribe = true,\n ): ObservableQuery<T, TVariables> {\n if (options.fetchPolicy === 'standby') {\n throw new Error(\n 'client.watchQuery cannot be called with fetchPolicy set to \"standby\"',\n );\n }\n\n // get errors synchronously\n const queryDefinition = getQueryDefinition(options.query);\n\n // assign variable default values if supplied\n if (\n queryDefinition.variableDefinitions &&\n queryDefinition.variableDefinitions.length\n ) {\n const defaultValues = getDefaultValues(queryDefinition);\n\n options.variables = assign({}, defaultValues, options.variables);\n }\n\n if (typeof options.notifyOnNetworkStatusChange === 'undefined') {\n options.notifyOnNetworkStatusChange = false;\n }\n\n let transformedOptions = { ...options } as WatchQueryOptions<TVariables>;\n\n return new ObservableQuery<T, TVariables>({\n queryManager: this,\n options: transformedOptions,\n shouldSubscribe: shouldSubscribe,\n });\n }\n\n public query<T>(options: QueryOptions): Promise<ApolloQueryResult<T>> {\n if (!options.query) {\n throw new Error(\n 'query option is required. You must specify your GraphQL document ' +\n 'in the query option.',\n );\n }\n\n if (options.query.kind !== 'Document') {\n throw new Error('You must wrap the query string in a \"gql\" tag.');\n }\n\n if ((options as any).returnPartialData) {\n throw new Error('returnPartialData option only supported on watchQuery.');\n }\n\n if ((options as any).pollInterval) {\n throw new Error('pollInterval option only supported on watchQuery.');\n }\n\n return new Promise<ApolloQueryResult<T>>((resolve, reject) => {\n this.fetchQueryRejectFns.add(reject);\n this.watchQuery<T>(options, false)\n .result()\n .then(resolve, reject)\n // Since neither resolve nor reject throw or return a value, this .then\n // handler is guaranteed to execute. Note that it doesn't really matter\n // when we remove the reject function from this.fetchQueryRejectFns,\n // since resolve and reject are mutually idempotent. In fact, it would\n // not be incorrect to let reject functions accumulate over time; it's\n // just a waste of memory.\n .then(() => this.fetchQueryRejectFns.delete(reject));\n });\n }\n\n public generateQueryId() {\n const queryId = this.idCounter.toString();\n this.idCounter++;\n return queryId;\n }\n\n public stopQueryInStore(queryId: string) {\n this.queryStore.stopQuery(queryId);\n this.invalidate(true, queryId);\n this.broadcastQueries();\n }\n\n public addQueryListener(queryId: string, listener: QueryListener) {\n this.setQuery(queryId, ({ listeners = [] }) => ({\n listeners: listeners.concat([listener]),\n invalidate: false,\n }));\n }\n\n public updateQueryWatch(\n queryId: string,\n document: DocumentNode,\n options: WatchQueryOptions,\n ) {\n const { cancel } = this.getQuery(queryId);\n if (cancel) cancel();\n const previousResult = () => {\n let previousResult = null;\n const { observableQuery } = this.getQuery(queryId);\n if (observableQuery) {\n const lastResult = observableQuery.getLastResult();\n if (lastResult) {\n previousResult = lastResult.data;\n }\n }\n\n return previousResult;\n };\n return this.dataStore.getCache().watch({\n query: document as DocumentNode,\n variables: options.variables,\n optimistic: true,\n previousResult,\n callback: (newData: ApolloQueryResult<any>) => {\n this.setQuery(queryId, () => ({ invalidated: true, newData }));\n },\n });\n }\n\n // Adds an ObservableQuery to this.observableQueries and to this.observableQueriesByName.\n public addObservableQuery<T>(\n queryId: string,\n observableQuery: ObservableQuery<T>,\n ) {\n this.setQuery(queryId, () => ({ observableQuery }));\n\n // Insert the ObservableQuery into this.observableQueriesByName if the query has a name\n const queryDef = getQueryDefinition(observableQuery.options.query);\n if (queryDef.name && queryDef.name.value) {\n const queryName = queryDef.name.value;\n\n // XXX we may we want to warn the user about query name conflicts in the future\n this.queryIdsByName[queryName] = this.queryIdsByName[queryName] || [];\n this.queryIdsByName[queryName].push(observableQuery.queryId);\n }\n }\n\n public removeObservableQuery(queryId: string) {\n const { observableQuery, cancel } = this.getQuery(queryId);\n if (cancel) cancel();\n if (!observableQuery) return;\n\n const definition = getQueryDefinition(observableQuery.options.query);\n const queryName = definition.name ? definition.name.value : null;\n this.setQuery(queryId, () => ({ observableQuery: null }));\n if (queryName) {\n this.queryIdsByName[queryName] = this.queryIdsByName[queryName].filter(\n val => {\n return !(observableQuery.queryId === val);\n },\n );\n }\n }\n\n public clearStore(): Promise<void> {\n // Before we have sent the reset action to the store,\n // we can no longer rely on the results returned by in-flight\n // requests since these may depend on values that previously existed\n // in the data portion of the store. So, we cancel the promises and observers\n // that we have issued so far and not yet resolved (in the case of\n // queries).\n this.fetchQueryRejectFns.forEach(reject => {\n reject(\n new Error(\n 'Store reset while query was in flight(not completed in link chain)',\n ),\n );\n });\n\n const resetIds: string[] = [];\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery) resetIds.push(queryId);\n });\n\n this.queryStore.reset(resetIds);\n this.mutationStore.reset();\n\n // begin removing data from the store\n const reset = this.dataStore.reset();\n return reset;\n }\n\n public resetStore(): Promise<ApolloQueryResult<any>[]> {\n // Similarly, we have to have to refetch each of the queries currently being\n // observed. We refetch instead of error'ing on these since the assumption is that\n // resetting the store doesn't eliminate the need for the queries currently being\n // watched. If there is an existing query in flight when the store is reset,\n // the promise for it will be rejected and its results will not be written to the\n // store.\n return this.clearStore().then(() => {\n return this.reFetchObservableQueries();\n });\n }\n\n public reFetchObservableQueries(\n includeStandby?: boolean,\n ): Promise<ApolloQueryResult<any>[]> {\n const observableQueryPromises: Promise<\n ApolloQueryResult<any>\n >[] = this.getObservableQueryPromises(includeStandby);\n\n this.broadcastQueries();\n\n return Promise.all(observableQueryPromises);\n }\n\n public startQuery<T>(\n queryId: string,\n options: WatchQueryOptions,\n listener: QueryListener,\n ) {\n this.addQueryListener(queryId, listener);\n\n this.fetchQuery<T>(queryId, options)\n // `fetchQuery` returns a Promise. In case of a failure it should be caucht or else the\n // console will show an `Uncaught (in promise)` message. Ignore the error for now.\n .catch(() => undefined);\n\n return queryId;\n }\n\n public startGraphQLSubscription(\n options: SubscriptionOptions,\n ): Observable<any> {\n const { query } = options;\n const isCacheEnabled = !(\n options.fetchPolicy && options.fetchPolicy === 'no-cache'\n );\n const cache = this.dataStore.getCache();\n let transformedDoc = cache.transformDocument(query);\n\n const variables = assign(\n {},\n getDefaultValues(getOperationDefinition(query)),\n options.variables,\n );\n\n let sub: Subscription;\n let observers: Observer<any>[] = [];\n\n return new Observable(observer => {\n observers.push(observer);\n\n // If this is the first observer, actually initiate the network\n // subscription.\n if (observers.length === 1) {\n const handler = {\n next: (result: FetchResult) => {\n if (isCacheEnabled) {\n this.dataStore.markSubscriptionResult(\n result,\n transformedDoc,\n variables,\n );\n this.broadcastQueries();\n }\n\n observers.forEach(obs => {\n // If an error exists and a `error` handler has been defined on\n // the observer, call that `error` handler and make sure the\n // `next` handler is skipped. If no `error` handler exists, we're\n // still passing any errors that might occur into the `next`\n // handler, to give that handler a chance to deal with the\n // error (we're doing this for backwards compatibilty).\n if (graphQLResultHasError(result) && obs.error) {\n obs.error(\n new ApolloError({\n graphQLErrors: result.errors,\n }),\n );\n } else if (obs.next) {\n obs.next(result);\n }\n });\n },\n error: (error: Error) => {\n observers.forEach(obs => {\n if (obs.error) {\n obs.error(error);\n }\n });\n },\n complete: () => {\n observers.forEach(obs => {\n if (obs.complete) {\n obs.complete();\n }\n });\n }\n };\n\n // TODO: Should subscriptions also accept a `context` option to pass\n // through to links?\n const operation = this.buildOperationForLink(transformedDoc, variables);\n sub = execute(this.link, operation).subscribe(handler);\n }\n\n return () => {\n observers = observers.filter(obs => obs !== observer);\n\n // If we removed the last observer, tear down the network subscription\n if (observers.length === 0 && sub) {\n sub.unsubscribe();\n }\n };\n });\n }\n\n public stopQuery(queryId: string) {\n this.stopQueryInStore(queryId);\n this.removeQuery(queryId);\n }\n\n public removeQuery(queryId: string) {\n const { subscriptions } = this.getQuery(queryId);\n // teardown all links\n subscriptions.forEach(x => x.unsubscribe());\n this.queries.delete(queryId);\n }\n\n public getCurrentQueryResult<T>(\n observableQuery: ObservableQuery<T>,\n optimistic: boolean = true,\n ) {\n const { variables, query } = observableQuery.options;\n const lastResult = observableQuery.getLastResult();\n const { newData } = this.getQuery(observableQuery.queryId);\n // XXX test this\n if (newData && newData.complete) {\n return { data: newData.result, partial: false };\n } else {\n try {\n // the query is brand new, so we read from the store to see if anything is there\n const data = this.dataStore.getCache().read({\n query,\n variables,\n previousResult: lastResult ? lastResult.data : undefined,\n optimistic,\n });\n\n return { data, partial: false };\n } catch (e) {\n return { data: {}, partial: true };\n }\n }\n }\n\n public getQueryWithPreviousResult<T>(\n queryIdOrObservable: string | ObservableQuery<T>,\n ): {\n previousResult: any;\n variables: OperationVariables | undefined;\n document: DocumentNode;\n } {\n let observableQuery: ObservableQuery<T>;\n if (typeof queryIdOrObservable === 'string') {\n const { observableQuery: foundObserveableQuery } = this.getQuery(\n queryIdOrObservable,\n );\n if (!foundObserveableQuery) {\n throw new Error(\n `ObservableQuery with this id doesn't exist: ${queryIdOrObservable}`,\n );\n }\n observableQuery = foundObserveableQuery;\n } else {\n observableQuery = queryIdOrObservable;\n }\n\n const { variables, query } = observableQuery.options;\n\n const { data } = this.getCurrentQueryResult(observableQuery, false);\n\n return {\n previousResult: data,\n variables,\n document: query,\n };\n }\n\n public broadcastQueries() {\n this.onBroadcast();\n this.queries.forEach((info, id) => {\n if (!info.invalidated || !info.listeners) return;\n info.listeners\n // it's possible for the listener to be undefined if the query is being stopped\n // See here for more detail: https://github.com/apollostack/apollo-client/issues/231\n .filter((x: QueryListener) => !!x)\n .forEach((listener: QueryListener) => {\n listener(this.queryStore.get(id), info.newData);\n });\n });\n }\n\n private getObservableQueryPromises(\n includeStandby?: boolean,\n ): Promise<ApolloQueryResult<any>>[] {\n const observableQueryPromises: Promise<ApolloQueryResult<any>>[] = [];\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (!observableQuery) return;\n const fetchPolicy = observableQuery.options.fetchPolicy;\n\n observableQuery.resetLastResults();\n if (\n fetchPolicy !== 'cache-only' &&\n (includeStandby || fetchPolicy !== 'standby')\n ) {\n observableQueryPromises.push(observableQuery.refetch());\n }\n\n this.setQuery(queryId, () => ({ newData: null }));\n this.invalidate(true, queryId);\n });\n\n return observableQueryPromises;\n }\n\n // Takes a request id, query id, a query document and information associated with the query\n // and send it to the network interface. Returns\n // a promise for the result associated with that request.\n private fetchRequest<T>({\n requestId,\n queryId,\n document,\n options,\n fetchMoreForQueryId,\n }: {\n requestId: number;\n queryId: string;\n document: DocumentNode;\n options: WatchQueryOptions;\n fetchMoreForQueryId?: string;\n }): Promise<ExecutionResult> {\n const { variables, context, errorPolicy = 'none', fetchPolicy } = options;\n const operation = this.buildOperationForLink(document, variables, {\n ...context,\n // TODO: Should this be included for all entry points via\n // buildOperationForLink?\n forceFetch: !this.queryDeduplication,\n });\n\n let resultFromStore: any;\n let errorsFromStore: any;\n\n let rejectFetchPromise: (reason?: any) => void;\n\n return new Promise<ApolloQueryResult<T>>((resolve, reject) => {\n // Need to assign the reject function to the rejectFetchPromise variable\n // in the outer scope so that we can refer to it in the .catch handler.\n this.fetchQueryRejectFns.add(rejectFetchPromise = reject);\n\n const subscription = execute(this.deduplicator, operation).subscribe({\n next: (result: ExecutionResult) => {\n // default the lastRequestId to 1\n const { lastRequestId } = this.getQuery(queryId);\n if (requestId >= (lastRequestId || 1)) {\n if (fetchPolicy !== 'no-cache') {\n try {\n this.dataStore.markQueryResult(\n result,\n document,\n variables,\n fetchMoreForQueryId,\n errorPolicy === 'ignore' || errorPolicy === 'all',\n );\n } catch (e) {\n reject(e);\n return;\n }\n } else {\n this.setQuery(queryId, () => ({\n newData: { result: result.data, complete: true },\n }));\n }\n\n this.queryStore.markQueryResult(\n queryId,\n result,\n fetchMoreForQueryId,\n );\n\n this.invalidate(true, queryId, fetchMoreForQueryId);\n\n this.broadcastQueries();\n }\n\n if (result.errors && errorPolicy === 'none') {\n reject(\n new ApolloError({\n graphQLErrors: result.errors,\n }),\n );\n return;\n } else if (errorPolicy === 'all') {\n errorsFromStore = result.errors;\n }\n\n if (fetchMoreForQueryId || fetchPolicy === 'no-cache') {\n // We don't write fetchMore results to the store because this would overwrite\n // the original result in case an @connection directive is used.\n resultFromStore = result.data;\n } else {\n try {\n // ensure result is combined with data already in store\n resultFromStore = this.dataStore.getCache().read({\n variables,\n query: document,\n optimistic: false,\n });\n // this will throw an error if there are missing fields in\n // the results which can happen with errors from the server.\n // tslint:disable-next-line\n } catch (e) {}\n }\n },\n error: (error: ApolloError) => {\n this.fetchQueryRejectFns.delete(reject);\n\n this.setQuery(queryId, ({ subscriptions }) => ({\n subscriptions: subscriptions.filter(x => x !== subscription),\n }));\n\n reject(error);\n },\n complete: () => {\n this.fetchQueryRejectFns.delete(reject);\n\n this.setQuery(queryId, ({ subscriptions }) => ({\n subscriptions: subscriptions.filter(x => x !== subscription),\n }));\n\n resolve({\n data: resultFromStore,\n errors: errorsFromStore,\n loading: false,\n networkStatus: NetworkStatus.ready,\n stale: false,\n });\n },\n });\n\n this.setQuery(queryId, ({ subscriptions }) => ({\n subscriptions: subscriptions.concat([subscription]),\n }));\n\n }).catch(error => {\n this.fetchQueryRejectFns.delete(rejectFetchPromise);\n throw error;\n });\n }\n\n // Refetches a query given that query's name. Refetches\n // all ObservableQuery instances associated with the query name.\n private refetchQueryByName(queryName: string) {\n const refetchedQueries = this.queryIdsByName[queryName];\n // early return if the query named does not exist (not yet fetched)\n // this used to warn but it may be inteneded behavoir to try and refetch\n // un called queries because they could be on different routes\n if (refetchedQueries === undefined) return;\n return Promise.all(\n refetchedQueries\n .map(id => this.getQuery(id).observableQuery)\n .filter(x => !!x)\n .map((x: ObservableQuery<any>) => x.refetch()),\n );\n }\n\n private generateRequestId() {\n const requestId = this.idCounter;\n this.idCounter++;\n return requestId;\n }\n\n private getQuery(queryId: string) {\n return (\n this.queries.get(queryId) || {\n listeners: [],\n invalidated: false,\n document: null,\n newData: null,\n lastRequestId: null,\n observableQuery: null,\n subscriptions: [],\n }\n );\n }\n\n private setQuery(queryId: string, updater: (prev: QueryInfo) => any) {\n const prev = this.getQuery(queryId);\n const newInfo = { ...prev, ...updater(prev) };\n this.queries.set(queryId, newInfo);\n }\n\n private invalidate(\n invalidated: boolean,\n queryId?: string,\n fetchMoreForQueryId?: string,\n ) {\n if (queryId) this.setQuery(queryId, () => ({ invalidated }));\n\n if (fetchMoreForQueryId) {\n this.setQuery(fetchMoreForQueryId, () => ({ invalidated }));\n }\n }\n\n private buildOperationForLink(\n document: DocumentNode,\n variables: any,\n extraContext?: any,\n ) {\n const cache = this.dataStore.getCache();\n\n return {\n query: cache.transformForLink\n ? cache.transformForLink(document)\n : document,\n variables,\n operationName: getOperationName(document) || undefined,\n context: {\n ...extraContext,\n cache,\n // getting an entry's cache key is useful for cacheResolvers & state-link\n getCacheKey: (obj: { __typename: string; id: string | number }) => {\n if ((cache as any).config) {\n // on the link, we just want the id string, not the full id value from toIdValue\n return (cache as any).config.dataIdFromObject(obj);\n } else {\n throw new Error(\n 'To use context.getCacheKey, you need to use a cache that has a configurable dataIdFromObject, like apollo-cache-inmemory.',\n );\n }\n },\n clientAwareness: this.clientAwareness,\n },\n };\n }\n\n public checkInFlight(queryId: string) {\n const query = this.queryStore.get(queryId);\n\n return (\n query &&\n query.networkStatus !== NetworkStatus.ready &&\n query.networkStatus !== NetworkStatus.error\n );\n }\n\n // Map from client ID to { interval, options }.\n public pollingInfoByQueryId = new Map<string, {\n interval: number;\n lastPollTimeMs: number;\n options: WatchQueryOptions;\n }>();\n\n private nextPoll: {\n time: number;\n timeout: NodeJS.Timeout;\n } | null = null;\n\n public startPollingQuery(\n options: WatchQueryOptions,\n queryId: string,\n listener?: QueryListener,\n ): string {\n const { pollInterval } = options;\n\n if (!pollInterval) {\n throw new Error(\n 'Attempted to start a polling query without a polling interval.',\n );\n }\n\n // Do not poll in SSR mode\n if (!this.ssrMode) {\n this.pollingInfoByQueryId.set(queryId, {\n interval: pollInterval,\n // Avoid polling until at least pollInterval milliseconds from now.\n // The -10 is a fudge factor to help with tests that rely on simulated\n // timeouts via jest.runTimersToTime.\n lastPollTimeMs: Date.now() - 10,\n options: {\n ...options,\n fetchPolicy: 'network-only',\n },\n });\n\n if (listener) {\n this.addQueryListener(queryId, listener);\n }\n\n this.schedulePoll(pollInterval);\n }\n\n return queryId;\n }\n\n public stopPollingQuery(queryId: string) {\n // Since the master polling interval dynamically adjusts to the contents of\n // this.pollingInfoByQueryId, stopping a query from polling is as easy as\n // removing it from the map.\n this.pollingInfoByQueryId.delete(queryId);\n }\n\n // Calling this method ensures a poll will happen within the specified time\n // limit, canceling any pending polls that would not happen in time.\n private schedulePoll(timeLimitMs: number) {\n const now = Date.now();\n\n if (this.nextPoll) {\n if (timeLimitMs < this.nextPoll.time - now) {\n // The next poll will happen too far in the future, so cancel it, and\n // fall through to scheduling a new timeout.\n clearTimeout(this.nextPoll.timeout);\n } else {\n // The next poll will happen within timeLimitMs, so all is well.\n return;\n }\n }\n\n this.nextPoll = {\n // Estimated time when the timeout will fire.\n time: now + timeLimitMs,\n\n timeout: setTimeout(() => {\n this.nextPoll = null;\n let nextTimeLimitMs = Infinity;\n\n this.pollingInfoByQueryId.forEach((info, queryId) => {\n // Pick next timeout according to current minimum interval.\n if (info.interval < nextTimeLimitMs) {\n nextTimeLimitMs = info.interval;\n }\n\n if (!this.checkInFlight(queryId)) {\n // If this query was last polled more than interval milliseconds\n // ago, poll it now. Note that there may be a small delay between\n // the desired polling time and the actual polling time (equal to\n // at most the minimum polling interval across all queries), but\n // that's the tradeoff to batching polling intervals.\n if (Date.now() - info.lastPollTimeMs >= info.interval) {\n const updateLastPollTime = () => {\n info.lastPollTimeMs = Date.now();\n };\n this.fetchQuery(queryId, info.options, FetchType.poll).then(\n // Set info.lastPollTimeMs after the fetch completes, whether\n // or not it succeeded. Promise.prototype.finally would be nice\n // here, but we don't have a polyfill for that at the moment,\n // and this code has historically silenced errors, which is not\n // the behavior of .finally(updateLastPollTime).\n updateLastPollTime,\n updateLastPollTime\n );\n }\n }\n });\n\n // If there were no entries in this.pollingInfoByQueryId, then\n // nextTimeLimitMs will still be Infinity, so this.schedulePoll will\n // not be called, thus ending the master polling interval.\n if (isFinite(nextTimeLimitMs)) {\n this.schedulePoll(nextTimeLimitMs);\n }\n }, timeLimitMs),\n };\n }\n}\n","import { ExecutionResult, DocumentNode } from 'graphql';\nimport { ApolloCache, Cache, DataProxy } from 'apollo-cache';\n\nimport { QueryStoreValue } from '../data/queries';\nimport {\n getOperationName,\n tryFunctionOrLogError,\n graphQLResultHasError,\n} from 'apollo-utilities';\nimport { MutationQueryReducer } from '../core/types';\n\nexport type QueryWithUpdater = {\n updater: MutationQueryReducer<Object>;\n query: QueryStoreValue;\n};\n\nexport interface DataWrite {\n rootId: string;\n result: any;\n document: DocumentNode;\n operationName: string | null;\n variables: Object;\n}\n\nexport class DataStore<TSerialized> {\n private cache: ApolloCache<TSerialized>;\n\n constructor(initialCache: ApolloCache<TSerialized>) {\n this.cache = initialCache;\n }\n\n public getCache(): ApolloCache<TSerialized> {\n return this.cache;\n }\n\n public markQueryResult(\n result: ExecutionResult,\n document: DocumentNode,\n variables: any,\n fetchMoreForQueryId: string | undefined,\n ignoreErrors: boolean = false,\n ) {\n let writeWithErrors = !graphQLResultHasError(result);\n if (ignoreErrors && graphQLResultHasError(result) && result.data) {\n writeWithErrors = true;\n }\n if (!fetchMoreForQueryId && writeWithErrors) {\n this.cache.write({\n result: result.data,\n dataId: 'ROOT_QUERY',\n query: document,\n variables: variables,\n });\n }\n }\n\n public markSubscriptionResult(\n result: ExecutionResult,\n document: DocumentNode,\n variables: any,\n ) {\n // the subscription interface should handle not sending us results we no longer subscribe to.\n // XXX I don't think we ever send in an object with errors, but we might in the future...\n if (!graphQLResultHasError(result)) {\n this.cache.write({\n result: result.data,\n dataId: 'ROOT_SUBSCRIPTION',\n query: document,\n variables: variables,\n });\n }\n }\n\n public markMutationInit(mutation: {\n mutationId: string;\n document: DocumentNode;\n variables: any;\n updateQueries: { [queryId: string]: QueryWithUpdater };\n update: ((proxy: DataProxy, mutationResult: Object) => void) | undefined;\n optimisticResponse: Object | Function | undefined;\n }) {\n if (mutation.optimisticResponse) {\n let optimistic: Object;\n if (typeof mutation.optimisticResponse === 'function') {\n optimistic = mutation.optimisticResponse(mutation.variables);\n } else {\n optimistic = mutation.optimisticResponse;\n }\n\n const changeFn = () => {\n this.markMutationResult({\n mutationId: mutation.mutationId,\n result: { data: optimistic },\n document: mutation.document,\n variables: mutation.variables,\n updateQueries: mutation.updateQueries,\n update: mutation.update,\n });\n };\n\n this.cache.recordOptimisticTransaction(c => {\n const orig = this.cache;\n this.cache = c;\n\n try {\n changeFn();\n } finally {\n this.cache = orig;\n }\n }, mutation.mutationId);\n }\n }\n\n public markMutationResult(mutation: {\n mutationId: string;\n result: ExecutionResult;\n document: DocumentNode;\n variables: any;\n updateQueries: { [queryId: string]: QueryWithUpdater };\n update: ((proxy: DataProxy, mutationResult: Object) => void) | undefined;\n }) {\n // Incorporate the result from this mutation into the store\n if (!graphQLResultHasError(mutation.result)) {\n const cacheWrites: Cache.WriteOptions[] = [];\n cacheWrites.push({\n result: mutation.result.data,\n dataId: 'ROOT_MUTATION',\n query: mutation.document,\n variables: mutation.variables,\n });\n\n if (mutation.updateQueries) {\n Object.keys(mutation.updateQueries)\n .filter(id => mutation.updateQueries[id])\n .forEach(queryId => {\n const { query, updater } = mutation.updateQueries[queryId];\n // Read the current query result from the store.\n const { result: currentQueryResult, complete } = this.cache.diff({\n query: query.document,\n variables: query.variables,\n returnPartialData: true,\n optimistic: false,\n });\n\n if (!complete) {\n return;\n }\n\n // Run our reducer using the current query result and the mutation result.\n const nextQueryResult = tryFunctionOrLogError(() =>\n updater(currentQueryResult, {\n mutationResult: mutation.result,\n queryName: getOperationName(query.document) || undefined,\n queryVariables: query.variables,\n }),\n );\n\n // Write the modified result back into the store if we got a new result.\n if (nextQueryResult) {\n cacheWrites.push({\n result: nextQueryResult,\n dataId: 'ROOT_QUERY',\n query: query.document,\n variables: query.variables,\n });\n }\n });\n }\n\n this.cache.performTransaction(c => {\n cacheWrites.forEach(write => c.write(write));\n });\n\n // If the mutation has some writes associated with it then we need to\n // apply those writes to the store by running this reducer again with a\n // write action.\n const update = mutation.update;\n if (update) {\n this.cache.performTransaction(c => {\n tryFunctionOrLogError(() => update(c, mutation.result));\n });\n }\n }\n }\n\n public markMutationComplete({\n mutationId,\n optimisticResponse,\n }: {\n mutationId: string;\n optimisticResponse?: any;\n }) {\n if (!optimisticResponse) return;\n this.cache.removeOptimistic(mutationId);\n }\n\n public markUpdateQueryResult(\n document: DocumentNode,\n variables: any,\n newResult: any,\n ) {\n this.cache.write({\n result: newResult,\n dataId: 'ROOT_QUERY',\n variables,\n query: document,\n });\n }\n\n public reset(): Promise<void> {\n return this.cache.reset();\n }\n}\n","export const version = 'local';\n","import {\n ApolloLink,\n Operation,\n NextLink,\n FetchResult,\n GraphQLRequest,\n execute,\n} from 'apollo-link';\nimport { ExecutionResult, DocumentNode } from 'graphql';\nimport { ApolloCache, DataProxy } from 'apollo-cache';\nimport {\n isProduction,\n removeConnectionDirectiveFromDocument,\n} from 'apollo-utilities';\n\nimport { QueryManager } from './core/QueryManager';\nimport { ApolloQueryResult, OperationVariables } from './core/types';\nimport { ObservableQuery } from './core/ObservableQuery';\n\nimport { Observable } from './util/Observable';\n\nimport {\n QueryBaseOptions,\n QueryOptions,\n WatchQueryOptions,\n SubscriptionOptions,\n MutationOptions,\n ModifiableWatchQueryOptions,\n MutationBaseOptions,\n} from './core/watchQueryOptions';\n\nimport { DataStore } from './data/store';\n\nimport { version } from './version';\n\nexport interface DefaultOptions {\n watchQuery?: ModifiableWatchQueryOptions;\n query?: QueryBaseOptions;\n mutate?: MutationBaseOptions;\n}\n\nlet hasSuggestedDevtools = false;\n\nexport type ApolloClientOptions<TCacheShape> = {\n link: ApolloLink;\n cache: ApolloCache<TCacheShape>;\n ssrMode?: boolean;\n ssrForceFetchDelay?: number;\n connectToDevTools?: boolean;\n queryDeduplication?: boolean;\n defaultOptions?: DefaultOptions;\n name?: string;\n version?: string;\n};\n\n/**\n * This is the primary Apollo Client class. It is used to send GraphQL documents (i.e. queries\n * and mutations) to a GraphQL spec-compliant server over a {@link NetworkInterface} instance,\n * receive results from the server and cache the results in a store. It also delivers updates\n * to GraphQL queries through {@link Observable} instances.\n */\nexport default class ApolloClient<TCacheShape> implements DataProxy {\n public link: ApolloLink;\n public store: DataStore<TCacheShape>;\n public cache: ApolloCache<TCacheShape>;\n private queryManager: QueryManager<TCacheShape> | undefined;\n public disableNetworkFetches: boolean;\n public version: string;\n public queryDeduplication: boolean;\n public defaultOptions: DefaultOptions = {};\n\n private devToolsHookCb: Function;\n private proxy: ApolloCache<TCacheShape> | undefined;\n private ssrMode: boolean;\n private resetStoreCallbacks: Array<() => Promise<any>> = [];\n private clearStoreCallbacks: Array<() => Promise<any>> = [];\n private clientAwareness: Record<string, string> = {};\n\n /**\n * Constructs an instance of {@link ApolloClient}.\n *\n * @param link The {@link ApolloLink} over which GraphQL documents will be resolved into a response.\n *\n * @param cache The initial cache to use in the data store.\n *\n * @param ssrMode Determines whether this is being run in Server Side Rendering (SSR) mode.\n *\n * @param ssrForceFetchDelay Determines the time interval before we force fetch queries for a\n * server side render.\n *\n * @param queryDeduplication If set to false, a query will still be sent to the server even if a query\n * with identical parameters (query, variables, operationName) is already in flight.\n *\n * @param defaultOptions Used to set application wide defaults for the\n * options supplied to `watchQuery`, `query`, or\n * `mutate`.\n *\n * @param name A custom name that can be used to identify this client, when\n * using Apollo client awareness features. E.g. \"iOS\".\n *\n * @param version A custom version that can be used to identify this client,\n * when using Apollo client awareness features. This is the\n * version of your client, which you may want to increment on\n * new builds. This is NOT the version of Apollo Client that\n * you are using.\n */\n constructor(options: ApolloClientOptions<TCacheShape>) {\n const {\n link,\n cache,\n ssrMode = false,\n ssrForceFetchDelay = 0,\n connectToDevTools,\n queryDeduplication = true,\n defaultOptions,\n name: clientAwarenessName,\n version: clientAwarenessVersion,\n } = options;\n\n if (!link || !cache) {\n throw new Error(`\n In order to initialize Apollo Client, you must specify link & cache properties on the config object.\n This is part of the required upgrade when migrating from Apollo Client 1.0 to Apollo Client 2.0.\n For more information, please visit:\n https://www.apollographql.com/docs/react/basics/setup.html\n to help you get started.\n `);\n }\n\n const supportedCache = new Map<DocumentNode, DocumentNode>();\n const supportedDirectives = new ApolloLink(\n (operation: Operation, forward: NextLink) => {\n let result = supportedCache.get(operation.query);\n if (!result) {\n result = removeConnectionDirectiveFromDocument(operation.query);\n supportedCache.set(operation.query, result);\n supportedCache.set(result, result);\n }\n operation.query = result;\n return forward(operation);\n },\n );\n\n // remove apollo-client supported directives\n this.link = supportedDirectives.concat(link);\n this.cache = cache;\n this.store = new DataStore(cache);\n this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0;\n this.queryDeduplication = queryDeduplication;\n this.ssrMode = ssrMode;\n this.defaultOptions = defaultOptions || {};\n\n if (ssrForceFetchDelay) {\n setTimeout(\n () => (this.disableNetworkFetches = false),\n ssrForceFetchDelay,\n );\n }\n\n this.watchQuery = this.watchQuery.bind(this);\n this.query = this.query.bind(this);\n this.mutate = this.mutate.bind(this);\n this.resetStore = this.resetStore.bind(this);\n this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this);\n\n // Attach the client instance to window to let us be found by chrome devtools, but only in\n // development mode\n const defaultConnectToDevTools =\n !isProduction() &&\n typeof window !== 'undefined' &&\n !(window as any).__APOLLO_CLIENT__;\n\n if (\n typeof connectToDevTools === 'undefined'\n ? defaultConnectToDevTools\n : connectToDevTools && typeof window !== 'undefined'\n ) {\n (window as any).__APOLLO_CLIENT__ = this;\n }\n\n /**\n * Suggest installing the devtools for developers who don't have them\n */\n if (!hasSuggestedDevtools && !isProduction()) {\n hasSuggestedDevtools = true;\n if (\n typeof window !== 'undefined' &&\n window.document &&\n window.top === window.self\n ) {\n // First check if devtools is not installed\n if (\n typeof (window as any).__APOLLO_DEVTOOLS_GLOBAL_HOOK__ === 'undefined'\n ) {\n // Only for Chrome\n if (\n window.navigator &&\n window.navigator.userAgent &&\n window.navigator.userAgent.indexOf('Chrome') > -1\n ) {\n // tslint:disable-next-line\n console.debug(\n 'Download the Apollo DevTools ' +\n 'for a better development experience: ' +\n 'https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm',\n );\n }\n }\n }\n }\n\n this.version = version;\n\n if (clientAwarenessName) {\n this.clientAwareness.name = clientAwarenessName;\n }\n\n if (clientAwarenessVersion) {\n this.clientAwareness.version = clientAwarenessVersion;\n }\n }\n /**\n * This watches the cache store of the query according to the options specified and\n * returns an {@link ObservableQuery}. We can subscribe to this {@link ObservableQuery} and\n * receive updated results through a GraphQL observer when the cache store changes.\n * <p /><p />\n * Note that this method is not an implementation of GraphQL subscriptions. Rather,\n * it uses Apollo's store in order to reactively deliver updates to your query results.\n * <p /><p />\n * For example, suppose you call watchQuery on a GraphQL query that fetches a person's\n * first and last name and this person has a particular object identifer, provided by\n * dataIdFromObject. Later, a different query fetches that same person's\n * first and last name and the first name has now changed. Then, any observers associated\n * with the results of the first query will be updated with a new result object.\n * <p /><p />\n * Note that if the cache does not change, the subscriber will *not* be notified.\n * <p /><p />\n * See [here](https://medium.com/apollo-stack/the-concepts-of-graphql-bc68bd819be3#.3mb0cbcmc) for\n * a description of store reactivity.\n */\n public watchQuery<T, TVariables = OperationVariables>(\n options: WatchQueryOptions<TVariables>,\n ): ObservableQuery<T, TVariables> {\n if (this.defaultOptions.watchQuery) {\n options = {\n ...this.defaultOptions.watchQuery,\n ...options,\n } as WatchQueryOptions<TVariables>;\n }\n\n // XXX Overwriting options is probably not the best way to do this long term...\n if (\n this.disableNetworkFetches &&\n (options.fetchPolicy === 'network-only' ||\n options.fetchPolicy === 'cache-and-network')\n ) {\n options = { ...options, fetchPolicy: 'cache-first' };\n }\n\n return this.initQueryManager().watchQuery<T, TVariables>(options);\n }\n\n /**\n * This resolves a single query according to the options specified and\n * returns a {@link Promise} which is either resolved with the resulting data\n * or rejected with an error.\n *\n * @param options An object of type {@link QueryOptions} that allows us to\n * describe how this query should be treated e.g. whether it should hit the\n * server at all or just resolve from the cache, etc.\n */\n public query<T, TVariables = OperationVariables>(\n options: QueryOptions<TVariables>,\n ): Promise<ApolloQueryResult<T>> {\n if (this.defaultOptions.query) {\n options = { ...this.defaultOptions.query, ...options } as QueryOptions<\n TVariables\n >;\n }\n\n if (options.fetchPolicy === 'cache-and-network') {\n throw new Error(\n 'cache-and-network fetchPolicy can only be used with watchQuery',\n );\n }\n\n // XXX Overwriting options is probably not the best way to do this long\n // term...\n if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') {\n options = { ...options, fetchPolicy: 'cache-first' };\n }\n\n return this.initQueryManager().query<T>(options);\n }\n\n /**\n * This resolves a single mutation according to the options specified and returns a\n * {@link Promise} which is either resolved with the resulting data or rejected with an\n * error.\n *\n * It takes options as an object with the following keys and values:\n */\n public mutate<T, TVariables = OperationVariables>(\n options: MutationOptions<T, TVariables>,\n ): Promise<FetchResult<T>> {\n if (this.defaultOptions.mutate) {\n options = {\n ...this.defaultOptions.mutate,\n ...options,\n } as MutationOptions<T, TVariables>;\n }\n\n return this.initQueryManager().mutate<T>(options);\n }\n\n /**\n * This subscribes to a graphql subscription according to the options specified and returns an\n * {@link Observable} which either emits received data or an error.\n */\n public subscribe<T = any, TVariables = OperationVariables>(\n options: SubscriptionOptions<TVariables>,\n ): Observable<T> {\n return this.initQueryManager().startGraphQLSubscription(options);\n }\n\n /**\n * Tries to read some data from the store in the shape of the provided\n * GraphQL query without making a network request. This method will start at\n * the root query. To start at a specific id returned by `dataIdFromObject`\n * use `readFragment`.\n *\n * @param optimistic Set to `true` to allow `readQuery` to return\n * optimistic results. Is `false` by default.\n */\n public readQuery<T, TVariables = OperationVariables>(\n options: DataProxy.Query<TVariables>,\n optimistic: boolean = false,\n ): T | null {\n return this.initProxy().readQuery<T>(options, optimistic);\n }\n\n /**\n * Tries to read some data from the store in the shape of the provided\n * GraphQL fragment without making a network request. This method will read a\n * GraphQL fragment from any arbitrary id that is currently cached, unlike\n * `readQuery` which will only read from the root query.\n *\n * You must pass in a GraphQL document with a single fragment or a document\n * with multiple fragments that represent what you are reading. If you pass\n * in a document with multiple fragments then you must also specify a\n * `fragmentName`.\n *\n * @param optimistic Set to `true` to allow `readFragment` to return\n * optimistic results. Is `false` by default.\n */\n public readFragment<T, TVariables = OperationVariables>(\n options: DataProxy.Fragment<TVariables>,\n optimistic: boolean = false,\n ): T | null {\n return this.initProxy().readFragment<T>(options, optimistic);\n }\n\n /**\n * Writes some data in the shape of the provided GraphQL query directly to\n * the store. This method will start at the root query. To start at a\n * specific id returned by `dataIdFromObject` then use `writeFragment`.\n */\n public writeQuery<TData = any, TVariables = OperationVariables>(\n options: DataProxy.WriteQueryOptions<TData, TVariables>,\n ): void {\n const result = this.initProxy().writeQuery(options);\n this.initQueryManager().broadcastQueries();\n return result;\n }\n\n /**\n * Writes some data in the shape of the provided GraphQL fragment directly to\n * the store. This method will write to a GraphQL fragment from any arbitrary\n * id that is currently cached, unlike `writeQuery` which will only write\n * from the root query.\n *\n * You must pass in a GraphQL document with a single fragment or a document\n * with multiple fragments that represent what you are writing. If you pass\n * in a document with multiple fragments then you must also specify a\n * `fragmentName`.\n */\n public writeFragment<TData = any, TVariables = OperationVariables>(\n options: DataProxy.WriteFragmentOptions<TData, TVariables>,\n ): void {\n const result = this.initProxy().writeFragment(options);\n this.initQueryManager().broadcastQueries();\n return result;\n }\n\n /**\n * Sugar for writeQuery & writeFragment\n * This method will construct a query from the data object passed in.\n * If no id is supplied, writeData will write the data to the root.\n * If an id is supplied, writeData will write a fragment to the object\n * specified by the id in the store.\n *\n * Since you aren't passing in a query to check the shape of the data,\n * you must pass in an object that conforms to the shape of valid GraphQL data.\n */\n public writeData<TData = any>(\n options: DataProxy.WriteDataOptions<TData>,\n ): void {\n const result = this.initProxy().writeData(options);\n this.initQueryManager().broadcastQueries();\n return result;\n }\n\n public __actionHookForDevTools(cb: () => any) {\n this.devToolsHookCb = cb;\n }\n\n public __requestRaw(payload: GraphQLRequest): Observable<ExecutionResult> {\n return execute(this.link, payload);\n }\n\n /**\n * Resets your entire store by clearing out your cache and then re-executing\n * all of your active queries. This makes it so that you may guarantee that\n * there is no data left in your store from a time before you called this\n * method.\n *\n * `resetStore()` is useful when your user just logged out. You’ve removed the\n * user session, and you now want to make sure that any references to data you\n * might have fetched while the user session was active is gone.\n *\n * It is important to remember that `resetStore()` *will* refetch any active\n * queries. This means that any components that might be mounted will execute\n * their queries again using your network interface. If you do not want to\n * re-execute any queries then you should make sure to stop watching any\n * active queries.\n */\n public resetStore(): Promise<ApolloQueryResult<any>[] | null> {\n return Promise.resolve()\n .then(() => {\n return this.queryManager\n ? this.queryManager.clearStore()\n : Promise.resolve(null);\n })\n .then(() => Promise.all(this.resetStoreCallbacks.map(fn => fn())))\n .then(() => {\n return this.queryManager && this.queryManager.reFetchObservableQueries\n ? this.queryManager.reFetchObservableQueries()\n : Promise.resolve(null);\n });\n }\n\n /**\n * Remove all data from the store. Unlike `resetStore`, `clearStore` will\n * not refetch any active queries.\n */\n public clearStore(): Promise<void | null> {\n const { queryManager } = this;\n return Promise.resolve()\n .then(() => Promise.all(this.clearStoreCallbacks.map(fn => fn())))\n .then(\n () =>\n queryManager ? queryManager.clearStore() : Promise.resolve(null),\n );\n }\n\n /**\n * Allows callbacks to be registered that are executed when the store is\n * reset. `onResetStore` returns an unsubscribe function that can be used\n * to remove registered callbacks.\n */\n public onResetStore(cb: () => Promise<any>): () => void {\n this.resetStoreCallbacks.push(cb);\n return () => {\n this.resetStoreCallbacks = this.resetStoreCallbacks.filter(c => c !== cb);\n };\n }\n\n /**\n * Allows callbacks to be registered that are executed when the store is\n * cleared. `onClearStore` returns an unsubscribe function that can be used\n * to remove registered callbacks.\n */\n public onClearStore(cb: () => Promise<any>): () => void {\n this.clearStoreCallbacks.push(cb);\n return () => {\n this.clearStoreCallbacks = this.clearStoreCallbacks.filter(c => c !== cb);\n };\n }\n\n /**\n * Refetches all of your active queries.\n *\n * `reFetchObservableQueries()` is useful if you want to bring the client back to proper state in case of a network outage\n *\n * It is important to remember that `reFetchObservableQueries()` *will* refetch any active\n * queries. This means that any components that might be mounted will execute\n * their queries again using your network interface. If you do not want to\n * re-execute any queries then you should make sure to stop watching any\n * active queries.\n * Takes optional parameter `includeStandby` which will include queries in standby-mode when refetching.\n */\n public reFetchObservableQueries(\n includeStandby?: boolean,\n ): Promise<ApolloQueryResult<any>[]> | Promise<null> {\n return this.queryManager\n ? this.queryManager.reFetchObservableQueries(includeStandby)\n : Promise.resolve(null);\n }\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public extract(optimistic?: boolean): TCacheShape {\n return this.initProxy().extract(optimistic);\n }\n\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public restore(serializedState: TCacheShape): ApolloCache<TCacheShape> {\n return this.initProxy().restore(serializedState);\n }\n\n /**\n * This initializes the query manager that tracks queries and the cache\n */\n private initQueryManager(): QueryManager<TCacheShape> {\n if (!this.queryManager) {\n this.queryManager = new QueryManager({\n link: this.link,\n store: this.store,\n queryDeduplication: this.queryDeduplication,\n ssrMode: this.ssrMode,\n clientAwareness: this.clientAwareness,\n onBroadcast: () => {\n if (this.devToolsHookCb) {\n this.devToolsHookCb({\n action: {},\n state: {\n queries: this.queryManager\n ? this.queryManager.queryStore.getStore()\n : {},\n mutations: this.queryManager\n ? this.queryManager.mutationStore.getStore()\n : {},\n },\n dataWithOptimisticResults: this.cache.extract(true),\n });\n }\n },\n });\n }\n return this.queryManager;\n }\n\n /**\n * Initializes a data proxy for this client instance if one does not already\n * exist and returns either a previously initialized proxy instance or the\n * newly initialized instance.\n */\n private initProxy(): ApolloCache<TCacheShape> {\n if (!this.proxy) {\n this.initQueryManager();\n this.proxy = this.cache;\n }\n return this.proxy;\n }\n}\n","/* tslint:disable */\n\nimport zenObservable from 'zen-observable';\n\nnamespace Observable {\n\n}\n\nimport { ZenObservable } from './types';\n\nexport { ZenObservable };\n\nexport type Observer<T> = ZenObservable.Observer<T>;\nexport type Subscriber<T> = ZenObservable.Subscriber<T>;\nexport type ObservableLike<T> = ZenObservable.ObservableLike<T>;\n\nexport const Observable: {\n new <T>(subscriber: Subscriber<T>): Observable<T>;\n from<R>(\n observable: Observable<R> | ZenObservable.ObservableLike<R> | ArrayLike<R>,\n ): Observable<R>;\n of<R>(...args: Array<R>): Observable<R>;\n} = <any>zenObservable;\n\nexport interface Observable<T> {\n subscribe(\n observerOrNext: ((value: T) => void) | ZenObservable.Observer<T>,\n error?: (error: any) => void,\n complete?: () => void,\n ): ZenObservable.Subscription;\n\n forEach(fn: (value: T) => void): Promise<void>;\n\n map<R>(fn: (value: T) => R): Observable<R>;\n\n filter(fn: (value: T) => boolean): Observable<T>;\n\n reduce<R = T>(\n fn: (previousValue: R | T, currentValue: T) => R | T,\n initialValue?: R | T,\n ): Observable<R | T>;\n\n flatMap<R>(fn: (value: T) => ZenObservable.ObservableLike<R>): Observable<R>;\n\n from<R>(\n observable: Observable<R> | ZenObservable.ObservableLike<R> | ArrayLike<R>,\n ): Observable<R>;\n of<R>(...args: Array<R>): Observable<R>;\n}\n","import { getOperationName } from 'apollo-utilities';\nimport Observable from 'zen-observable-ts';\nimport { print } from 'graphql/language/printer';\n\nimport { GraphQLRequest, Operation } from './types';\nimport { ApolloLink } from './link';\n\nexport function validateOperation(operation: GraphQLRequest): GraphQLRequest {\n const OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (let key of Object.keys(operation)) {\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw new Error(`illegal argument: ${key}`);\n }\n }\n\n return operation;\n}\n\nexport class LinkError extends Error {\n public link: ApolloLink;\n constructor(message?: string, link?: ApolloLink) {\n super(message);\n this.link = link;\n }\n}\n\nexport function isTerminating(link: ApolloLink): boolean {\n return link.request.length <= 1;\n}\n\nexport function toPromise<R>(observable: Observable<R>): Promise<R> {\n let completed = false;\n return new Promise<R>((resolve, reject) => {\n observable.subscribe({\n next: data => {\n if (completed) {\n console.warn(\n `Promise Wrapper does not support multiple results from Observable`,\n );\n } else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\n\n// backwards compat\nexport const makePromise = toPromise;\n\nexport function fromPromise<T>(promise: Promise<T>): Observable<T> {\n return new Observable<T>(observer => {\n promise\n .then((value: T) => {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\n\nexport function fromError<T>(errorValue: any): Observable<T> {\n return new Observable<T>(observer => {\n observer.error(errorValue);\n });\n}\n\nexport function transformOperation(operation: GraphQLRequest): GraphQLRequest {\n const transformedOperation: GraphQLRequest = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n\n // best guess at an operation name\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query)\n : '';\n }\n\n return transformedOperation as Operation;\n}\n\nexport function createOperation(\n starting: any,\n operation: GraphQLRequest,\n): Operation {\n let context = { ...starting };\n const setContext = next => {\n if (typeof next === 'function') {\n context = { ...context, ...next(context) };\n } else {\n context = { ...context, ...next };\n }\n };\n const getContext = () => ({ ...context });\n\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n\n Object.defineProperty(operation, 'toKey', {\n enumerable: false,\n value: () => getKey(operation),\n });\n\n return operation as Operation;\n}\n\nexport function getKey(operation: GraphQLRequest) {\n // XXX we're assuming here that variables will be serialized in the same order.\n // that might not always be true\n return `${print(operation.query)}|${JSON.stringify(operation.variables)}|${\n operation.operationName\n }`;\n}\n","import Observable from 'zen-observable-ts';\n\nimport {\n GraphQLRequest,\n NextLink,\n Operation,\n RequestHandler,\n FetchResult,\n} from './types';\n\nimport {\n validateOperation,\n isTerminating,\n LinkError,\n transformOperation,\n createOperation,\n} from './linkUtils';\n\nconst passthrough = (op, forward) => (forward ? forward(op) : Observable.of());\n\nconst toLink = (handler: RequestHandler | ApolloLink) =>\n typeof handler === 'function' ? new ApolloLink(handler) : handler;\n\nexport const empty = (): ApolloLink =>\n new ApolloLink((op, forward) => Observable.of());\n\nexport const from = (links: ApolloLink[]): ApolloLink => {\n if (links.length === 0) return empty();\n\n return links.map(toLink).reduce((x, y) => x.concat(y));\n};\n\nexport const split = (\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right: ApolloLink | RequestHandler = new ApolloLink(passthrough),\n): ApolloLink => {\n const leftLink = toLink(left);\n const rightLink = toLink(right);\n\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(operation => {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n } else {\n return new ApolloLink((operation, forward) => {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n};\n\n// join two Links together\nexport const concat = (\n first: ApolloLink | RequestHandler,\n second: ApolloLink | RequestHandler,\n) => {\n const firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n console.warn(\n new LinkError(\n `You are calling concat on a terminating link, which will have no effect`,\n firstLink,\n ),\n );\n return firstLink;\n }\n const nextLink = toLink(second);\n\n if (isTerminating(nextLink)) {\n return new ApolloLink(\n operation =>\n firstLink.request(\n operation,\n op => nextLink.request(op) || Observable.of(),\n ) || Observable.of(),\n );\n } else {\n return new ApolloLink((operation, forward) => {\n return (\n firstLink.request(operation, op => {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of()\n );\n });\n }\n};\n\nexport class ApolloLink {\n public static empty = empty;\n public static from = from;\n public static split = split;\n public static execute = execute;\n\n constructor(request?: RequestHandler) {\n if (request) this.request = request;\n }\n\n public split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right: ApolloLink | RequestHandler = new ApolloLink(passthrough),\n ): ApolloLink {\n return this.concat(split(test, left, right));\n }\n\n public concat(next: ApolloLink | RequestHandler): ApolloLink {\n return concat(this, next);\n }\n\n public request(\n operation: Operation,\n forward?: NextLink,\n ): Observable<FetchResult> | null {\n throw new Error('request is not implemented');\n }\n}\n\nexport function execute(\n link: ApolloLink,\n operation: GraphQLRequest,\n): Observable<FetchResult> {\n return (\n link.request(\n createOperation(\n operation.context,\n transformOperation(validateOperation(operation)),\n ),\n ) || Observable.of()\n );\n}\n","// Make sure Map.prototype.set returns the Map instance, per spec.\n// https://github.com/apollographql/apollo-client/issues/4024\nconst testMap = new Map();\nif (testMap.set(1, 2) !== testMap) {\n const { set } = testMap;\n Map.prototype.set = function (...args) {\n set.apply(this, args);\n return this;\n };\n}\n\n// Make sure Set.prototype.add returns the Set instance, per spec.\nconst testSet = new Set();\nif (testSet.add(3) !== testSet) {\n const { add } = testSet;\n Set.prototype.add = function (...args) {\n add.apply(this, args);\n return this;\n };\n}\n\nconst frozen = {};\nif (typeof Object.freeze === 'function') {\n Object.freeze(frozen);\n}\n\ntry {\n // If non-extensible objects can't be stored as keys in a Map, make sure we\n // do not freeze/seal/etc. an object without first attempting to put it in a\n // Map. For example, this gives the React Native Map polyfill a chance to tag\n // objects before they become non-extensible:\n // https://github.com/facebook/react-native/blob/98a6f19d7c/Libraries/vendor/core/Map.js#L44-L50\n // https://github.com/apollographql/react-apollo/issues/2442#issuecomment-426489517\n testMap.set(frozen, frozen).delete(frozen);\n} catch {\n const wrap = (method: <T>(obj: T) => T): typeof method => {\n return method && (obj => {\n try {\n // If .set succeeds, also call .delete to avoid leaking memory.\n testMap.set(obj, obj).delete(obj);\n } finally {\n // If .set or .delete fails, the exception will be silently swallowed\n // by this return-from-finally statement:\n return method.call(Object, obj);\n }\n });\n };\n Object.freeze = wrap(Object.freeze);\n Object.seal = wrap(Object.seal);\n Object.preventExtensions = wrap(Object.preventExtensions);\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n FieldNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nexport function queryFromPojo(obj: any): DocumentNode {\n const op: OperationDefinitionNode = {\n kind: 'OperationDefinition',\n operation: 'query',\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [op],\n };\n\n return out;\n}\n\nexport function fragmentFromPojo(obj: any, typename?: string): DocumentNode {\n const frag: FragmentDefinitionNode = {\n kind: 'FragmentDefinition',\n typeCondition: {\n kind: 'NamedType',\n name: {\n kind: 'Name',\n value: typename || '__FakeType',\n },\n },\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [frag],\n };\n\n return out;\n}\n\nfunction selectionSetFromObj(obj: any): SelectionSetNode {\n if (\n typeof obj === 'number' ||\n typeof obj === 'boolean' ||\n typeof obj === 'string' ||\n typeof obj === 'undefined' ||\n obj === null\n ) {\n // No selection set here\n return null;\n }\n\n if (Array.isArray(obj)) {\n // GraphQL queries don't include arrays\n return selectionSetFromObj(obj[0]);\n }\n\n // Now we know it's an object\n const selections: FieldNode[] = [];\n\n Object.keys(obj).forEach(key => {\n const nestedSelSet: SelectionSetNode = selectionSetFromObj(obj[key]);\n\n const field: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: key,\n },\n selectionSet: nestedSelSet || undefined,\n };\n\n selections.push(field);\n });\n\n const selectionSet: SelectionSetNode = {\n kind: 'SelectionSet',\n selections,\n };\n\n return selectionSet;\n}\n\nexport const justTypenameQuery: DocumentNode = {\n kind: 'Document',\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n name: null,\n variableDefinitions: null,\n directives: [],\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'Field',\n alias: null,\n name: {\n kind: 'Name',\n value: '__typename',\n },\n arguments: [],\n directives: [],\n selectionSet: null,\n },\n ],\n },\n },\n ],\n};\n","import { DocumentNode } from 'graphql';\nimport { getFragmentQueryDocument } from 'apollo-utilities';\n\nimport { DataProxy, Cache } from './types';\nimport { justTypenameQuery, queryFromPojo, fragmentFromPojo } from './utils';\n\nexport type Transaction<T> = (c: ApolloCache<T>) => void;\n\nexport abstract class ApolloCache<TSerialized> implements DataProxy {\n // required to implement\n // core API\n public abstract read<T, TVariables = any>(\n query: Cache.ReadOptions<TVariables>,\n ): T | null;\n public abstract write<TResult = any, TVariables = any>(\n write: Cache.WriteOptions<TResult, TVariables>,\n ): void;\n public abstract diff<T>(query: Cache.DiffOptions): Cache.DiffResult<T>;\n public abstract watch(watch: Cache.WatchOptions): () => void;\n public abstract evict<TVariables = any>(\n query: Cache.EvictOptions<TVariables>,\n ): Cache.EvictionResult;\n public abstract reset(): Promise<void>;\n\n // intializer / offline / ssr API\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public abstract restore(\n serializedState: TSerialized,\n ): ApolloCache<TSerialized>;\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public abstract extract(optimistic?: boolean): TSerialized;\n\n // optimistic API\n public abstract removeOptimistic(id: string): void;\n\n // transactional API\n public abstract performTransaction(\n transaction: Transaction<TSerialized>,\n ): void;\n public abstract recordOptimisticTransaction(\n transaction: Transaction<TSerialized>,\n id: string,\n ): void;\n\n // optional API\n public transformDocument(document: DocumentNode): DocumentNode {\n return document;\n }\n // experimental\n public transformForLink(document: DocumentNode): DocumentNode {\n return document;\n }\n\n // DataProxy API\n /**\n *\n * @param options\n * @param optimistic\n */\n public readQuery<QueryType, TVariables = any>(\n options: DataProxy.Query<TVariables>,\n optimistic: boolean = false,\n ): QueryType | null {\n return this.read({\n query: options.query,\n variables: options.variables,\n optimistic,\n });\n }\n\n public readFragment<FragmentType, TVariables = any>(\n options: DataProxy.Fragment<TVariables>,\n optimistic: boolean = false,\n ): FragmentType | null {\n return this.read({\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n variables: options.variables,\n rootId: options.id,\n optimistic,\n });\n }\n\n public writeQuery<TData = any, TVariables = any>(\n options: Cache.WriteQueryOptions<TData, TVariables>,\n ): void {\n this.write({\n dataId: 'ROOT_QUERY',\n result: options.data,\n query: options.query,\n variables: options.variables,\n });\n }\n\n public writeFragment<TData = any, TVariables = any>(\n options: Cache.WriteFragmentOptions<TData, TVariables>,\n ): void {\n this.write({\n dataId: options.id,\n result: options.data,\n variables: options.variables,\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n });\n }\n\n public writeData<TData = any>({\n id,\n data,\n }: Cache.WriteDataOptions<TData>): void {\n if (typeof id !== 'undefined') {\n let typenameResult = null;\n // Since we can't use fragments without having a typename in the store,\n // we need to make sure we have one.\n // To avoid overwriting an existing typename, we need to read it out first\n // and generate a fake one if none exists.\n try {\n typenameResult = this.read<any>({\n rootId: id,\n optimistic: false,\n query: justTypenameQuery,\n });\n } catch (e) {\n // Do nothing, since an error just means no typename exists\n }\n\n // tslint:disable-next-line\n const __typename =\n (typenameResult && typenameResult.__typename) || '__ClientData';\n\n // Add a type here to satisfy the inmemory cache\n const dataToWrite = Object.assign({ __typename }, data);\n\n this.writeFragment({\n id,\n fragment: fragmentFromPojo(dataToWrite, __typename),\n data: dataToWrite,\n });\n } else {\n this.writeQuery({ query: queryFromPojo(data), data });\n }\n }\n}\n","import { isTest, warnOnceInDevelopment, IdValue } from 'apollo-utilities';\n\nimport {\n ReadStoreContext,\n FragmentMatcherInterface,\n PossibleTypesMap,\n IntrospectionResultData,\n} from './types';\n\nlet haveWarned = false;\n\n/**\n * This fragment matcher is very basic and unable to match union or interface type conditions\n */\nexport class HeuristicFragmentMatcher implements FragmentMatcherInterface {\n constructor() {\n // do nothing\n }\n\n public ensureReady() {\n return Promise.resolve();\n }\n\n public canBypassInit() {\n return true; // we don't need to initialize this fragment matcher.\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ): boolean | 'heuristic' {\n const obj = context.store.get(idValue.id);\n\n if (!obj && idValue.id === 'ROOT_QUERY') {\n return true;\n }\n\n if (!obj) {\n return false;\n }\n\n if (!obj.__typename) {\n if (!haveWarned) {\n console.warn(`You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments.`);\n console.warn(\n 'Could not find __typename on Fragment ',\n typeCondition,\n obj,\n );\n console.warn(\n `DEPRECATION WARNING: using fragments without __typename is unsupported behavior ` +\n `and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now.`,\n );\n\n /* istanbul ignore if */\n if (!isTest()) {\n // When running tests, we want to print the warning every time\n haveWarned = true;\n }\n }\n\n return 'heuristic';\n }\n\n if (obj.__typename === typeCondition) {\n return true;\n }\n\n // XXX here we reach an issue - we don't know if this fragment should match or not. It's either:\n // 1. A fragment on a non-matching concrete type or interface or union\n // 2. A fragment on a matching interface or union\n // If it's 1, we don't want to return anything, if it's 2 we want to match. We can't tell the\n // difference, so we warn the user, but still try to match it (backcompat).\n warnOnceInDevelopment(\n 'You are using the simple (heuristic) fragment matcher, but your ' +\n 'queries contain union or interface types. Apollo Client will not be ' +\n 'able to accurately map fragments. To make this error go away, use ' +\n 'the `IntrospectionFragmentMatcher` as described in the docs: ' +\n 'https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher',\n 'error',\n );\n\n return 'heuristic';\n }\n}\n\nexport class IntrospectionFragmentMatcher implements FragmentMatcherInterface {\n private isReady: boolean;\n private possibleTypesMap: PossibleTypesMap;\n\n constructor(options?: {\n introspectionQueryResultData?: IntrospectionResultData;\n }) {\n if (options && options.introspectionQueryResultData) {\n this.possibleTypesMap = this.parseIntrospectionResult(\n options.introspectionQueryResultData,\n );\n this.isReady = true;\n } else {\n this.isReady = false;\n }\n\n this.match = this.match.bind(this);\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ) {\n if (!this.isReady) {\n // this should basically never happen in proper use.\n throw new Error(\n 'FragmentMatcher.match() was called before FragmentMatcher.init()',\n );\n }\n\n const obj = context.store.get(idValue.id);\n\n if (!obj) {\n return false;\n }\n\n if (!obj.__typename) {\n throw new Error(\n `Cannot match fragment because __typename property is missing: ${JSON.stringify(\n obj,\n )}`,\n );\n }\n\n if (obj.__typename === typeCondition) {\n return true;\n }\n\n const implementingTypes = this.possibleTypesMap[typeCondition];\n if (implementingTypes && implementingTypes.indexOf(obj.__typename) > -1) {\n return true;\n }\n\n return false;\n }\n\n private parseIntrospectionResult(\n introspectionResultData: IntrospectionResultData,\n ): PossibleTypesMap {\n const typeMap: PossibleTypesMap = {};\n introspectionResultData.__schema.types.forEach(type => {\n if (type.kind === 'UNION' || type.kind === 'INTERFACE') {\n typeMap[type.name] = type.possibleTypes.map(\n implementingType => implementingType.name,\n );\n }\n });\n return typeMap;\n }\n}\n","export class CacheKeyNode<KeyType = object> {\n private children: Map<any, CacheKeyNode<KeyType>> | null = null;\n private key: KeyType | null = null;\n\n lookup(...args: any[]): KeyType {\n return this.lookupArray(args);\n }\n\n lookupArray(array: any[]): KeyType {\n let node: CacheKeyNode<KeyType> = this;\n array.forEach(value => {\n node = node.getOrCreate(value);\n });\n return node.key || (node.key = Object.create(null));\n }\n\n getOrCreate(value: any): CacheKeyNode<KeyType> {\n const map = this.children || (this.children = new Map());\n let node = map.get(value);\n if (!node) {\n map.set(value, (node = new CacheKeyNode<KeyType>()));\n }\n return node;\n }\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\nimport { wrap, OptimisticWrapperFunction } from 'optimism';\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class DepTrackingCache implements NormalizedCache {\n // Wrapper function produced by the optimism library, used to depend on\n // dataId strings, for easy invalidation of specific IDs.\n private depend: OptimisticWrapperFunction<(dataId: string) => StoreObject>;\n\n constructor(private data: NormalizedCacheObject = Object.create(null)) {\n this.depend = wrap((\n dataId: string,\n ) => this.data[dataId], {\n disposable: true,\n makeCacheKey(dataId: string) {\n return dataId;\n }\n });\n }\n\n public toObject(): NormalizedCacheObject {\n return this.data;\n }\n\n public get(dataId: string): StoreObject {\n this.depend(dataId);\n return this.data[dataId];\n }\n\n public set(dataId: string, value: StoreObject) {\n const oldValue = this.data[dataId];\n if (value !== oldValue) {\n this.data[dataId] = value;\n this.depend.dirty(dataId);\n }\n }\n\n public delete(dataId: string): void {\n if (hasOwn.call(this.data, dataId)) {\n delete this.data[dataId];\n this.depend.dirty(dataId);\n }\n }\n\n public clear(): void {\n this.replace(null);\n }\n\n public replace(newData: NormalizedCacheObject): void {\n if (newData) {\n Object.keys(newData).forEach(dataId => {\n this.set(dataId, newData[dataId]);\n });\n Object.keys(this.data).forEach(dataId => {\n if (! hasOwn.call(newData, dataId)) {\n this.delete(dataId);\n }\n });\n } else {\n Object.keys(this.data).forEach(dataId => {\n this.delete(dataId);\n });\n }\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new DepTrackingCache(seed);\n}\n","import {\n assign,\n getDefaultValues,\n getQueryDefinition,\n isEqual,\n DirectiveInfo,\n FragmentMap,\n IdValue,\n StoreValue,\n argumentsObjectFromField,\n createFragmentMap,\n getDirectiveInfoFromField,\n getFragmentDefinitions,\n getMainDefinition,\n getStoreKeyName,\n isField,\n isIdValue,\n isInlineFragment,\n isJsonValue,\n resultKeyNameFromField,\n shouldInclude,\n toIdValue,\n} from 'apollo-utilities';\n\nimport { Cache } from 'apollo-cache';\n\nimport {\n ReadStoreContext,\n DiffQueryAgainstStoreOptions,\n ReadQueryOptions,\n StoreObject,\n} from './types';\n\nimport {\n DocumentNode,\n FieldNode,\n FragmentDefinitionNode,\n InlineFragmentNode,\n SelectionSetNode,\n} from 'graphql';\n\nimport { wrap } from 'optimism';\nimport { CacheKeyNode } from './cacheKeys';\nimport { DepTrackingCache } from './depTrackingCache';\n\nexport type VariableMap = { [name: string]: any };\n\nexport type FragmentMatcher = (\n rootValue: any,\n typeCondition: string,\n context: ReadStoreContext,\n) => boolean | 'heuristic';\n\ntype ExecContext = {\n query: DocumentNode;\n fragmentMap: FragmentMap;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n fragmentMatcher: FragmentMatcher;\n};\n\ntype ExecInfo = {\n resultKey: string;\n directives: DirectiveInfo;\n};\n\nexport type ExecResultMissingField = {\n object: StoreObject;\n fieldName: string;\n tolerable: boolean;\n};\n\nexport type ExecResult<R = any> = {\n result: R;\n // Empty array if no missing fields encountered while computing result.\n missing?: ExecResultMissingField[];\n};\n\ntype ExecStoreQueryOptions = {\n query: DocumentNode;\n rootValue: IdValue;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n // Default matcher always matches all fragments\n fragmentMatcher: FragmentMatcher;\n};\n\ntype ExecSelectionSetOptions = {\n selectionSet: SelectionSetNode;\n rootValue: any;\n execContext: ExecContext;\n};\n\nexport class StoreReader {\n constructor(\n private cacheKeyRoot = new CacheKeyNode,\n ) {\n const reader = this;\n const {\n executeStoreQuery,\n executeSelectionSet,\n } = reader;\n\n this.executeStoreQuery = wrap((options: ExecStoreQueryOptions) => {\n return executeStoreQuery.call(this, options);\n }, {\n makeCacheKey({\n query,\n rootValue,\n contextValue,\n variableValues,\n fragmentMatcher,\n }: ExecStoreQueryOptions) {\n // The result of executeStoreQuery can be safely cached only if the\n // underlying store is capable of tracking dependencies and invalidating\n // the cache when relevant data have changed.\n if (contextValue.store instanceof DepTrackingCache) {\n return reader.cacheKeyRoot.lookup(\n query,\n contextValue.store,\n fragmentMatcher,\n JSON.stringify(variableValues),\n rootValue.id,\n );\n }\n return;\n }\n });\n\n this.executeSelectionSet = wrap((options: ExecSelectionSetOptions) => {\n return executeSelectionSet.call(this, options);\n }, {\n makeCacheKey({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions) {\n if (execContext.contextValue.store instanceof DepTrackingCache) {\n return reader.cacheKeyRoot.lookup(\n selectionSet,\n execContext.contextValue.store,\n execContext.fragmentMatcher,\n JSON.stringify(execContext.variableValues),\n rootValue.id,\n );\n }\n return;\n }\n });\n }\n\n /**\n * Resolves the result of a query solely from the store (i.e. never hits the server).\n *\n * @param {Store} store The {@link NormalizedCache} used by Apollo for the `data` portion of the\n * store.\n *\n * @param {DocumentNode} query The query document to resolve from the data available in the store.\n *\n * @param {Object} [variables] A map from the name of a variable to its value. These variables can\n * be referenced by the query document.\n *\n * @param {any} previousResult The previous result returned by this function for the same query.\n * If nothing in the store changed since that previous result then values from the previous result\n * will be returned to preserve referential equality.\n */\n public readQueryFromStore<QueryType>(\n options: ReadQueryOptions,\n ): QueryType {\n const optsPatch = { returnPartialData: false };\n\n return this.diffQueryAgainstStore<QueryType>({\n ...options,\n ...optsPatch,\n }).result;\n }\n\n /**\n * Given a store and a query, return as much of the result as possible and\n * identify if any data was missing from the store.\n * @param {DocumentNode} query A parsed GraphQL query document\n * @param {Store} store The Apollo Client store object\n * @param {any} previousResult The previous result returned by this function for the same query\n * @return {result: Object, complete: [boolean]}\n */\n public diffQueryAgainstStore<T>({\n store,\n query,\n variables,\n previousResult,\n returnPartialData = true,\n rootId = 'ROOT_QUERY',\n fragmentMatcherFunction,\n config,\n }: DiffQueryAgainstStoreOptions): Cache.DiffResult<T> {\n // Throw the right validation error by trying to find a query in the document\n const queryDefinition = getQueryDefinition(query);\n\n variables = assign({}, getDefaultValues(queryDefinition), variables);\n\n const context: ReadStoreContext = {\n // Global settings\n store,\n dataIdFromObject: (config && config.dataIdFromObject) || null,\n cacheRedirects: (config && config.cacheRedirects) || {},\n };\n\n const execResult = this.executeStoreQuery({\n query,\n rootValue: {\n type: 'id',\n id: rootId,\n generated: true,\n typename: 'Query',\n },\n contextValue: context,\n variableValues: variables,\n fragmentMatcher: fragmentMatcherFunction,\n });\n\n const hasMissingFields =\n execResult.missing && execResult.missing.length > 0;\n\n if (hasMissingFields && ! returnPartialData) {\n execResult.missing.forEach(info => {\n if (info.tolerable) return;\n throw new Error(\n `Can't find field ${info.fieldName} on object ${JSON.stringify(\n info.object,\n null,\n 2,\n )}.`,\n );\n });\n }\n\n if (previousResult) {\n if (isEqual(previousResult, execResult.result)) {\n execResult.result = previousResult;\n }\n }\n\n return {\n result: execResult.result,\n complete: !hasMissingFields,\n };\n }\n\n /**\n * Based on graphql function from graphql-js:\n *\n * graphql(\n * schema: GraphQLSchema,\n * requestString: string,\n * rootValue?: ?any,\n * contextValue?: ?any,\n * variableValues?: ?{[key: string]: any},\n * operationName?: ?string\n * ): Promise<GraphQLResult>\n *\n * The default export as of graphql-anywhere is sync as of 4.0,\n * but below is an exported alternative that is async.\n * In the 5.0 version, this will be the only export again\n * and it will be async\n *\n */\n private executeStoreQuery({\n query,\n rootValue,\n contextValue,\n variableValues,\n // Default matcher always matches all fragments\n fragmentMatcher = defaultFragmentMatcher,\n }: ExecStoreQueryOptions): ExecResult {\n const mainDefinition = getMainDefinition(query);\n const fragments = getFragmentDefinitions(query);\n const fragmentMap = createFragmentMap(fragments);\n const execContext: ExecContext = {\n query,\n fragmentMap,\n contextValue,\n variableValues,\n fragmentMatcher,\n };\n\n return this.executeSelectionSet({\n selectionSet: mainDefinition.selectionSet,\n rootValue,\n execContext,\n });\n }\n\n private executeSelectionSet({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions): ExecResult {\n const { fragmentMap, contextValue, variableValues: variables } = execContext;\n const finalResult: ExecResult = {\n result: {},\n };\n\n const objectsToMerge: { [key: string]: any }[] = [];\n\n const object: StoreObject = contextValue.store.get(rootValue.id);\n\n const typename =\n (object && object.__typename) ||\n (rootValue.id === 'ROOT_QUERY' && 'Query') ||\n void 0;\n\n function handleMissing<T>(result: ExecResult<T>): T {\n if (result.missing) {\n finalResult.missing = finalResult.missing || [];\n finalResult.missing.push(...result.missing);\n }\n return result.result;\n }\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n // Skip this entirely\n return;\n }\n\n if (isField(selection)) {\n const fieldResult = handleMissing(\n this.executeField(object, typename, selection, execContext),\n );\n\n if (typeof fieldResult !== 'undefined') {\n objectsToMerge.push({\n [resultKeyNameFromField(selection)]: fieldResult,\n });\n }\n\n } else {\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // This is a named fragment\n fragment = fragmentMap[selection.name.value];\n\n if (!fragment) {\n throw new Error(`No fragment named ${selection.name.value}`);\n }\n }\n\n const typeCondition = fragment.typeCondition.name.value;\n\n const match = execContext.fragmentMatcher(rootValue, typeCondition, contextValue);\n if (match) {\n let fragmentExecResult = this.executeSelectionSet({\n selectionSet: fragment.selectionSet,\n rootValue,\n execContext,\n });\n\n if (match === 'heuristic' && fragmentExecResult.missing) {\n fragmentExecResult = {\n ...fragmentExecResult,\n missing: fragmentExecResult.missing.map(info => {\n return { ...info, tolerable: true };\n }),\n };\n }\n\n objectsToMerge.push(handleMissing(fragmentExecResult));\n }\n }\n });\n\n // Perform a single merge at the end so that we can avoid making more\n // defensive shallow copies than necessary.\n merge(finalResult.result, objectsToMerge);\n\n return finalResult;\n }\n\n private executeField(\n object: StoreObject,\n typename: string | void,\n field: FieldNode,\n execContext: ExecContext,\n ): ExecResult {\n const { variableValues: variables, contextValue } = execContext;\n const fieldName = field.name.value;\n const args = argumentsObjectFromField(field, variables);\n\n const info: ExecInfo = {\n resultKey: resultKeyNameFromField(field),\n directives: getDirectiveInfoFromField(field, variables),\n };\n\n const readStoreResult = readStoreResolver(\n object,\n typename,\n fieldName,\n args,\n contextValue,\n info,\n );\n\n if (Array.isArray(readStoreResult.result)) {\n return this.combineExecResults(\n readStoreResult,\n this.executeSubSelectedArray(\n field,\n readStoreResult.result,\n execContext,\n ),\n );\n }\n\n // Handle all scalar types here\n if (!field.selectionSet) {\n assertSelectionSetForIdValue(field, readStoreResult.result);\n return readStoreResult;\n }\n\n // From here down, the field has a selection set, which means it's trying to\n // query a GraphQLObjectType\n if (readStoreResult.result == null) {\n // Basically any field in a GraphQL response can be null, or missing\n return readStoreResult;\n }\n\n // Returned value is an object, and the query has a sub-selection. Recurse.\n return this.combineExecResults(\n readStoreResult,\n this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: readStoreResult.result,\n execContext,\n }),\n );\n }\n\n private combineExecResults<T>(\n ...execResults: ExecResult<T>[]\n ): ExecResult<T> {\n let missing: ExecResultMissingField[] = null;\n execResults.forEach(execResult => {\n if (execResult.missing) {\n missing = missing || [];\n missing.push(...execResult.missing);\n }\n });\n return {\n result: execResults.pop().result,\n missing,\n };\n }\n\n private executeSubSelectedArray(\n field: FieldNode,\n result: any[],\n execContext: ExecContext,\n ): ExecResult {\n let missing: ExecResultMissingField[] = null;\n\n function handleMissing<T>(childResult: ExecResult<T>): T {\n if (childResult.missing) {\n missing = missing || [];\n missing.push(...childResult.missing);\n }\n\n return childResult.result;\n }\n\n result = result.map(item => {\n // null value in array\n if (item === null) {\n return null;\n }\n\n // This is a nested array, recurse\n if (Array.isArray(item)) {\n return handleMissing(this.executeSubSelectedArray(field, item, execContext));\n }\n\n // This is an object, run the selection set on it\n if (field.selectionSet) {\n return handleMissing(this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: item,\n execContext,\n }));\n }\n\n assertSelectionSetForIdValue(field, item);\n\n return item;\n });\n\n return { result, missing };\n }\n}\n\nfunction assertSelectionSetForIdValue(\n field: FieldNode,\n value: any,\n) {\n if (!field.selectionSet && isIdValue(value)) {\n throw new Error(\n `Missing selection set for object of type ${\n value.typename\n } returned for query field ${field.name.value}`\n );\n }\n}\n\nfunction defaultFragmentMatcher() {\n return true;\n}\n\nexport function assertIdValue(idValue: IdValue) {\n if (!isIdValue(idValue)) {\n throw new Error(`Encountered a sub-selection on the query, but the store doesn't have \\\nan object reference. This should never happen during normal use unless you have custom code \\\nthat is directly manipulating the store; please file an issue.`);\n }\n}\n\nfunction readStoreResolver(\n object: StoreObject,\n typename: string | void,\n fieldName: string,\n args: any,\n context: ReadStoreContext,\n { resultKey, directives }: ExecInfo,\n): ExecResult<StoreValue> {\n let storeKeyName = fieldName;\n if (args || directives) {\n // We happen to know here that getStoreKeyName returns its first\n // argument unmodified if there are no args or directives, so we can\n // avoid calling the function at all in that case, as a small but\n // important optimization to this frequently executed code.\n storeKeyName = getStoreKeyName(storeKeyName, args, directives);\n }\n\n let fieldValue: StoreValue | void = void 0;\n\n if (object) {\n fieldValue = object[storeKeyName];\n\n if (\n typeof fieldValue === 'undefined' &&\n context.cacheRedirects &&\n typeof typename === 'string'\n ) {\n // Look for the type in the custom resolver map\n const type = context.cacheRedirects[typename];\n if (type) {\n // Look for the field in the custom resolver map\n const resolver = type[fieldName];\n if (resolver) {\n fieldValue = resolver(object, args, {\n getCacheKey(storeObj: StoreObject) {\n return toIdValue({\n id: context.dataIdFromObject(storeObj),\n typename: storeObj.__typename,\n });\n },\n });\n }\n }\n }\n }\n\n if (typeof fieldValue === 'undefined') {\n return {\n result: fieldValue,\n missing: [{\n object,\n fieldName: storeKeyName,\n tolerable: false,\n }],\n };\n }\n\n if (isJsonValue(fieldValue)) {\n fieldValue = fieldValue.json;\n }\n\n return {\n result: fieldValue,\n };\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nfunction merge(\n target: { [key: string]: any },\n sources: { [key: string]: any }[]\n) {\n const pastCopies: any[] = [];\n sources.forEach(source => {\n mergeHelper(target, source, pastCopies);\n });\n return target;\n}\n\nfunction mergeHelper(\n target: { [key: string]: any },\n source: { [key: string]: any },\n pastCopies: any[],\n) {\n if (source !== null && typeof source === 'object') {\n // In case the target has been frozen, make an extensible copy so that\n // we can merge properties into the copy.\n if (Object.isExtensible && !Object.isExtensible(target)) {\n target = shallowCopyForMerge(target, pastCopies);\n }\n\n Object.keys(source).forEach(sourceKey => {\n const sourceValue = source[sourceKey];\n if (hasOwn.call(target, sourceKey)) {\n const targetValue = target[sourceKey];\n if (sourceValue !== targetValue) {\n // When there is a key collision, we need to make a shallow copy of\n // target[sourceKey] so the merge does not modify any source objects.\n // To avoid making unnecessary copies, we use a simple array to track\n // past copies, instead of a Map, since the number of copies should\n // be relatively small, and some Map polyfills modify their keys.\n target[sourceKey] = mergeHelper(\n shallowCopyForMerge(targetValue, pastCopies),\n sourceValue,\n pastCopies,\n );\n }\n } else {\n // If there is no collision, the target can safely share memory with\n // the source, and the recursion can terminate here.\n target[sourceKey] = sourceValue;\n }\n });\n }\n\n return target;\n}\n\nfunction shallowCopyForMerge<T>(value: T, pastCopies: any[]): T {\n if (\n value !== null &&\n typeof value === 'object' &&\n pastCopies.indexOf(value) < 0\n ) {\n if (Array.isArray(value)) {\n value = (value as any).slice(0);\n } else {\n value = { ...(value as any) };\n }\n pastCopies.push(value);\n }\n return value;\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\n\nexport class ObjectCache implements NormalizedCache {\n constructor(protected data: NormalizedCacheObject = Object.create(null)) {}\n\n public toObject() {\n return this.data;\n }\n public get(dataId: string) {\n return this.data[dataId];\n }\n\n public set(dataId: string, value: StoreObject) {\n this.data[dataId] = value;\n }\n\n public delete(dataId: string) {\n this.data[dataId] = void 0;\n }\n\n public clear() {\n this.data = Object.create(null);\n }\n\n public replace(newData: NormalizedCacheObject) {\n this.data = newData || Object.create(null);\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new ObjectCache(seed);\n}\n","import {\n SelectionSetNode,\n FieldNode,\n DocumentNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n} from 'graphql';\nimport { FragmentMatcher } from './readFromStore';\n\nimport {\n assign,\n createFragmentMap,\n FragmentMap,\n getDefaultValues,\n getFragmentDefinitions,\n getOperationDefinition,\n IdValue,\n isField,\n isIdValue,\n isInlineFragment,\n isProduction,\n resultKeyNameFromField,\n shouldInclude,\n storeKeyNameFromField,\n StoreValue,\n toIdValue,\n isEqual,\n} from 'apollo-utilities';\n\nimport { ObjectCache } from './objectCache';\nimport { defaultNormalizedCacheFactory } from './depTrackingCache';\n\nimport {\n IdGetter,\n NormalizedCache,\n ReadStoreContext,\n StoreObject,\n} from './types';\n\nexport class WriteError extends Error {\n public type = 'WriteError';\n}\n\nexport function enhanceErrorWithDocument(error: Error, document: DocumentNode) {\n // XXX A bit hacky maybe ...\n const enhancedError = new WriteError(\n `Error writing result to store for query:\\n ${JSON.stringify(document)}`,\n );\n enhancedError.message += '\\n' + error.message;\n enhancedError.stack = error.stack;\n return enhancedError;\n}\n\nexport type WriteContext = {\n readonly store: NormalizedCache;\n readonly processedData?: { [x: string]: FieldNode[] };\n readonly variables?: any;\n readonly dataIdFromObject?: IdGetter;\n readonly fragmentMap?: FragmentMap;\n readonly fragmentMatcherFunction?: FragmentMatcher;\n};\n\nexport class StoreWriter {\n /**\n * Writes the result of a query to the store.\n *\n * @param result The result object returned for the query document.\n *\n * @param query The query document whose result we are writing to the store.\n *\n * @param store The {@link NormalizedCache} used by Apollo for the `data` portion of the store.\n *\n * @param variables A map from the name of a variable to its value. These variables can be\n * referenced by the query document.\n *\n * @param dataIdFromObject A function that returns an object identifier given a particular result\n * object. See the store documentation for details and an example of this function.\n *\n * @param fragmentMatcherFunction A function to use for matching fragment conditions in GraphQL documents\n */\n public writeQueryToStore({\n query,\n result,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n query: DocumentNode;\n result: Object;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n return this.writeResultToStore({\n dataId: 'ROOT_QUERY',\n result,\n document: query,\n store,\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n });\n }\n\n public writeResultToStore({\n dataId,\n result,\n document,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n dataId: string;\n result: any;\n document: DocumentNode;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n // XXX TODO REFACTOR: this is a temporary workaround until query normalization is made to work with documents.\n const operationDefinition = getOperationDefinition(document);\n\n try {\n return this.writeSelectionSetToStore({\n result,\n dataId,\n selectionSet: operationDefinition.selectionSet,\n context: {\n store,\n processedData: {},\n variables: assign(\n {},\n getDefaultValues(operationDefinition),\n variables,\n ),\n dataIdFromObject,\n fragmentMap: createFragmentMap(getFragmentDefinitions(document)),\n fragmentMatcherFunction,\n },\n });\n } catch (e) {\n throw enhanceErrorWithDocument(e, document);\n }\n }\n\n public writeSelectionSetToStore({\n result,\n dataId,\n selectionSet,\n context,\n }: {\n dataId: string;\n result: any;\n selectionSet: SelectionSetNode;\n context: WriteContext;\n }): NormalizedCache {\n const { variables, store, fragmentMap } = context;\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n return;\n }\n\n if (isField(selection)) {\n const resultFieldKey: string = resultKeyNameFromField(selection);\n const value: any = result[resultFieldKey];\n\n if (typeof value !== 'undefined') {\n this.writeFieldToStore({\n dataId,\n value,\n field: selection,\n context,\n });\n } else {\n // if this is a defered field we don't need to throw / wanr\n const isDefered =\n selection.directives &&\n selection.directives.length &&\n selection.directives.some(\n directive => directive.name && directive.name.value === 'defer',\n );\n\n if (!isDefered && context.fragmentMatcherFunction) {\n // XXX We'd like to throw an error, but for backwards compatibility's sake\n // we just print a warning for the time being.\n //throw new WriteError(`Missing field ${resultFieldKey} in ${JSON.stringify(result, null, 2).substring(0, 100)}`);\n if (!isProduction()) {\n console.warn(\n `Missing field ${resultFieldKey} in ${JSON.stringify(\n result,\n null,\n 2,\n ).substring(0, 100)}`,\n );\n }\n }\n }\n } else {\n // This is not a field, so it must be a fragment, either inline or named\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // Named fragment\n fragment = (fragmentMap || {})[selection.name.value];\n\n if (!fragment) {\n throw new Error(`No fragment named ${selection.name.value}.`);\n }\n }\n\n let matches = true;\n if (context.fragmentMatcherFunction && fragment.typeCondition) {\n // TODO we need to rewrite the fragment matchers for this to work properly and efficiently\n // Right now we have to pretend that we're passing in an idValue and that there's a store\n // on the context.\n const idValue = toIdValue({ id: 'self', typename: undefined });\n const fakeContext: ReadStoreContext = {\n // NOTE: fakeContext always uses ObjectCache\n // since this is only to ensure the return value of 'matches'\n store: new ObjectCache({ self: result }),\n cacheRedirects: {},\n };\n const match = context.fragmentMatcherFunction(\n idValue,\n fragment.typeCondition.name.value,\n fakeContext,\n );\n if (!isProduction() && match === 'heuristic') {\n console.error('WARNING: heuristic fragment matching going on!');\n }\n matches = !!match;\n }\n\n if (matches) {\n this.writeSelectionSetToStore({\n result,\n selectionSet: fragment.selectionSet,\n dataId,\n context,\n });\n }\n }\n });\n\n return store;\n }\n\n private writeFieldToStore({\n field,\n value,\n dataId,\n context,\n }: {\n field: FieldNode;\n value: any;\n dataId: string;\n context: WriteContext;\n }) {\n const { variables, dataIdFromObject, store } = context;\n\n let storeValue: StoreValue;\n let storeObject: StoreObject;\n\n const storeFieldName: string = storeKeyNameFromField(field, variables);\n\n // If this is a scalar value...\n if (!field.selectionSet || value === null) {\n storeValue =\n value != null && typeof value === 'object'\n ? // If the scalar value is a JSON blob, we have to \"escape\" it so it can’t pretend to be\n // an id.\n { type: 'json', json: value }\n : // Otherwise, just store the scalar directly in the store.\n value;\n } else if (Array.isArray(value)) {\n const generatedId = `${dataId}.${storeFieldName}`;\n\n storeValue = this.processArrayValue(\n value,\n generatedId,\n field.selectionSet,\n context,\n );\n } else {\n // It's an object\n let valueDataId = `${dataId}.${storeFieldName}`;\n let generated = true;\n\n // We only prepend the '$' if the valueDataId isn't already a generated\n // id.\n if (!isGeneratedId(valueDataId)) {\n valueDataId = '$' + valueDataId;\n }\n\n if (dataIdFromObject) {\n const semanticId = dataIdFromObject(value);\n\n // We throw an error if the first character of the id is '$. This is\n // because we use that character to designate an Apollo-generated id\n // and we use the distinction between user-desiginated and application-provided\n // ids when managing overwrites.\n if (semanticId && isGeneratedId(semanticId)) {\n throw new Error(\n 'IDs returned by dataIdFromObject cannot begin with the \"$\" character.',\n );\n }\n\n if (\n semanticId ||\n (typeof semanticId === 'number' && semanticId === 0)\n ) {\n valueDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(valueDataId, field, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: valueDataId,\n result: value,\n selectionSet: field.selectionSet,\n context,\n });\n }\n\n // We take the id and escape it (i.e. wrap it with an enclosing object).\n // This allows us to distinguish IDs from normal scalars.\n const typename = value.__typename;\n storeValue = toIdValue({ id: valueDataId, typename }, generated);\n\n // check if there was a generated id at the location where we're\n // about to place this new id. If there was, we have to merge the\n // data from that id with the data we're about to write in the store.\n storeObject = store.get(dataId);\n const escapedId =\n storeObject && (storeObject[storeFieldName] as IdValue | undefined);\n if (escapedId !== storeValue && isIdValue(escapedId)) {\n const hadTypename = escapedId.typename !== undefined;\n const hasTypename = typename !== undefined;\n const typenameChanged =\n hadTypename && hasTypename && escapedId.typename !== typename;\n\n // If there is already a real id in the store and the current id we\n // are dealing with is generated, we throw an error.\n // One exception we allow is when the typename has changed, which occurs\n // when schema defines a union, both with and without an ID in the same place.\n // checks if we \"lost\" the read id\n if (generated && !escapedId.generated && !typenameChanged) {\n throw new Error(\n `Store error: the application attempted to write an object with no provided id` +\n ` but the store already contains an id of ${\n escapedId.id\n } for this object. The selectionSet` +\n ` that was trying to be written is:\\n` +\n JSON.stringify(field),\n );\n }\n // checks if we \"lost\" the typename\n if (hadTypename && !hasTypename) {\n throw new Error(\n `Store error: the application attempted to write an object with no provided typename` +\n ` but the store already contains an object with typename of ${\n escapedId.typename\n } for the object of id ${escapedId.id}. The selectionSet` +\n ` that was trying to be written is:\\n` +\n JSON.stringify(field),\n );\n }\n\n if (escapedId.generated) {\n // We should only merge if it's an object of the same type,\n // otherwise we should delete the generated object\n if (typenameChanged) {\n // Only delete the generated object when the old object was\n // inlined, and the new object is not. This is indicated by\n // the old id being generated, and the new id being real.\n if (!generated) {\n store.delete(escapedId.id);\n }\n } else {\n mergeWithGenerated(escapedId.id, (storeValue as IdValue).id, store);\n }\n }\n }\n }\n\n storeObject = store.get(dataId);\n if (!storeObject || !isEqual(storeValue, storeObject[storeFieldName])) {\n store.set(dataId, {\n ...storeObject,\n [storeFieldName]: storeValue,\n });\n }\n }\n\n private processArrayValue(\n value: any[],\n generatedId: string,\n selectionSet: SelectionSetNode,\n context: WriteContext,\n ): any[] {\n return value.map((item: any, index: any) => {\n if (item === null) {\n return null;\n }\n\n let itemDataId = `${generatedId}.${index}`;\n\n if (Array.isArray(item)) {\n return this.processArrayValue(item, itemDataId, selectionSet, context);\n }\n\n let generated = true;\n\n if (context.dataIdFromObject) {\n const semanticId = context.dataIdFromObject(item);\n\n if (semanticId) {\n itemDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: itemDataId,\n result: item,\n selectionSet,\n context,\n });\n }\n\n return toIdValue(\n { id: itemDataId, typename: item.__typename },\n generated,\n );\n });\n }\n}\n\n// Checks if the id given is an id that was generated by Apollo\n// rather than by dataIdFromObject.\nfunction isGeneratedId(id: string): boolean {\n return id[0] === '$';\n}\n\nfunction mergeWithGenerated(\n generatedKey: string,\n realKey: string,\n cache: NormalizedCache,\n): boolean {\n if (generatedKey === realKey) {\n return false;\n }\n\n const generated = cache.get(generatedKey);\n const real = cache.get(realKey);\n let madeChanges = false;\n\n Object.keys(generated).forEach(key => {\n const value = generated[key];\n const realValue = real[key];\n\n if (\n isIdValue(value) &&\n isGeneratedId(value.id) &&\n isIdValue(realValue) &&\n !isEqual(value, realValue) &&\n mergeWithGenerated(value.id, realValue.id, cache)\n ) {\n madeChanges = true;\n }\n });\n\n cache.delete(generatedKey);\n const newRealValue = { ...generated, ...real };\n\n if (isEqual(newRealValue, real)) {\n return madeChanges;\n }\n\n cache.set(realKey, newRealValue);\n return true;\n}\n\nfunction isDataProcessed(\n dataId: string,\n field: FieldNode | SelectionSetNode,\n processedData?: { [x: string]: (FieldNode | SelectionSetNode)[] },\n): boolean {\n if (!processedData) {\n return false;\n }\n\n if (processedData[dataId]) {\n if (processedData[dataId].indexOf(field) >= 0) {\n return true;\n } else {\n processedData[dataId].push(field);\n }\n } else {\n processedData[dataId] = [field];\n }\n\n return false;\n}\n","// Make builtins like Map and Set safe to use with non-extensible objects.\nimport './fixPolyfills';\n\nimport { DocumentNode } from 'graphql';\n\nimport { Cache, ApolloCache, Transaction } from 'apollo-cache';\n\nimport { addTypenameToDocument } from 'apollo-utilities';\n\nimport { wrap } from 'optimism';\n\nimport { HeuristicFragmentMatcher } from './fragmentMatcher';\nimport {\n ApolloReducerConfig,\n NormalizedCache,\n NormalizedCacheObject,\n} from './types';\n\nimport { StoreReader } from './readFromStore';\nimport { StoreWriter } from './writeToStore';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { CacheKeyNode } from './cacheKeys';\nimport { ObjectCache } from './objectCache';\n\nexport interface InMemoryCacheConfig extends ApolloReducerConfig {\n resultCaching?: boolean;\n}\n\nconst defaultConfig: InMemoryCacheConfig = {\n fragmentMatcher: new HeuristicFragmentMatcher(),\n dataIdFromObject: defaultDataIdFromObject,\n addTypename: true,\n resultCaching: true,\n};\n\nexport function defaultDataIdFromObject(result: any): string | null {\n if (result.__typename) {\n if (result.id !== undefined) {\n return `${result.__typename}:${result.id}`;\n }\n if (result._id !== undefined) {\n return `${result.__typename}:${result._id}`;\n }\n }\n return null;\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class OptimisticCacheLayer extends ObjectCache {\n constructor(\n public readonly optimisticId: string,\n // OptimisticCacheLayer objects always wrap some other parent cache, so\n // this.parent should never be null.\n public readonly parent: NormalizedCache,\n public readonly transaction: Transaction<NormalizedCacheObject>,\n ) {\n super(Object.create(null));\n }\n\n public toObject(): NormalizedCacheObject {\n return {\n ...this.parent.toObject(),\n ...this.data,\n };\n }\n\n // All the other accessor methods of ObjectCache work without knowing about\n // this.parent, but the get method needs to be overridden to implement the\n // fallback this.parent.get(dataId) behavior.\n public get(dataId: string) {\n return hasOwn.call(this.data, dataId)\n ? this.data[dataId]\n : this.parent.get(dataId);\n }\n}\n\nexport class InMemoryCache extends ApolloCache<NormalizedCacheObject> {\n private data: NormalizedCache;\n private optimisticData: NormalizedCache;\n\n protected config: InMemoryCacheConfig;\n private watches = new Set<Cache.WatchOptions>();\n private addTypename: boolean;\n private typenameDocumentCache = new Map<DocumentNode, DocumentNode>();\n private storeReader: StoreReader;\n private storeWriter: StoreWriter;\n private cacheKeyRoot = new CacheKeyNode();\n\n // Set this while in a transaction to prevent broadcasts...\n // don't forget to turn it back on!\n private silenceBroadcast: boolean = false;\n\n constructor(config: InMemoryCacheConfig = {}) {\n super();\n this.config = { ...defaultConfig, ...config };\n\n // backwards compat\n if ((this.config as any).customResolvers) {\n console.warn(\n 'customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).customResolvers;\n }\n\n if ((this.config as any).cacheResolvers) {\n console.warn(\n 'cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).cacheResolvers;\n }\n\n this.addTypename = this.config.addTypename;\n\n // Passing { resultCaching: false } in the InMemoryCache constructor options\n // will completely disable dependency tracking, which will improve memory\n // usage but worsen the performance of repeated reads.\n this.data = this.config.resultCaching\n ? new DepTrackingCache()\n : new ObjectCache();\n\n // When no optimistic writes are currently active, cache.optimisticData ===\n // cache.data, so there are no additional layers on top of the actual data.\n // When an optimistic update happens, this.optimisticData will become a\n // linked list of OptimisticCacheLayer objects that terminates with the\n // original this.data cache object.\n this.optimisticData = this.data;\n\n this.storeReader = new StoreReader(this.cacheKeyRoot);\n this.storeWriter = new StoreWriter();\n\n const cache = this;\n const { maybeBroadcastWatch } = cache;\n this.maybeBroadcastWatch = wrap((c: Cache.WatchOptions) => {\n return maybeBroadcastWatch.call(this, c);\n }, {\n makeCacheKey(c: Cache.WatchOptions) {\n if (c.optimistic) {\n // If we're reading optimistic data, it doesn't matter if this.data\n // is a DepTrackingCache, since it will be ignored.\n return;\n }\n\n if (c.previousResult) {\n // If a previousResult was provided, assume the caller would prefer\n // to compare the previous data to the new data to determine whether\n // to broadcast, so we should disable caching by returning here, to\n // give maybeBroadcastWatch a chance to do that comparison.\n return;\n }\n\n if (cache.data instanceof DepTrackingCache) {\n // Return a cache key (thus enabling caching) only if we're currently\n // using a data store that can track cache dependencies.\n return cache.cacheKeyRoot.lookup(\n c.query,\n JSON.stringify(c.variables),\n );\n }\n }\n });\n }\n\n public restore(data: NormalizedCacheObject): this {\n if (data) this.data.replace(data);\n return this;\n }\n\n public extract(optimistic: boolean = false): NormalizedCacheObject {\n return (optimistic ? this.optimisticData : this.data).toObject();\n }\n\n public read<T>(options: Cache.ReadOptions): T | null {\n if (typeof options.rootId === 'string' &&\n typeof this.data.get(options.rootId) === 'undefined') {\n return null;\n }\n\n return this.storeReader.readQueryFromStore({\n store: options.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(options.query),\n variables: options.variables,\n rootId: options.rootId,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n previousResult: options.previousResult,\n config: this.config,\n });\n }\n\n public write(write: Cache.WriteOptions): void {\n this.storeWriter.writeResultToStore({\n dataId: write.dataId,\n result: write.result,\n variables: write.variables,\n document: this.transformDocument(write.query),\n store: this.data,\n dataIdFromObject: this.config.dataIdFromObject,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n });\n\n this.broadcastWatches();\n }\n\n public diff<T>(query: Cache.DiffOptions): Cache.DiffResult<T> {\n return this.storeReader.diffQueryAgainstStore({\n store: query.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(query.query),\n variables: query.variables,\n returnPartialData: query.returnPartialData,\n previousResult: query.previousResult,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n config: this.config,\n });\n }\n\n public watch(watch: Cache.WatchOptions): () => void {\n this.watches.add(watch);\n\n return () => {\n this.watches.delete(watch);\n };\n }\n\n public evict(query: Cache.EvictOptions): Cache.EvictionResult {\n throw new Error(`eviction is not implemented on InMemory Cache`);\n }\n\n public reset(): Promise<void> {\n this.data.clear();\n this.broadcastWatches();\n\n return Promise.resolve();\n }\n\n public removeOptimistic(idToRemove: string) {\n const toReapply: OptimisticCacheLayer[] = [];\n let removedCount = 0;\n let layer = this.optimisticData;\n\n while (layer instanceof OptimisticCacheLayer) {\n if (layer.optimisticId === idToRemove) {\n ++removedCount;\n } else {\n toReapply.push(layer);\n }\n layer = layer.parent;\n }\n\n if (removedCount > 0) {\n // Reset this.optimisticData to the first non-OptimisticCacheLayer object,\n // which is almost certainly this.data.\n this.optimisticData = layer;\n\n // Reapply the layers whose optimistic IDs do not match the removed ID.\n while (toReapply.length > 0) {\n const layer = toReapply.pop();\n this.performTransaction(layer.transaction, layer.optimisticId);\n }\n\n this.broadcastWatches();\n }\n }\n\n public performTransaction(\n transaction: Transaction<NormalizedCacheObject>,\n // This parameter is not part of the performTransaction signature inherited\n // from the ApolloCache abstract class, but it's useful because it saves us\n // from duplicating this implementation in recordOptimisticTransaction.\n optimisticId?: string,\n ) {\n const { data, silenceBroadcast } = this;\n this.silenceBroadcast = true;\n\n if (typeof optimisticId === 'string') {\n // Add a new optimistic layer and temporarily make this.data refer to\n // that layer for the duration of the transaction.\n this.data = this.optimisticData = new OptimisticCacheLayer(\n // Note that there can be multiple layers with the same optimisticId.\n // When removeOptimistic(id) is called for that id, all matching layers\n // will be removed, and the remaining layers will be reapplied.\n optimisticId,\n this.optimisticData,\n transaction,\n );\n }\n\n try {\n transaction(this);\n } finally {\n this.silenceBroadcast = silenceBroadcast;\n this.data = data;\n }\n\n // This broadcast does nothing if this.silenceBroadcast is true.\n this.broadcastWatches();\n }\n\n public recordOptimisticTransaction(\n transaction: Transaction<NormalizedCacheObject>,\n id: string,\n ) {\n return this.performTransaction(transaction, id);\n }\n\n public transformDocument(document: DocumentNode): DocumentNode {\n if (this.addTypename) {\n let result = this.typenameDocumentCache.get(document);\n if (!result) {\n result = addTypenameToDocument(document);\n this.typenameDocumentCache.set(document, result);\n // If someone calls transformDocument and then mistakenly passes the\n // result back into an API that also calls transformDocument, make sure\n // we don't keep creating new query documents.\n this.typenameDocumentCache.set(result, result);\n }\n return result;\n }\n return document;\n }\n\n protected broadcastWatches() {\n if (!this.silenceBroadcast) {\n this.watches.forEach(c => this.maybeBroadcastWatch(c));\n }\n }\n\n // This method is wrapped in the constructor so that it will be called only\n // if the data that would be broadcast has changed.\n private maybeBroadcastWatch(c: Cache.WatchOptions) {\n c.callback(\n this.diff({\n query: c.query,\n variables: c.variables,\n previousResult: c.previousResult && c.previousResult(),\n optimistic: c.optimistic,\n }),\n );\n }\n}\n","import { Operation } from 'apollo-link';\nimport { print } from 'graphql/language/printer';\n\n/*\n * Http Utilities: shared across links that make http requests\n */\n\n// XXX replace with actual typings when available\ndeclare var AbortController: any;\n\n//Used for any Error for data from the server\n//on a request with a Status >= 300\n//response contains no data or errors\nexport type ServerError = Error & {\n response: Response;\n result: Record<string, any>;\n statusCode: number;\n};\n\n//Thrown when server's resonse is cannot be parsed\nexport type ServerParseError = Error & {\n response: Response;\n statusCode: number;\n bodyText: string;\n};\n\nexport type ClientParseError = Error & {\n parseError: Error;\n};\n\nexport interface HttpQueryOptions {\n includeQuery?: boolean;\n includeExtensions?: boolean;\n}\n\nexport interface HttpConfig {\n http?: HttpQueryOptions;\n options?: any;\n headers?: any; //overrides headers in options\n credentials?: any;\n}\n\nexport interface UriFunction {\n (operation: Operation): string;\n}\n\n// The body of a GraphQL-over-HTTP-POST request.\nexport interface Body {\n query?: string;\n operationName?: string;\n variables?: Record<string, any>;\n extensions?: Record<string, any>;\n}\n\nexport interface HttpOptions {\n /**\n * The URI to use when fetching operations.\n *\n * Defaults to '/graphql'.\n */\n uri?: string | UriFunction;\n\n /**\n * Passes the extensions field to your graphql server.\n *\n * Defaults to false.\n */\n includeExtensions?: boolean;\n\n /**\n * A `fetch`-compatible API to use when making requests.\n */\n fetch?: GlobalFetch['fetch'];\n\n /**\n * An object representing values to be sent as headers on the request.\n */\n headers?: any;\n\n /**\n * The credentials policy you want to use for the fetch call.\n */\n credentials?: string;\n\n /**\n * Any overrides of the fetch options argument to pass to the fetch call.\n */\n fetchOptions?: any;\n}\n\nconst defaultHttpOptions: HttpQueryOptions = {\n includeQuery: true,\n includeExtensions: false,\n};\n\nconst defaultHeaders = {\n // headers are case insensitive (https://stackoverflow.com/a/5259004)\n accept: '*/*',\n 'content-type': 'application/json',\n};\n\nconst defaultOptions = {\n method: 'POST',\n};\n\nexport const fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions,\n};\n\nexport const throwServerError = (response, result, message) => {\n const error = new Error(message) as ServerError;\n\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n\n throw error;\n};\n\n//TODO: when conditional types come in ts 2.8, operations should be a generic type that extends Operation | Array<Operation>\nexport const parseAndCheckHttpResponse = operations => (response: Response) => {\n return (\n response\n .text()\n .then(bodyText => {\n try {\n return JSON.parse(bodyText);\n } catch (err) {\n const parseError = err as ServerParseError;\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n return Promise.reject(parseError);\n }\n })\n //TODO: when conditional types come out then result should be T extends Array ? Array<FetchResult> : FetchResult\n .then((result: any) => {\n if (response.status >= 300) {\n //Network error\n throwServerError(\n response,\n result,\n `Response not successful: Received status code ${response.status}`,\n );\n }\n //TODO should really error per response in a Batch based on properties\n // - could be done in a validation link\n if (\n !Array.isArray(result) &&\n !result.hasOwnProperty('data') &&\n !result.hasOwnProperty('errors')\n ) {\n //Data error\n throwServerError(\n response,\n result,\n `Server response was missing for query '${\n Array.isArray(operations)\n ? operations.map(op => op.operationName)\n : operations.operationName\n }'.`,\n );\n }\n return result;\n })\n );\n};\n\nexport const checkFetcher = (fetcher: GlobalFetch['fetch']) => {\n if (!fetcher && typeof fetch === 'undefined') {\n let library: string = 'unfetch';\n if (typeof window === 'undefined') library = 'node-fetch';\n throw new Error(`\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/${library}.\n\nFor example:\nimport fetch from '${library}';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });`);\n }\n};\n\nexport const createSignalIfSupported = () => {\n if (typeof AbortController === 'undefined')\n return { controller: false, signal: false };\n\n const controller = new AbortController();\n const signal = controller.signal;\n return { controller, signal };\n};\n\nexport const selectHttpOptionsAndBody = (\n operation: Operation,\n fallbackConfig: HttpConfig,\n ...configs: Array<HttpConfig>\n) => {\n let options: HttpConfig & Record<string, any> = {\n ...fallbackConfig.options,\n headers: fallbackConfig.headers,\n credentials: fallbackConfig.credentials,\n };\n let http: HttpQueryOptions = fallbackConfig.http;\n\n /*\n * use the rest of the configs to populate the options\n * configs later in the list will overwrite earlier fields\n */\n configs.forEach(config => {\n options = {\n ...options,\n ...config.options,\n headers: {\n ...options.headers,\n ...config.headers,\n },\n };\n if (config.credentials) options.credentials = config.credentials;\n\n http = {\n ...http,\n ...config.http,\n };\n });\n\n //The body depends on the http options\n const { operationName, extensions, variables, query } = operation;\n const body: Body = { operationName, variables };\n\n if (http.includeExtensions) (body as any).extensions = extensions;\n\n // not sending the query (i.e persisted queries)\n if (http.includeQuery) (body as any).query = print(query);\n\n return {\n options,\n body,\n };\n};\n\nexport const serializeFetchParameter = (p, label) => {\n let serialized;\n try {\n serialized = JSON.stringify(p);\n } catch (e) {\n const parseError = new Error(\n `Network request failed. ${label} is not serializable: ${e.message}`,\n ) as ClientParseError;\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\n\n//selects \"/graphql\" by default\nexport const selectURI = (\n operation,\n fallbackURI?: string | ((operation: Operation) => string),\n) => {\n const context = operation.getContext();\n const contextURI = context.uri;\n\n if (contextURI) {\n return contextURI;\n } else if (typeof fallbackURI === 'function') {\n return fallbackURI(operation);\n } else {\n return (fallbackURI as string) || '/graphql';\n }\n};\n","/* tslint:disable */\n\nimport { ApolloLink, Observable, RequestHandler, fromError } from 'apollo-link';\nimport {\n serializeFetchParameter,\n selectURI,\n parseAndCheckHttpResponse,\n checkFetcher,\n selectHttpOptionsAndBody,\n createSignalIfSupported,\n fallbackHttpConfig,\n Body,\n HttpOptions,\n UriFunction as _UriFunction,\n} from 'apollo-link-http-common';\nimport { DefinitionNode } from 'graphql';\n\nexport namespace HttpLink {\n //TODO Would much rather be able to export directly\n export interface UriFunction extends _UriFunction {}\n export interface Options extends HttpOptions {\n /**\n * If set to true, use the HTTP GET method for query operations. Mutations\n * will still use the method specified in fetchOptions.method (which defaults\n * to POST).\n */\n useGETForQueries?: boolean;\n }\n}\n\n// For backwards compatibility.\nexport import FetchOptions = HttpLink.Options;\nexport import UriFunction = HttpLink.UriFunction;\n\nexport const createHttpLink = (linkOptions: HttpLink.Options = {}) => {\n let {\n uri = '/graphql',\n // use default global fetch is nothing passed in\n fetch: fetcher,\n includeExtensions,\n useGETForQueries,\n ...requestOptions\n } = linkOptions;\n\n // dev warnings to ensure fetch is present\n checkFetcher(fetcher);\n\n //fetcher is set here rather than the destructuring to ensure fetch is\n //declared before referencing it. Reference in the destructuring would cause\n //a ReferenceError\n if (!fetcher) {\n fetcher = fetch;\n }\n\n const linkConfig = {\n http: { includeExtensions },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n\n return new ApolloLink(operation => {\n let chosenURI = selectURI(operation, uri);\n\n const context = operation.getContext();\n\n const contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: context.headers,\n };\n\n //uses fallback, link, and then context to build options\n const { options, body } = selectHttpOptionsAndBody(\n operation,\n fallbackHttpConfig,\n linkConfig,\n contextConfig,\n );\n\n let controller;\n if (!(options as any).signal) {\n const { controller: _controller, signal } = createSignalIfSupported();\n controller = _controller;\n if (controller) (options as any).signal = signal;\n }\n\n // If requested, set method to GET if there are no mutations.\n const definitionIsMutation = (d: DefinitionNode) => {\n return d.kind === 'OperationDefinition' && d.operation === 'mutation';\n };\n if (\n useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)\n ) {\n options.method = 'GET';\n }\n\n if (options.method === 'GET') {\n const { newURI, parseError } = rewriteURIForGET(chosenURI, body);\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n } else {\n try {\n (options as any).body = serializeFetchParameter(body, 'Payload');\n } catch (parseError) {\n return fromError(parseError);\n }\n }\n\n return new Observable(observer => {\n fetcher(chosenURI, options)\n .then(response => {\n operation.setContext({ response });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(result => {\n // we have data and can send it to back up the link chain\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch(err => {\n // fetch was cancelled so its already been cleaned up in the unsubscribe\n if (err.name === 'AbortError') return;\n // if it is a network error, BUT there is graphql result info\n // fire the next observer before calling error\n // this gives apollo-client (and react-apollo) the `graphqlErrors` and `networErrors`\n // to pass to UI\n // this should only happen if we *also* have data as part of the response key per\n // the spec\n if (err.result && err.result.errors && err.result.data) {\n // if we dont' call next, the UI can only show networkError because AC didn't\n // get andy graphqlErrors\n // this is graphql execution result info (i.e errors and possibly data)\n // this is because there is no formal spec how errors should translate to\n // http status codes. So an auth error (401) could have both data\n // from a public field, errors from a private field, and a status of 401\n // {\n // user { // this will have errors\n // firstName\n // }\n // products { // this is public so will have data\n // cost\n // }\n // }\n //\n // the result of above *could* look like this:\n // {\n // data: { products: [{ cost: \"$10\" }] },\n // errors: [{\n // message: 'your session has timed out',\n // path: []\n // }]\n // }\n // status code of above would be a 401\n // in the UI you want to show data where you can, errors as data where you can\n // and use correct http status codes\n observer.next(err.result);\n }\n observer.error(err);\n });\n\n return () => {\n // XXX support canceling this request\n // https://developers.google.com/web/updates/2017/09/abortable-fetch\n if (controller) controller.abort();\n };\n });\n });\n};\n\n// For GET operations, returns the given URI rewritten with parameters, or a\n// parse error.\nfunction rewriteURIForGET(chosenURI: string, body: Body) {\n // Implement the standard HTTP GET serialization, plus 'extensions'. Note\n // the extra level of JSON serialization!\n const queryParams = [];\n const addQueryParam = (key: string, value: string) => {\n queryParams.push(`${key}=${encodeURIComponent(value)}`);\n };\n\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n let serializedVariables;\n try {\n serializedVariables = serializeFetchParameter(\n body.variables,\n 'Variables map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n let serializedExtensions;\n try {\n serializedExtensions = serializeFetchParameter(\n body.extensions,\n 'Extensions map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n\n // Reconstruct the URI with added query params.\n // XXX This assumes that the URI is well-formed and that it doesn't\n // already contain any of these query params. We could instead use the\n // URL API and take a polyfill (whatwg-url@6) for older browsers that\n // don't support URLSearchParams. Note that some browsers (and\n // versions of whatwg-url) support URL but not URLSearchParams!\n let fragment = '',\n preFragment = chosenURI;\n const fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n const queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n const newURI =\n preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI };\n}\n\nexport class HttpLink extends ApolloLink {\n public requester: RequestHandler;\n constructor(opts?: HttpLink.Options) {\n super(createHttpLink(opts).request);\n }\n}\n","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/**\n * The `applyToJSON()` function defines toJSON() and inspect() prototype\n * methods which are aliases for toString().\n */\nexport default function applyToJSON(classObject) {\n classObject.prototype.toJSON = classObject.prototype.inspect = classObject.prototype.toString;\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/**\n * The `applyToStringTag()` function checks first to see if the runtime\n * supports the `Symbol` class and then if the `Symbol.toStringTag` constant\n * is defined as a `Symbol` instance. If both conditions are met, the\n * Symbol.toStringTag property is defined as a getter that returns the\n * supplied class constructor's name.\n *\n * @method applyToStringTag\n *\n * @param {Class<any>} classObject a class such as Object, String, Number but\n * typically one of your own creation through the class keyword; `class A {}`,\n * for example.\n */\nexport default function applyToStringTag(classObject) {\n if (typeof Symbol === 'function' && Symbol.toStringTag) {\n Object.defineProperty(classObject.prototype, Symbol.toStringTag, {\n get: function get() {\n return this.constructor.name;\n }\n });\n }\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/**\n * A replacement for instanceof which includes an error warning when multi-realm\n * constructors are detected.\n */\n// See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production\n// See: https://webpack.js.org/guides/production/\nexport default process.env.NODE_ENV === 'production' ? // eslint-disable-next-line no-shadow\nfunction instanceOf(value, constructor) {\n return value instanceof constructor;\n} : // eslint-disable-next-line no-shadow\nfunction instanceOf(value, constructor) {\n if (value instanceof constructor) {\n return true;\n }\n\n if (value) {\n var valueClass = value.constructor;\n var className = constructor.name;\n\n if (className && valueClass && valueClass.name === className) {\n throw new Error(\"Cannot use \".concat(className, \" \\\"\").concat(value, \"\\\" from another module or realm.\\n\\nEnsure that there is only one instance of \\\"graphql\\\" in the node_modules\\ndirectory. If different versions of \\\"graphql\\\" are the dependencies of other\\nrelied on modules, use \\\"resolutions\\\" to ensure only one version is installed.\\n\\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\\n\\nDuplicate \\\"graphql\\\" modules cannot be used at the same time since different\\nversions may have different capabilities and behavior. The data from one\\nversion used in the function from another could produce confusing and\\nspurious results.\"));\n }\n }\n\n return false;\n};","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/**\n * Used to print values in error messages.\n */\nexport default function inspect(value) {\n switch (_typeof(value)) {\n case 'string':\n return JSON.stringify(value);\n\n case 'function':\n return value.name ? \"[function \".concat(value.name, \"]\") : '[function]';\n\n case 'object':\n if (value) {\n if (typeof value.inspect === 'function') {\n return value.inspect();\n } else if (Array.isArray(value)) {\n return '[' + value.map(inspect).join(', ') + ']';\n }\n\n var properties = Object.keys(value).map(function (k) {\n return \"\".concat(k, \": \").concat(inspect(value[k]));\n }).join(', ');\n return properties ? '{ ' + properties + ' }' : '{}';\n }\n\n return String(value);\n\n default:\n return String(value);\n }\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nexport default function invariant(condition, message) {\n /* istanbul ignore else */\n if (!condition) {\n throw new Error(message);\n }\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/**\n * Creates a keyed JS object from an array, given a function to produce the keys\n * for each value in the array.\n *\n * This provides a convenient lookup for the array items if the key function\n * produces unique results.\n *\n * const phoneBook = [\n * { name: 'Jon', num: '555-1234' },\n * { name: 'Jenny', num: '867-5309' }\n * ]\n *\n * // { Jon: { name: 'Jon', num: '555-1234' },\n * // Jenny: { name: 'Jenny', num: '867-5309' } }\n * const entriesByName = keyMap(\n * phoneBook,\n * entry => entry.name\n * )\n *\n * // { name: 'Jenny', num: '857-6309' }\n * const jennyEntry = entriesByName['Jenny']\n *\n */\nexport default function keyMap(list, keyFn) {\n return list.reduce(function (map, item) {\n return map[keyFn(item)] = item, map;\n }, Object.create(null));\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/**\n * The set of allowed kind values for AST nodes.\n */\nexport var Kind = Object.freeze({\n // Name\n NAME: 'Name',\n // Document\n DOCUMENT: 'Document',\n OPERATION_DEFINITION: 'OperationDefinition',\n VARIABLE_DEFINITION: 'VariableDefinition',\n SELECTION_SET: 'SelectionSet',\n FIELD: 'Field',\n ARGUMENT: 'Argument',\n // Fragments\n FRAGMENT_SPREAD: 'FragmentSpread',\n INLINE_FRAGMENT: 'InlineFragment',\n FRAGMENT_DEFINITION: 'FragmentDefinition',\n // Values\n VARIABLE: 'Variable',\n INT: 'IntValue',\n FLOAT: 'FloatValue',\n STRING: 'StringValue',\n BOOLEAN: 'BooleanValue',\n NULL: 'NullValue',\n ENUM: 'EnumValue',\n LIST: 'ListValue',\n OBJECT: 'ObjectValue',\n OBJECT_FIELD: 'ObjectField',\n // Directives\n DIRECTIVE: 'Directive',\n // Types\n NAMED_TYPE: 'NamedType',\n LIST_TYPE: 'ListType',\n NON_NULL_TYPE: 'NonNullType',\n // Type System Definitions\n SCHEMA_DEFINITION: 'SchemaDefinition',\n OPERATION_TYPE_DEFINITION: 'OperationTypeDefinition',\n // Type Definitions\n SCALAR_TYPE_DEFINITION: 'ScalarTypeDefinition',\n OBJECT_TYPE_DEFINITION: 'ObjectTypeDefinition',\n FIELD_DEFINITION: 'FieldDefinition',\n INPUT_VALUE_DEFINITION: 'InputValueDefinition',\n INTERFACE_TYPE_DEFINITION: 'InterfaceTypeDefinition',\n UNION_TYPE_DEFINITION: 'UnionTypeDefinition',\n ENUM_TYPE_DEFINITION: 'EnumTypeDefinition',\n ENUM_VALUE_DEFINITION: 'EnumValueDefinition',\n INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition',\n // Directive Definitions\n DIRECTIVE_DEFINITION: 'DirectiveDefinition',\n // Type System Extensions\n SCHEMA_EXTENSION: 'SchemaExtension',\n // Type Extensions\n SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension',\n OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension',\n INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension',\n UNION_TYPE_EXTENSION: 'UnionTypeExtension',\n ENUM_TYPE_EXTENSION: 'EnumTypeExtension',\n INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension'\n});\n/**\n * The enum type representing the possible kind values of AST nodes.\n */","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/**\n * Creates a keyed JS object from an array, given a function to produce the keys\n * and a function to produce the values from each item in the array.\n *\n * const phoneBook = [\n * { name: 'Jon', num: '555-1234' },\n * { name: 'Jenny', num: '867-5309' }\n * ]\n *\n * // { Jon: '555-1234', Jenny: '867-5309' }\n * const phonesByName = keyValMap(\n * phoneBook,\n * entry => entry.name,\n * entry => entry.num\n * )\n *\n */\nexport default function keyValMap(list, keyFn, valFn) {\n return list.reduce(function (map, item) {\n return map[keyFn(item)] = valFn(item), map;\n }, Object.create(null));\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/**\n * Returns true if a value is undefined, or NaN.\n */\nexport default function isInvalid(value) {\n return value === undefined || value !== value;\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport keyValMap from '../jsutils/keyValMap';\nimport isInvalid from '../jsutils/isInvalid';\nimport { Kind } from '../language/kinds';\n\n/**\n * Produces a JavaScript value given a GraphQL Value AST.\n *\n * Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value\n * will reflect the provided GraphQL value AST.\n *\n * | GraphQL Value | JavaScript Value |\n * | -------------------- | ---------------- |\n * | Input Object | Object |\n * | List | Array |\n * | Boolean | Boolean |\n * | String / Enum | String |\n * | Int / Float | Number |\n * | Null | null |\n *\n */\nexport function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case Kind.NULL:\n return null;\n\n case Kind.INT:\n return parseInt(valueNode.value, 10);\n\n case Kind.FLOAT:\n return parseFloat(valueNode.value);\n\n case Kind.STRING:\n case Kind.ENUM:\n case Kind.BOOLEAN:\n return valueNode.value;\n\n case Kind.LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case Kind.OBJECT:\n return keyValMap(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case Kind.VARIABLE:\n var variableName = valueNode.name.value;\n return variables && !isInvalid(variables[variableName]) ? variables[variableName] : undefined;\n }\n /* istanbul ignore next */\n\n\n throw new Error('Unexpected value kind: ' + valueNode.kind);\n}","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport defineToJSON from '../jsutils/defineToJSON';\nimport defineToStringTag from '../jsutils/defineToStringTag';\nimport instanceOf from '../jsutils/instanceOf';\nimport inspect from '../jsutils/inspect';\nimport invariant from '../jsutils/invariant';\nimport keyMap from '../jsutils/keyMap';\nimport { Kind } from '../language/kinds';\nimport { valueFromASTUntyped } from '../utilities/valueFromASTUntyped';\nexport function isType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type) || isListType(type) || isNonNullType(type);\n}\nexport function assertType(type) {\n !isType(type) ? invariant(0, \"Expected \".concat(inspect(type), \" to be a GraphQL type.\")) : void 0;\n return type;\n}\n/**\n * There are predicates for each kind of GraphQL type.\n */\n\n// eslint-disable-next-line no-redeclare\nexport function isScalarType(type) {\n return instanceOf(type, GraphQLScalarType);\n}\nexport function assertScalarType(type) {\n !isScalarType(type) ? invariant(0, \"Expected \".concat(inspect(type), \" to be a GraphQL Scalar type.\")) : void 0;\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isObjectType(type) {\n return instanceOf(type, GraphQLObjectType);\n}\nexport function assertObjectType(type) {\n !isObjectType(type) ? invariant(0, \"Expected \".concat(inspect(type), \" to be a GraphQL Object type.\")) : void 0;\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isInterfaceType(type) {\n return instanceOf(type, GraphQLInterfaceType);\n}\nexport function assertInterfaceType(type) {\n !isInterfaceType(type) ? invariant(0, \"Expected \".concat(inspect(type), \" to be a GraphQL Interface type.\")) : void 0;\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isUnionType(type) {\n return instanceOf(type, GraphQLUnionType);\n}\nexport function assertUnionType(type) {\n !isUnionType(type) ? invariant(0, \"Expected \".concat(inspect(type), \" to be a GraphQL Union type.\")) : void 0;\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isEnumType(type) {\n return instanceOf(type, GraphQLEnumType);\n}\nexport function assertEnumType(type) {\n !isEnumType(type) ? invariant(0, \"Expected \".concat(inspect(type), \" to be a GraphQL Enum type.\")) : void 0;\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isInputObjectType(type) {\n return instanceOf(type, GraphQLInputObjectType);\n}\nexport function assertInputObjectType(type) {\n !isInputObjectType(type) ? invariant(0, \"Expected \".concat(inspect(type), \" to be a GraphQL Input Object type.\")) : void 0;\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isListType(type) {\n return instanceOf(type, GraphQLList);\n}\nexport function assertListType(type) {\n !isListType(type) ? invariant(0, \"Expected \".concat(inspect(type), \" to be a GraphQL List type.\")) : void 0;\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isNonNullType(type) {\n return instanceOf(type, GraphQLNonNull);\n}\nexport function assertNonNullType(type) {\n !isNonNullType(type) ? invariant(0, \"Expected \".concat(inspect(type), \" to be a GraphQL Non-Null type.\")) : void 0;\n return type;\n}\n/**\n * These types may be used as input types for arguments and directives.\n */\n\nexport function isInputType(type) {\n return isScalarType(type) || isEnumType(type) || isInputObjectType(type) || isWrappingType(type) && isInputType(type.ofType);\n}\nexport function assertInputType(type) {\n !isInputType(type) ? invariant(0, \"Expected \".concat(inspect(type), \" to be a GraphQL input type.\")) : void 0;\n return type;\n}\n/**\n * These types may be used as output types as the result of fields.\n */\n\nexport function isOutputType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isWrappingType(type) && isOutputType(type.ofType);\n}\nexport function assertOutputType(type) {\n !isOutputType(type) ? invariant(0, \"Expected \".concat(inspect(type), \" to be a GraphQL output type.\")) : void 0;\n return type;\n}\n/**\n * These types may describe types which may be leaf values.\n */\n\nexport function isLeafType(type) {\n return isScalarType(type) || isEnumType(type);\n}\nexport function assertLeafType(type) {\n !isLeafType(type) ? invariant(0, \"Expected \".concat(inspect(type), \" to be a GraphQL leaf type.\")) : void 0;\n return type;\n}\n/**\n * These types may describe the parent context of a selection set.\n */\n\nexport function isCompositeType(type) {\n return isObjectType(type) || isInterfaceType(type) || isUnionType(type);\n}\nexport function assertCompositeType(type) {\n !isCompositeType(type) ? invariant(0, \"Expected \".concat(inspect(type), \" to be a GraphQL composite type.\")) : void 0;\n return type;\n}\n/**\n * These types may describe the parent context of a selection set.\n */\n\nexport function isAbstractType(type) {\n return isInterfaceType(type) || isUnionType(type);\n}\nexport function assertAbstractType(type) {\n !isAbstractType(type) ? invariant(0, \"Expected \".concat(inspect(type), \" to be a GraphQL abstract type.\")) : void 0;\n return type;\n}\n/**\n * List Type Wrapper\n *\n * A list is a wrapping type which points to another type.\n * Lists are often created within the context of defining the fields of\n * an object type.\n *\n * Example:\n *\n * const PersonType = new GraphQLObjectType({\n * name: 'Person',\n * fields: () => ({\n * parents: { type: GraphQLList(PersonType) },\n * children: { type: GraphQLList(PersonType) },\n * })\n * })\n *\n */\n\n// eslint-disable-next-line no-redeclare\nexport function GraphQLList(ofType) {\n if (this instanceof GraphQLList) {\n this.ofType = assertType(ofType);\n } else {\n return new GraphQLList(ofType);\n }\n} // Need to cast through any to alter the prototype.\n\nGraphQLList.prototype.toString = function toString() {\n return '[' + String(this.ofType) + ']';\n};\n\ndefineToJSON(GraphQLList);\n/**\n * Non-Null Type Wrapper\n *\n * A non-null is a wrapping type which points to another type.\n * Non-null types enforce that their values are never null and can ensure\n * an error is raised if this ever occurs during a request. It is useful for\n * fields which you can make a strong guarantee on non-nullability, for example\n * usually the id field of a database row will never be null.\n *\n * Example:\n *\n * const RowType = new GraphQLObjectType({\n * name: 'Row',\n * fields: () => ({\n * id: { type: GraphQLNonNull(GraphQLString) },\n * })\n * })\n *\n * Note: the enforcement of non-nullability occurs within the executor.\n */\n\n// eslint-disable-next-line no-redeclare\nexport function GraphQLNonNull(ofType) {\n if (this instanceof GraphQLNonNull) {\n this.ofType = assertNullableType(ofType);\n } else {\n return new GraphQLNonNull(ofType);\n }\n} // Need to cast through any to alter the prototype.\n\nGraphQLNonNull.prototype.toString = function toString() {\n return String(this.ofType) + '!';\n};\n\ndefineToJSON(GraphQLNonNull);\n/**\n * These types wrap and modify other types\n */\n\nexport function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}\nexport function assertWrappingType(type) {\n !isWrappingType(type) ? invariant(0, \"Expected \".concat(inspect(type), \" to be a GraphQL wrapping type.\")) : void 0;\n return type;\n}\n/**\n * These types can all accept null as a value.\n */\n\nexport function isNullableType(type) {\n return isType(type) && !isNonNullType(type);\n}\nexport function assertNullableType(type) {\n !isNullableType(type) ? invariant(0, \"Expected \".concat(inspect(type), \" to be a GraphQL nullable type.\")) : void 0;\n return type;\n}\n/* eslint-disable no-redeclare */\n\nexport function getNullableType(type) {\n /* eslint-enable no-redeclare */\n if (type) {\n return isNonNullType(type) ? type.ofType : type;\n }\n}\n/**\n * These named types do not include modifiers like List or NonNull.\n */\n\nexport function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}\nexport function assertNamedType(type) {\n !isNamedType(type) ? invariant(0, \"Expected \".concat(inspect(type), \" to be a GraphQL named type.\")) : void 0;\n return type;\n}\n/* eslint-disable no-redeclare */\n\nexport function getNamedType(type) {\n /* eslint-enable no-redeclare */\n if (type) {\n var unwrappedType = type;\n\n while (isWrappingType(unwrappedType)) {\n unwrappedType = unwrappedType.ofType;\n }\n\n return unwrappedType;\n }\n}\n/**\n * Used while defining GraphQL types to allow for circular references in\n * otherwise immutable type definitions.\n */\n\nfunction resolveThunk(thunk) {\n return typeof thunk === 'function' ? thunk() : thunk;\n}\n/**\n * Scalar Type Definition\n *\n * The leaf values of any request and input values to arguments are\n * Scalars (or Enums) and are defined with a name and a series of functions\n * used to parse input from ast or variables and to ensure validity.\n *\n * If a type's serialize function does not return a value (i.e. it returns\n * `undefined`) then an error will be raised and a `null` value will be returned\n * in the response. If the serialize function returns `null`, then no error will\n * be included in the response.\n *\n * Example:\n *\n * const OddType = new GraphQLScalarType({\n * name: 'Odd',\n * serialize(value) {\n * if (value % 2 === 1) {\n * return value;\n * }\n * }\n * });\n *\n */\n\n\nexport var GraphQLScalarType =\n/*#__PURE__*/\nfunction () {\n function GraphQLScalarType(config) {\n _defineProperty(this, \"name\", void 0);\n\n _defineProperty(this, \"description\", void 0);\n\n _defineProperty(this, \"serialize\", void 0);\n\n _defineProperty(this, \"parseValue\", void 0);\n\n _defineProperty(this, \"parseLiteral\", void 0);\n\n _defineProperty(this, \"astNode\", void 0);\n\n _defineProperty(this, \"extensionASTNodes\", void 0);\n\n this.name = config.name;\n this.description = config.description;\n this.serialize = config.serialize;\n\n this.parseValue = config.parseValue || function (value) {\n return value;\n };\n\n this.parseLiteral = config.parseLiteral || valueFromASTUntyped;\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes;\n !(typeof config.name === 'string') ? invariant(0, 'Must provide name.') : void 0;\n !(typeof config.serialize === 'function') ? invariant(0, \"\".concat(this.name, \" must provide \\\"serialize\\\" function. If this custom Scalar \") + 'is also used as an input type, ensure \"parseValue\" and \"parseLiteral\" ' + 'functions are also provided.') : void 0;\n\n if (config.parseValue || config.parseLiteral) {\n !(typeof config.parseValue === 'function' && typeof config.parseLiteral === 'function') ? invariant(0, \"\".concat(this.name, \" must provide both \\\"parseValue\\\" and \\\"parseLiteral\\\" \") + 'functions.') : void 0;\n }\n }\n\n var _proto = GraphQLScalarType.prototype;\n\n _proto.toString = function toString() {\n return this.name;\n };\n\n return GraphQLScalarType;\n}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported\n\ndefineToStringTag(GraphQLScalarType);\ndefineToJSON(GraphQLScalarType);\n\n/**\n * Object Type Definition\n *\n * Almost all of the GraphQL types you define will be object types. Object types\n * have a name, but most importantly describe their fields.\n *\n * Example:\n *\n * const AddressType = new GraphQLObjectType({\n * name: 'Address',\n * fields: {\n * street: { type: GraphQLString },\n * number: { type: GraphQLInt },\n * formatted: {\n * type: GraphQLString,\n * resolve(obj) {\n * return obj.number + ' ' + obj.street\n * }\n * }\n * }\n * });\n *\n * When two types need to refer to each other, or a type needs to refer to\n * itself in a field, you can use a function expression (aka a closure or a\n * thunk) to supply the fields lazily.\n *\n * Example:\n *\n * const PersonType = new GraphQLObjectType({\n * name: 'Person',\n * fields: () => ({\n * name: { type: GraphQLString },\n * bestFriend: { type: PersonType },\n * })\n * });\n *\n */\nexport var GraphQLObjectType =\n/*#__PURE__*/\nfunction () {\n function GraphQLObjectType(config) {\n _defineProperty(this, \"name\", void 0);\n\n _defineProperty(this, \"description\", void 0);\n\n _defineProperty(this, \"astNode\", void 0);\n\n _defineProperty(this, \"extensionASTNodes\", void 0);\n\n _defineProperty(this, \"isTypeOf\", void 0);\n\n _defineProperty(this, \"_fields\", void 0);\n\n _defineProperty(this, \"_interfaces\", void 0);\n\n this.name = config.name;\n this.description = config.description;\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes;\n this.isTypeOf = config.isTypeOf;\n this._fields = defineFieldMap.bind(undefined, config);\n this._interfaces = defineInterfaces.bind(undefined, config);\n !(typeof config.name === 'string') ? invariant(0, 'Must provide name.') : void 0;\n !(config.isTypeOf == null || typeof config.isTypeOf === 'function') ? invariant(0, \"\".concat(this.name, \" must provide \\\"isTypeOf\\\" as a function, \") + \"but got: \".concat(inspect(config.isTypeOf), \".\")) : void 0;\n }\n\n var _proto2 = GraphQLObjectType.prototype;\n\n _proto2.getFields = function getFields() {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n\n return this._fields;\n };\n\n _proto2.getInterfaces = function getInterfaces() {\n if (typeof this._interfaces === 'function') {\n this._interfaces = this._interfaces();\n }\n\n return this._interfaces;\n };\n\n _proto2.toString = function toString() {\n return this.name;\n };\n\n return GraphQLObjectType;\n}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported\n\ndefineToStringTag(GraphQLObjectType);\ndefineToJSON(GraphQLObjectType);\n\nfunction defineInterfaces(config) {\n var interfaces = resolveThunk(config.interfaces) || [];\n !Array.isArray(interfaces) ? invariant(0, \"\".concat(config.name, \" interfaces must be an Array or a function which returns \") + 'an Array.') : void 0;\n return interfaces;\n}\n\nfunction defineFieldMap(config) {\n var fieldMap = resolveThunk(config.fields) || {};\n !isPlainObj(fieldMap) ? invariant(0, \"\".concat(config.name, \" fields must be an object with field names as keys or a \") + 'function which returns such an object.') : void 0;\n var resultFieldMap = Object.create(null);\n\n var _arr = Object.keys(fieldMap);\n\n var _loop = function _loop() {\n var fieldName = _arr[_i];\n var fieldConfig = fieldMap[fieldName];\n !isPlainObj(fieldConfig) ? invariant(0, \"\".concat(config.name, \".\").concat(fieldName, \" field config must be an object\")) : void 0;\n !!fieldConfig.hasOwnProperty('isDeprecated') ? invariant(0, \"\".concat(config.name, \".\").concat(fieldName, \" should provide \\\"deprecationReason\\\" \") + 'instead of \"isDeprecated\".') : void 0;\n\n var field = _objectSpread({}, fieldConfig, {\n isDeprecated: Boolean(fieldConfig.deprecationReason),\n name: fieldName\n });\n\n !(field.resolve == null || typeof field.resolve === 'function') ? invariant(0, \"\".concat(config.name, \".\").concat(fieldName, \" field resolver must be a function if \") + \"provided, but got: \".concat(inspect(field.resolve), \".\")) : void 0;\n var argsConfig = fieldConfig.args;\n\n if (!argsConfig) {\n field.args = [];\n } else {\n !isPlainObj(argsConfig) ? invariant(0, \"\".concat(config.name, \".\").concat(fieldName, \" args must be an object with argument \") + 'names as keys.') : void 0;\n field.args = Object.keys(argsConfig).map(function (argName) {\n var arg = argsConfig[argName];\n return {\n name: argName,\n description: arg.description === undefined ? null : arg.description,\n type: arg.type,\n defaultValue: arg.defaultValue,\n astNode: arg.astNode\n };\n });\n }\n\n resultFieldMap[fieldName] = field;\n };\n\n for (var _i = 0; _i < _arr.length; _i++) {\n _loop();\n }\n\n return resultFieldMap;\n}\n\nfunction isPlainObj(obj) {\n return obj && _typeof(obj) === 'object' && !Array.isArray(obj);\n}\n\nexport function isRequiredArgument(arg) {\n return isNonNullType(arg.type) && arg.defaultValue === undefined;\n}\n\n/**\n * Interface Type Definition\n *\n * When a field can return one of a heterogeneous set of types, a Interface type\n * is used to describe what types are possible, what fields are in common across\n * all types, as well as a function to determine which type is actually used\n * when the field is resolved.\n *\n * Example:\n *\n * const EntityType = new GraphQLInterfaceType({\n * name: 'Entity',\n * fields: {\n * name: { type: GraphQLString }\n * }\n * });\n *\n */\nexport var GraphQLInterfaceType =\n/*#__PURE__*/\nfunction () {\n function GraphQLInterfaceType(config) {\n _defineProperty(this, \"name\", void 0);\n\n _defineProperty(this, \"description\", void 0);\n\n _defineProperty(this, \"astNode\", void 0);\n\n _defineProperty(this, \"extensionASTNodes\", void 0);\n\n _defineProperty(this, \"resolveType\", void 0);\n\n _defineProperty(this, \"_fields\", void 0);\n\n this.name = config.name;\n this.description = config.description;\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes;\n this.resolveType = config.resolveType;\n this._fields = defineFieldMap.bind(undefined, config);\n !(typeof config.name === 'string') ? invariant(0, 'Must provide name.') : void 0;\n !(config.resolveType == null || typeof config.resolveType === 'function') ? invariant(0, \"\".concat(this.name, \" must provide \\\"resolveType\\\" as a function, \") + \"but got: \".concat(inspect(config.resolveType), \".\")) : void 0;\n }\n\n var _proto3 = GraphQLInterfaceType.prototype;\n\n _proto3.getFields = function getFields() {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n\n return this._fields;\n };\n\n _proto3.toString = function toString() {\n return this.name;\n };\n\n return GraphQLInterfaceType;\n}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported\n\ndefineToStringTag(GraphQLInterfaceType);\ndefineToJSON(GraphQLInterfaceType);\n\n/**\n * Union Type Definition\n *\n * When a field can return one of a heterogeneous set of types, a Union type\n * is used to describe what types are possible as well as providing a function\n * to determine which type is actually used when the field is resolved.\n *\n * Example:\n *\n * const PetType = new GraphQLUnionType({\n * name: 'Pet',\n * types: [ DogType, CatType ],\n * resolveType(value) {\n * if (value instanceof Dog) {\n * return DogType;\n * }\n * if (value instanceof Cat) {\n * return CatType;\n * }\n * }\n * });\n *\n */\nexport var GraphQLUnionType =\n/*#__PURE__*/\nfunction () {\n function GraphQLUnionType(config) {\n _defineProperty(this, \"name\", void 0);\n\n _defineProperty(this, \"description\", void 0);\n\n _defineProperty(this, \"astNode\", void 0);\n\n _defineProperty(this, \"extensionASTNodes\", void 0);\n\n _defineProperty(this, \"resolveType\", void 0);\n\n _defineProperty(this, \"_types\", void 0);\n\n this.name = config.name;\n this.description = config.description;\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes;\n this.resolveType = config.resolveType;\n this._types = defineTypes.bind(undefined, config);\n !(typeof config.name === 'string') ? invariant(0, 'Must provide name.') : void 0;\n !(config.resolveType == null || typeof config.resolveType === 'function') ? invariant(0, \"\".concat(this.name, \" must provide \\\"resolveType\\\" as a function, \") + \"but got: \".concat(inspect(config.resolveType), \".\")) : void 0;\n }\n\n var _proto4 = GraphQLUnionType.prototype;\n\n _proto4.getTypes = function getTypes() {\n if (typeof this._types === 'function') {\n this._types = this._types();\n }\n\n return this._types;\n };\n\n _proto4.toString = function toString() {\n return this.name;\n };\n\n return GraphQLUnionType;\n}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported\n\ndefineToStringTag(GraphQLUnionType);\ndefineToJSON(GraphQLUnionType);\n\nfunction defineTypes(config) {\n var types = resolveThunk(config.types) || [];\n !Array.isArray(types) ? invariant(0, 'Must provide Array of types or a function which returns ' + \"such an array for Union \".concat(config.name, \".\")) : void 0;\n return types;\n}\n\n/**\n * Enum Type Definition\n *\n * Some leaf values of requests and input values are Enums. GraphQL serializes\n * Enum values as strings, however internally Enums can be represented by any\n * kind of type, often integers.\n *\n * Example:\n *\n * const RGBType = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 }\n * }\n * });\n *\n * Note: If a value is not provided in a definition, the name of the enum value\n * will be used as its internal value.\n */\nexport var GraphQLEnumType\n/* <T> */\n=\n/*#__PURE__*/\nfunction () {\n function GraphQLEnumType(config\n /* <T> */\n ) {\n _defineProperty(this, \"name\", void 0);\n\n _defineProperty(this, \"description\", void 0);\n\n _defineProperty(this, \"astNode\", void 0);\n\n _defineProperty(this, \"extensionASTNodes\", void 0);\n\n _defineProperty(this, \"_values\", void 0);\n\n _defineProperty(this, \"_valueLookup\", void 0);\n\n _defineProperty(this, \"_nameLookup\", void 0);\n\n this.name = config.name;\n this.description = config.description;\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes;\n this._values = defineEnumValues(this, config.values);\n this._valueLookup = new Map(this._values.map(function (enumValue) {\n return [enumValue.value, enumValue];\n }));\n this._nameLookup = keyMap(this._values, function (value) {\n return value.name;\n });\n !(typeof config.name === 'string') ? invariant(0, 'Must provide name.') : void 0;\n }\n\n var _proto5 = GraphQLEnumType.prototype;\n\n _proto5.getValues = function getValues() {\n return this._values;\n };\n\n _proto5.getValue = function getValue(name) {\n return this._nameLookup[name];\n };\n\n _proto5.serialize = function serialize(value\n /* T */\n ) {\n var enumValue = this._valueLookup.get(value);\n\n if (enumValue) {\n return enumValue.name;\n }\n };\n\n _proto5.parseValue = function parseValue(value)\n /* T */\n {\n if (typeof value === 'string') {\n var enumValue = this.getValue(value);\n\n if (enumValue) {\n return enumValue.value;\n }\n }\n };\n\n _proto5.parseLiteral = function parseLiteral(valueNode, _variables)\n /* T */\n {\n // Note: variables will be resolved to a value before calling this function.\n if (valueNode.kind === Kind.ENUM) {\n var enumValue = this.getValue(valueNode.value);\n\n if (enumValue) {\n return enumValue.value;\n }\n }\n };\n\n _proto5.toString = function toString() {\n return this.name;\n };\n\n return GraphQLEnumType;\n}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported\n\ndefineToStringTag(GraphQLEnumType);\ndefineToJSON(GraphQLEnumType);\n\nfunction defineEnumValues(type, valueMap\n/* <T> */\n) {\n !isPlainObj(valueMap) ? invariant(0, \"\".concat(type.name, \" values must be an object with value names as keys.\")) : void 0;\n return Object.keys(valueMap).map(function (valueName) {\n var value = valueMap[valueName];\n !isPlainObj(value) ? invariant(0, \"\".concat(type.name, \".\").concat(valueName, \" must refer to an object with a \\\"value\\\" key \") + \"representing an internal value but got: \".concat(inspect(value), \".\")) : void 0;\n !!value.hasOwnProperty('isDeprecated') ? invariant(0, \"\".concat(type.name, \".\").concat(valueName, \" should provide \\\"deprecationReason\\\" instead \") + 'of \"isDeprecated\".') : void 0;\n return {\n name: valueName,\n description: value.description,\n isDeprecated: Boolean(value.deprecationReason),\n deprecationReason: value.deprecationReason,\n astNode: value.astNode,\n value: value.hasOwnProperty('value') ? value.value : valueName\n };\n });\n}\n\n/**\n * Input Object Type Definition\n *\n * An input object defines a structured collection of fields which may be\n * supplied to a field argument.\n *\n * Using `NonNull` will ensure that a value must be provided by the query\n *\n * Example:\n *\n * const GeoPoint = new GraphQLInputObjectType({\n * name: 'GeoPoint',\n * fields: {\n * lat: { type: GraphQLNonNull(GraphQLFloat) },\n * lon: { type: GraphQLNonNull(GraphQLFloat) },\n * alt: { type: GraphQLFloat, defaultValue: 0 },\n * }\n * });\n *\n */\nexport var GraphQLInputObjectType =\n/*#__PURE__*/\nfunction () {\n function GraphQLInputObjectType(config) {\n _defineProperty(this, \"name\", void 0);\n\n _defineProperty(this, \"description\", void 0);\n\n _defineProperty(this, \"astNode\", void 0);\n\n _defineProperty(this, \"extensionASTNodes\", void 0);\n\n _defineProperty(this, \"_fields\", void 0);\n\n this.name = config.name;\n this.description = config.description;\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes;\n this._fields = defineInputFieldMap.bind(undefined, config);\n !(typeof config.name === 'string') ? invariant(0, 'Must provide name.') : void 0;\n }\n\n var _proto6 = GraphQLInputObjectType.prototype;\n\n _proto6.getFields = function getFields() {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n\n return this._fields;\n };\n\n _proto6.toString = function toString() {\n return this.name;\n };\n\n return GraphQLInputObjectType;\n}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported\n\ndefineToStringTag(GraphQLInputObjectType);\ndefineToJSON(GraphQLInputObjectType);\n\nfunction defineInputFieldMap(config) {\n var fieldMap = resolveThunk(config.fields) || {};\n !isPlainObj(fieldMap) ? invariant(0, \"\".concat(config.name, \" fields must be an object with field names as keys or a \") + 'function which returns such an object.') : void 0;\n var resultFieldMap = Object.create(null);\n\n var _arr2 = Object.keys(fieldMap);\n\n for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n var fieldName = _arr2[_i2];\n\n var field = _objectSpread({}, fieldMap[fieldName], {\n name: fieldName\n });\n\n !!field.hasOwnProperty('resolve') ? invariant(0, \"\".concat(config.name, \".\").concat(fieldName, \" field has a resolve property, but \") + 'Input Types cannot define resolvers.') : void 0;\n resultFieldMap[fieldName] = field;\n }\n\n return resultFieldMap;\n}\n\nexport function isRequiredInputField(field) {\n return isNonNullType(field.type) && field.defaultValue === undefined;\n}","/**\n * Copyright (c) 2018-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/* eslint-disable no-redeclare */\n// $FlowFixMe workaround for: https://github.com/facebook/flow/issues/4441\nvar isFinite = Number.isFinite || function (value) {\n return typeof value === 'number' && isFinite(value);\n};\n\nexport default isFinite;","/**\n * Copyright (c) 2018-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/* eslint-disable no-redeclare */\n// $FlowFixMe workaround for: https://github.com/facebook/flow/issues/4441\nvar isInteger = Number.isInteger || function (value) {\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\n};\n\nexport default isInteger;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport inspect from '../jsutils/inspect';\nimport isFinite from '../jsutils/isFinite';\nimport isInteger from '../jsutils/isInteger';\nimport { GraphQLScalarType, isNamedType } from './definition';\nimport { Kind } from '../language/kinds'; // As per the GraphQL Spec, Integers are only treated as valid when a valid\n// 32-bit signed integer, providing the broadest support across platforms.\n//\n// n.b. JavaScript's integers are safe between -(2^53 - 1) and 2^53 - 1 because\n// they are internally represented as IEEE 754 doubles.\n\nvar MAX_INT = 2147483647;\nvar MIN_INT = -2147483648;\n\nfunction serializeInt(value) {\n if (typeof value === 'boolean') {\n return value ? 1 : 0;\n }\n\n var num = value;\n\n if (typeof value === 'string' && value !== '') {\n num = Number(value);\n }\n\n if (!isInteger(num)) {\n throw new TypeError(\"Int cannot represent non-integer value: \".concat(inspect(value)));\n }\n\n if (num > MAX_INT || num < MIN_INT) {\n throw new TypeError(\"Int cannot represent non 32-bit signed integer value: \".concat(inspect(value)));\n }\n\n return num;\n}\n\nfunction coerceInt(value) {\n if (!isInteger(value)) {\n throw new TypeError(\"Int cannot represent non-integer value: \".concat(inspect(value)));\n }\n\n if (value > MAX_INT || value < MIN_INT) {\n throw new TypeError(\"Int cannot represent non 32-bit signed integer value: \".concat(inspect(value)));\n }\n\n return value;\n}\n\nexport var GraphQLInt = new GraphQLScalarType({\n name: 'Int',\n description: 'The `Int` scalar type represents non-fractional signed whole numeric ' + 'values. Int can represent values between -(2^31) and 2^31 - 1. ',\n serialize: serializeInt,\n parseValue: coerceInt,\n parseLiteral: function parseLiteral(ast) {\n if (ast.kind === Kind.INT) {\n var num = parseInt(ast.value, 10);\n\n if (num <= MAX_INT && num >= MIN_INT) {\n return num;\n }\n }\n\n return undefined;\n }\n});\n\nfunction serializeFloat(value) {\n if (typeof value === 'boolean') {\n return value ? 1 : 0;\n }\n\n var num = value;\n\n if (typeof value === 'string' && value !== '') {\n num = Number(value);\n }\n\n if (!isFinite(num)) {\n throw new TypeError(\"Float cannot represent non numeric value: \".concat(inspect(value)));\n }\n\n return num;\n}\n\nfunction coerceFloat(value) {\n if (!isFinite(value)) {\n throw new TypeError(\"Float cannot represent non numeric value: \".concat(inspect(value)));\n }\n\n return value;\n}\n\nexport var GraphQLFloat = new GraphQLScalarType({\n name: 'Float',\n description: 'The `Float` scalar type represents signed double-precision fractional ' + 'values as specified by ' + '[IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). ',\n serialize: serializeFloat,\n parseValue: coerceFloat,\n parseLiteral: function parseLiteral(ast) {\n return ast.kind === Kind.FLOAT || ast.kind === Kind.INT ? parseFloat(ast.value) : undefined;\n }\n});\n\nfunction serializeString(value) {\n // Support serializing objects with custom valueOf() functions - a common way\n // to represent an complex value which can be represented as a string\n // (ex: MongoDB id objects).\n var result = value && typeof value.valueOf === 'function' ? value.valueOf() : value; // Serialize string, boolean and number values to a string, but do not\n // attempt to coerce object, function, symbol, or other types as strings.\n\n if (typeof result === 'string') {\n return result;\n }\n\n if (typeof result === 'boolean') {\n return result ? 'true' : 'false';\n }\n\n if (isFinite(result)) {\n return result.toString();\n }\n\n throw new TypeError(\"String cannot represent value: \".concat(inspect(value)));\n}\n\nfunction coerceString(value) {\n if (typeof value !== 'string') {\n throw new TypeError(\"String cannot represent a non string value: \".concat(inspect(value)));\n }\n\n return value;\n}\n\nexport var GraphQLString = new GraphQLScalarType({\n name: 'String',\n description: 'The `String` scalar type represents textual data, represented as UTF-8 ' + 'character sequences. The String type is most often used by GraphQL to ' + 'represent free-form human-readable text.',\n serialize: serializeString,\n parseValue: coerceString,\n parseLiteral: function parseLiteral(ast) {\n return ast.kind === Kind.STRING ? ast.value : undefined;\n }\n});\n\nfunction serializeBoolean(value) {\n if (typeof value === 'boolean') {\n return value;\n }\n\n if (isFinite(value)) {\n return value !== 0;\n }\n\n throw new TypeError(\"Boolean cannot represent a non boolean value: \".concat(inspect(value)));\n}\n\nfunction coerceBoolean(value) {\n if (typeof value !== 'boolean') {\n throw new TypeError(\"Boolean cannot represent a non boolean value: \".concat(inspect(value)));\n }\n\n return value;\n}\n\nexport var GraphQLBoolean = new GraphQLScalarType({\n name: 'Boolean',\n description: 'The `Boolean` scalar type represents `true` or `false`.',\n serialize: serializeBoolean,\n parseValue: coerceBoolean,\n parseLiteral: function parseLiteral(ast) {\n return ast.kind === Kind.BOOLEAN ? ast.value : undefined;\n }\n});\n\nfunction serializeID(value) {\n // Support serializing objects with custom valueOf() functions - a common way\n // to represent an object identifier (ex. MongoDB).\n var result = value && typeof value.valueOf === 'function' ? value.valueOf() : value;\n\n if (typeof result === 'string') {\n return result;\n }\n\n if (isInteger(result)) {\n return String(result);\n }\n\n throw new TypeError(\"ID cannot represent value: \".concat(inspect(value)));\n}\n\nfunction coerceID(value) {\n if (typeof value === 'string') {\n return value;\n }\n\n if (isInteger(value)) {\n return value.toString();\n }\n\n throw new TypeError(\"ID cannot represent value: \".concat(inspect(value)));\n}\n\nexport var GraphQLID = new GraphQLScalarType({\n name: 'ID',\n description: 'The `ID` scalar type represents a unique identifier, often used to ' + 'refetch an object or as key for a cache. The ID type appears in a JSON ' + 'response as a String; however, it is not intended to be human-readable. ' + 'When expected as an input type, any string (such as `\"4\"`) or integer ' + '(such as `4`) input value will be accepted as an ID.',\n serialize: serializeID,\n parseValue: coerceID,\n parseLiteral: function parseLiteral(ast) {\n return ast.kind === Kind.STRING || ast.kind === Kind.INT ? ast.value : undefined;\n }\n});\nexport var specifiedScalarTypes = [GraphQLString, GraphQLInt, GraphQLFloat, GraphQLBoolean, GraphQLID];\nexport function isSpecifiedScalarType(type) {\n return isNamedType(type) && ( // Would prefer to use specifiedScalarTypes.some(), however %checks needs\n // a simple expression.\n type.name === GraphQLString.name || type.name === GraphQLInt.name || type.name === GraphQLFloat.name || type.name === GraphQLBoolean.name || type.name === GraphQLID.name);\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/**\n * The set of allowed directive location values.\n */\nexport var DirectiveLocation = Object.freeze({\n // Request Definitions\n QUERY: 'QUERY',\n MUTATION: 'MUTATION',\n SUBSCRIPTION: 'SUBSCRIPTION',\n FIELD: 'FIELD',\n FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION',\n FRAGMENT_SPREAD: 'FRAGMENT_SPREAD',\n INLINE_FRAGMENT: 'INLINE_FRAGMENT',\n VARIABLE_DEFINITION: 'VARIABLE_DEFINITION',\n // Type System Definitions\n SCHEMA: 'SCHEMA',\n SCALAR: 'SCALAR',\n OBJECT: 'OBJECT',\n FIELD_DEFINITION: 'FIELD_DEFINITION',\n ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION',\n INTERFACE: 'INTERFACE',\n UNION: 'UNION',\n ENUM: 'ENUM',\n ENUM_VALUE: 'ENUM_VALUE',\n INPUT_OBJECT: 'INPUT_OBJECT',\n INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION'\n});\n/**\n * The enum type representing the directive location values.\n */","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLNonNull } from './definition';\nimport { GraphQLString, GraphQLBoolean } from './scalars';\nimport defineToStringTag from '../jsutils/defineToStringTag';\nimport defineToJSON from '../jsutils/defineToJSON';\nimport instanceOf from '../jsutils/instanceOf';\nimport invariant from '../jsutils/invariant';\nimport { DirectiveLocation } from '../language/directiveLocation';\n/**\n * Test if the given value is a GraphQL directive.\n */\n\n// eslint-disable-next-line no-redeclare\nexport function isDirective(directive) {\n return instanceOf(directive, GraphQLDirective);\n}\n/**\n * Directives are used by the GraphQL runtime as a way of modifying execution\n * behavior. Type system creators will usually not create these directly.\n */\n\nexport var GraphQLDirective =\n/*#__PURE__*/\nfunction () {\n function GraphQLDirective(config) {\n _defineProperty(this, \"name\", void 0);\n\n _defineProperty(this, \"description\", void 0);\n\n _defineProperty(this, \"locations\", void 0);\n\n _defineProperty(this, \"args\", void 0);\n\n _defineProperty(this, \"astNode\", void 0);\n\n this.name = config.name;\n this.description = config.description;\n this.locations = config.locations;\n this.astNode = config.astNode;\n !config.name ? invariant(0, 'Directive must be named.') : void 0;\n !Array.isArray(config.locations) ? invariant(0, 'Must provide locations for directive.') : void 0;\n var args = config.args;\n\n if (!args) {\n this.args = [];\n } else {\n !!Array.isArray(args) ? invariant(0, \"@\".concat(config.name, \" args must be an object with argument names as keys.\")) : void 0;\n this.args = Object.keys(args).map(function (argName) {\n var arg = args[argName];\n return {\n name: argName,\n description: arg.description === undefined ? null : arg.description,\n type: arg.type,\n defaultValue: arg.defaultValue,\n astNode: arg.astNode\n };\n });\n }\n }\n\n var _proto = GraphQLDirective.prototype;\n\n _proto.toString = function toString() {\n return '@' + this.name;\n };\n\n return GraphQLDirective;\n}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported\n\ndefineToStringTag(GraphQLDirective);\ndefineToJSON(GraphQLDirective);\n\n/**\n * Used to conditionally include fields or fragments.\n */\nexport var GraphQLIncludeDirective = new GraphQLDirective({\n name: 'include',\n description: 'Directs the executor to include this field or fragment only when ' + 'the `if` argument is true.',\n locations: [DirectiveLocation.FIELD, DirectiveLocation.FRAGMENT_SPREAD, DirectiveLocation.INLINE_FRAGMENT],\n args: {\n if: {\n type: GraphQLNonNull(GraphQLBoolean),\n description: 'Included when true.'\n }\n }\n});\n/**\n * Used to conditionally skip (exclude) fields or fragments.\n */\n\nexport var GraphQLSkipDirective = new GraphQLDirective({\n name: 'skip',\n description: 'Directs the executor to skip this field or fragment when the `if` ' + 'argument is true.',\n locations: [DirectiveLocation.FIELD, DirectiveLocation.FRAGMENT_SPREAD, DirectiveLocation.INLINE_FRAGMENT],\n args: {\n if: {\n type: GraphQLNonNull(GraphQLBoolean),\n description: 'Skipped when true.'\n }\n }\n});\n/**\n * Constant string used for default reason for a deprecation.\n */\n\nexport var DEFAULT_DEPRECATION_REASON = 'No longer supported';\n/**\n * Used to declare element of a GraphQL schema as deprecated.\n */\n\nexport var GraphQLDeprecatedDirective = new GraphQLDirective({\n name: 'deprecated',\n description: 'Marks an element of a GraphQL schema as no longer supported.',\n locations: [DirectiveLocation.FIELD_DEFINITION, DirectiveLocation.ENUM_VALUE],\n args: {\n reason: {\n type: GraphQLString,\n description: 'Explains why this element was deprecated, usually also including a ' + 'suggestion for how to access supported similar data. Formatted using ' + 'the Markdown syntax (as specified by [CommonMark](https://commonmark.org/).',\n defaultValue: DEFAULT_DEPRECATION_REASON\n }\n }\n});\n/**\n * The full list of specified directives.\n */\n\nexport var specifiedDirectives = [GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective];\nexport function isSpecifiedDirective(directive) {\n return specifiedDirectives.some(function (specifiedDirective) {\n return specifiedDirective.name === directive.name;\n });\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/* eslint-disable no-redeclare */\n// $FlowFixMe workaround for: https://github.com/facebook/flow/issues/2221\nvar objectValues = Object.values || function (obj) {\n return Object.keys(obj).map(function (key) {\n return obj[key];\n });\n};\n\nexport default objectValues;","/**\n * Copyright (c) 2016, Lee Byron\n * All rights reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @ignore\n */\n\n/**\n * [Iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterator)\n * is a *protocol* which describes a standard way to produce a sequence of\n * values, typically the values of the Iterable represented by this Iterator.\n *\n * While described by the [ES2015 version of JavaScript](http://www.ecma-international.org/ecma-262/6.0/#sec-iterator-interface)\n * it can be utilized by any version of JavaScript.\n *\n * @external Iterator\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterator|MDN Iteration protocols}\n */\n\n/**\n * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable)\n * is a *protocol* which when implemented allows a JavaScript object to define\n * their iteration behavior, such as what values are looped over in a\n * [`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of)\n * loop or `iterall`'s `forEach` function. Many [built-in types](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#Builtin_iterables)\n * implement the Iterable protocol, including `Array` and `Map`.\n *\n * While described by the [ES2015 version of JavaScript](http://www.ecma-international.org/ecma-262/6.0/#sec-iterable-interface)\n * it can be utilized by any version of JavaScript.\n *\n * @external Iterable\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable|MDN Iteration protocols}\n */\n\n// In ES2015 environments, Symbol exists\nvar SYMBOL /*: any */ = typeof Symbol === 'function' ? Symbol : void 0\n\n// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator\nvar SYMBOL_ITERATOR = SYMBOL && SYMBOL.iterator\n\n/**\n * A property name to be used as the name of an Iterable's method responsible\n * for producing an Iterator, referred to as `@@iterator`. Typically represents\n * the value `Symbol.iterator` but falls back to the string `\"@@iterator\"` when\n * `Symbol.iterator` is not defined.\n *\n * Use `$$iterator` for defining new Iterables instead of `Symbol.iterator`,\n * but do not use it for accessing existing Iterables, instead use\n * {@link getIterator} or {@link isIterable}.\n *\n * @example\n *\n * var $$iterator = require('iterall').$$iterator\n *\n * function Counter (to) {\n * this.to = to\n * }\n *\n * Counter.prototype[$$iterator] = function () {\n * return {\n * to: this.to,\n * num: 0,\n * next () {\n * if (this.num >= this.to) {\n * return { value: undefined, done: true }\n * }\n * return { value: this.num++, done: false }\n * }\n * }\n * }\n *\n * var counter = new Counter(3)\n * for (var number of counter) {\n * console.log(number) // 0 ... 1 ... 2\n * }\n *\n * @type {Symbol|string}\n */\n/*:: declare export var $$iterator: '@@iterator'; */\nexport var $$iterator = SYMBOL_ITERATOR || '@@iterator'\n\n/**\n * Returns true if the provided object implements the Iterator protocol via\n * either implementing a `Symbol.iterator` or `\"@@iterator\"` method.\n *\n * @example\n *\n * var isIterable = require('iterall').isIterable\n * isIterable([ 1, 2, 3 ]) // true\n * isIterable('ABC') // true\n * isIterable({ length: 1, 0: 'Alpha' }) // false\n * isIterable({ key: 'value' }) // false\n * isIterable(new Map()) // true\n *\n * @param obj\n * A value which might implement the Iterable protocol.\n * @return {boolean} true if Iterable.\n */\n/*:: declare export function isIterable(obj: any): boolean; */\nexport function isIterable(obj) {\n return !!getIteratorMethod(obj)\n}\n\n/**\n * Returns true if the provided object implements the Array-like protocol via\n * defining a positive-integer `length` property.\n *\n * @example\n *\n * var isArrayLike = require('iterall').isArrayLike\n * isArrayLike([ 1, 2, 3 ]) // true\n * isArrayLike('ABC') // true\n * isArrayLike({ length: 1, 0: 'Alpha' }) // true\n * isArrayLike({ key: 'value' }) // false\n * isArrayLike(new Map()) // false\n *\n * @param obj\n * A value which might implement the Array-like protocol.\n * @return {boolean} true if Array-like.\n */\n/*:: declare export function isArrayLike(obj: any): boolean; */\nexport function isArrayLike(obj) {\n var length = obj != null && obj.length\n return typeof length === 'number' && length >= 0 && length % 1 === 0\n}\n\n/**\n * Returns true if the provided object is an Object (i.e. not a string literal)\n * and is either Iterable or Array-like.\n *\n * This may be used in place of [Array.isArray()][isArray] to determine if an\n * object should be iterated-over. It always excludes string literals and\n * includes Arrays (regardless of if it is Iterable). It also includes other\n * Array-like objects such as NodeList, TypedArray, and Buffer.\n *\n * @example\n *\n * var isCollection = require('iterall').isCollection\n * isCollection([ 1, 2, 3 ]) // true\n * isCollection('ABC') // false\n * isCollection({ length: 1, 0: 'Alpha' }) // true\n * isCollection({ key: 'value' }) // false\n * isCollection(new Map()) // true\n *\n * @example\n *\n * var forEach = require('iterall').forEach\n * if (isCollection(obj)) {\n * forEach(obj, function (value) {\n * console.log(value)\n * })\n * }\n *\n * @param obj\n * An Object value which might implement the Iterable or Array-like protocols.\n * @return {boolean} true if Iterable or Array-like Object.\n */\n/*:: declare export function isCollection(obj: any): boolean; */\nexport function isCollection(obj) {\n return Object(obj) === obj && (isArrayLike(obj) || isIterable(obj))\n}\n\n/**\n * If the provided object implements the Iterator protocol, its Iterator object\n * is returned. Otherwise returns undefined.\n *\n * @example\n *\n * var getIterator = require('iterall').getIterator\n * var iterator = getIterator([ 1, 2, 3 ])\n * iterator.next() // { value: 1, done: false }\n * iterator.next() // { value: 2, done: false }\n * iterator.next() // { value: 3, done: false }\n * iterator.next() // { value: undefined, done: true }\n *\n * @template T the type of each iterated value\n * @param {Iterable<T>} iterable\n * An Iterable object which is the source of an Iterator.\n * @return {Iterator<T>} new Iterator instance.\n */\n/*:: declare export var getIterator:\n & (<+TValue>(iterable: Iterable<TValue>) => Iterator<TValue>)\n & ((iterable: mixed) => void | Iterator<mixed>); */\nexport function getIterator(iterable) {\n var method = getIteratorMethod(iterable)\n if (method) {\n return method.call(iterable)\n }\n}\n\n/**\n * If the provided object implements the Iterator protocol, the method\n * responsible for producing its Iterator object is returned.\n *\n * This is used in rare cases for performance tuning. This method must be called\n * with obj as the contextual this-argument.\n *\n * @example\n *\n * var getIteratorMethod = require('iterall').getIteratorMethod\n * var myArray = [ 1, 2, 3 ]\n * var method = getIteratorMethod(myArray)\n * if (method) {\n * var iterator = method.call(myArray)\n * }\n *\n * @template T the type of each iterated value\n * @param {Iterable<T>} iterable\n * An Iterable object which defines an `@@iterator` method.\n * @return {function(): Iterator<T>} `@@iterator` method.\n */\n/*:: declare export var getIteratorMethod:\n & (<+TValue>(iterable: Iterable<TValue>) => (() => Iterator<TValue>))\n & ((iterable: mixed) => (void | (() => Iterator<mixed>))); */\nexport function getIteratorMethod(iterable) {\n if (iterable != null) {\n var method =\n (SYMBOL_ITERATOR && iterable[SYMBOL_ITERATOR]) || iterable['@@iterator']\n if (typeof method === 'function') {\n return method\n }\n }\n}\n\n/**\n * Similar to {@link getIterator}, this method returns a new Iterator given an\n * Iterable. However it will also create an Iterator for a non-Iterable\n * Array-like collection, such as Array in a non-ES2015 environment.\n *\n * `createIterator` is complimentary to `forEach`, but allows a \"pull\"-based\n * iteration as opposed to `forEach`'s \"push\"-based iteration.\n *\n * `createIterator` produces an Iterator for Array-likes with the same behavior\n * as ArrayIteratorPrototype described in the ECMAScript specification, and\n * does *not* skip over \"holes\".\n *\n * @example\n *\n * var createIterator = require('iterall').createIterator\n *\n * var myArraylike = { length: 3, 0: 'Alpha', 1: 'Bravo', 2: 'Charlie' }\n * var iterator = createIterator(myArraylike)\n * iterator.next() // { value: 'Alpha', done: false }\n * iterator.next() // { value: 'Bravo', done: false }\n * iterator.next() // { value: 'Charlie', done: false }\n * iterator.next() // { value: undefined, done: true }\n *\n * @template T the type of each iterated value\n * @param {Iterable<T>|{ length: number }} collection\n * An Iterable or Array-like object to produce an Iterator.\n * @return {Iterator<T>} new Iterator instance.\n */\n/*:: declare export var createIterator:\n & (<+TValue>(collection: Iterable<TValue>) => Iterator<TValue>)\n & ((collection: {length: number}) => Iterator<mixed>)\n & ((collection: mixed) => (void | Iterator<mixed>)); */\nexport function createIterator(collection) {\n if (collection != null) {\n var iterator = getIterator(collection)\n if (iterator) {\n return iterator\n }\n if (isArrayLike(collection)) {\n return new ArrayLikeIterator(collection)\n }\n }\n}\n\n// When the object provided to `createIterator` is not Iterable but is\n// Array-like, this simple Iterator is created.\nfunction ArrayLikeIterator(obj) {\n this._o = obj\n this._i = 0\n}\n\n// Note: all Iterators are themselves Iterable.\nArrayLikeIterator.prototype[$$iterator] = function() {\n return this\n}\n\n// A simple state-machine determines the IteratorResult returned, yielding\n// each value in the Array-like object in order of their indicies.\nArrayLikeIterator.prototype.next = function() {\n if (this._o === void 0 || this._i >= this._o.length) {\n this._o = void 0\n return { value: void 0, done: true }\n }\n return { value: this._o[this._i++], done: false }\n}\n\n/**\n * Given an object which either implements the Iterable protocol or is\n * Array-like, iterate over it, calling the `callback` at each iteration.\n *\n * Use `forEach` where you would expect to use a `for ... of` loop in ES6.\n * However `forEach` adheres to the behavior of [Array#forEach][] described in\n * the ECMAScript specification, skipping over \"holes\" in Array-likes. It will\n * also delegate to a `forEach` method on `collection` if one is defined,\n * ensuring native performance for `Arrays`.\n *\n * Similar to [Array#forEach][], the `callback` function accepts three\n * arguments, and is provided with `thisArg` as the calling context.\n *\n * Note: providing an infinite Iterator to forEach will produce an error.\n *\n * [Array#forEach]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach\n *\n * @example\n *\n * var forEach = require('iterall').forEach\n *\n * forEach(myIterable, function (value, index, iterable) {\n * console.log(value, index, iterable === myIterable)\n * })\n *\n * @example\n *\n * // ES6:\n * for (let value of myIterable) {\n * console.log(value)\n * }\n *\n * // Any JavaScript environment:\n * forEach(myIterable, function (value) {\n * console.log(value)\n * })\n *\n * @template T the type of each iterated value\n * @param {Iterable<T>|{ length: number }} collection\n * The Iterable or array to iterate over.\n * @param {function(T, number, object)} callback\n * Function to execute for each iteration, taking up to three arguments\n * @param [thisArg]\n * Optional. Value to use as `this` when executing `callback`.\n */\n/*:: declare export var forEach:\n & (<+TValue, TCollection: Iterable<TValue>>(\n collection: TCollection,\n callbackFn: (value: TValue, index: number, collection: TCollection) => any,\n thisArg?: any\n ) => void)\n & (<TCollection: {length: number}>(\n collection: TCollection,\n callbackFn: (value: mixed, index: number, collection: TCollection) => any,\n thisArg?: any\n ) => void); */\nexport function forEach(collection, callback, thisArg) {\n if (collection != null) {\n if (typeof collection.forEach === 'function') {\n return collection.forEach(callback, thisArg)\n }\n var i = 0\n var iterator = getIterator(collection)\n if (iterator) {\n var step\n while (!(step = iterator.next()).done) {\n callback.call(thisArg, step.value, i++, collection)\n // Infinite Iterators could cause forEach to run forever.\n // After a very large number of iterations, produce an error.\n /* istanbul ignore if */\n if (i > 9999999) {\n throw new TypeError('Near-infinite iteration.')\n }\n }\n } else if (isArrayLike(collection)) {\n for (; i < collection.length; i++) {\n if (collection.hasOwnProperty(i)) {\n callback.call(thisArg, collection[i], i, collection)\n }\n }\n }\n }\n}\n\n/////////////////////////////////////////////////////\n// //\n// ASYNC ITERATORS //\n// //\n/////////////////////////////////////////////////////\n\n/**\n * [AsyncIterable](https://tc39.github.io/proposal-async-iteration/#sec-asynciterable-interface)\n * is a *protocol* which when implemented allows a JavaScript object to define\n * an asynchronous iteration behavior, such as what values are looped over in\n * a [`for-await-of`](https://tc39.github.io/proposal-async-iteration/#sec-for-in-and-for-of-statements)\n * loop or `iterall`'s {@link forAwaitEach} function.\n *\n * While described as a proposed addition to the [ES2017 version of JavaScript](https://tc39.github.io/proposal-async-iteration/)\n * it can be utilized by any version of JavaScript.\n *\n * @external AsyncIterable\n * @see {@link https://tc39.github.io/proposal-async-iteration/#sec-asynciterable-interface|Async Iteration Proposal}\n * @template T The type of each iterated value\n * @property {function (): AsyncIterator<T>} Symbol.asyncIterator\n * A method which produces an AsyncIterator for this AsyncIterable.\n */\n\n/**\n * [AsyncIterator](https://tc39.github.io/proposal-async-iteration/#sec-asynciterator-interface)\n * is a *protocol* which describes a standard way to produce and consume an\n * asynchronous sequence of values, typically the values of the\n * {@link AsyncIterable} represented by this {@link AsyncIterator}.\n *\n * AsyncIterator is similar to Observable or Stream. Like an {@link Iterator} it\n * also as a `next()` method, however instead of an IteratorResult,\n * calling this method returns a {@link Promise} for a IteratorResult.\n *\n * While described as a proposed addition to the [ES2017 version of JavaScript](https://tc39.github.io/proposal-async-iteration/)\n * it can be utilized by any version of JavaScript.\n *\n * @external AsyncIterator\n * @see {@link https://tc39.github.io/proposal-async-iteration/#sec-asynciterator-interface|Async Iteration Proposal}\n */\n\n// In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator\nvar SYMBOL_ASYNC_ITERATOR = SYMBOL && SYMBOL.asyncIterator\n\n/**\n * A property name to be used as the name of an AsyncIterable's method\n * responsible for producing an Iterator, referred to as `@@asyncIterator`.\n * Typically represents the value `Symbol.asyncIterator` but falls back to the\n * string `\"@@asyncIterator\"` when `Symbol.asyncIterator` is not defined.\n *\n * Use `$$asyncIterator` for defining new AsyncIterables instead of\n * `Symbol.asyncIterator`, but do not use it for accessing existing Iterables,\n * instead use {@link getAsyncIterator} or {@link isAsyncIterable}.\n *\n * @example\n *\n * var $$asyncIterator = require('iterall').$$asyncIterator\n *\n * function Chirper (to) {\n * this.to = to\n * }\n *\n * Chirper.prototype[$$asyncIterator] = function () {\n * return {\n * to: this.to,\n * num: 0,\n * next () {\n * return new Promise(resolve => {\n * if (this.num >= this.to) {\n * resolve({ value: undefined, done: true })\n * } else {\n * setTimeout(() => {\n * resolve({ value: this.num++, done: false })\n * }, 1000)\n * }\n * })\n * }\n * }\n * }\n *\n * var chirper = new Chirper(3)\n * for await (var number of chirper) {\n * console.log(number) // 0 ...wait... 1 ...wait... 2\n * }\n *\n * @type {Symbol|string}\n */\n/*:: declare export var $$asyncIterator: '@@asyncIterator'; */\nexport var $$asyncIterator = SYMBOL_ASYNC_ITERATOR || '@@asyncIterator'\n\n/**\n * Returns true if the provided object implements the AsyncIterator protocol via\n * either implementing a `Symbol.asyncIterator` or `\"@@asyncIterator\"` method.\n *\n * @example\n *\n * var isAsyncIterable = require('iterall').isAsyncIterable\n * isAsyncIterable(myStream) // true\n * isAsyncIterable('ABC') // false\n *\n * @param obj\n * A value which might implement the AsyncIterable protocol.\n * @return {boolean} true if AsyncIterable.\n */\n/*:: declare export function isAsyncIterable(obj: any): boolean; */\nexport function isAsyncIterable(obj) {\n return !!getAsyncIteratorMethod(obj)\n}\n\n/**\n * If the provided object implements the AsyncIterator protocol, its\n * AsyncIterator object is returned. Otherwise returns undefined.\n *\n * @example\n *\n * var getAsyncIterator = require('iterall').getAsyncIterator\n * var asyncIterator = getAsyncIterator(myStream)\n * asyncIterator.next().then(console.log) // { value: 1, done: false }\n * asyncIterator.next().then(console.log) // { value: 2, done: false }\n * asyncIterator.next().then(console.log) // { value: 3, done: false }\n * asyncIterator.next().then(console.log) // { value: undefined, done: true }\n *\n * @template T the type of each iterated value\n * @param {AsyncIterable<T>} asyncIterable\n * An AsyncIterable object which is the source of an AsyncIterator.\n * @return {AsyncIterator<T>} new AsyncIterator instance.\n */\n/*:: declare export var getAsyncIterator:\n & (<+TValue>(asyncIterable: AsyncIterable<TValue>) => AsyncIterator<TValue>)\n & ((asyncIterable: mixed) => (void | AsyncIterator<mixed>)); */\nexport function getAsyncIterator(asyncIterable) {\n var method = getAsyncIteratorMethod(asyncIterable)\n if (method) {\n return method.call(asyncIterable)\n }\n}\n\n/**\n * If the provided object implements the AsyncIterator protocol, the method\n * responsible for producing its AsyncIterator object is returned.\n *\n * This is used in rare cases for performance tuning. This method must be called\n * with obj as the contextual this-argument.\n *\n * @example\n *\n * var getAsyncIteratorMethod = require('iterall').getAsyncIteratorMethod\n * var method = getAsyncIteratorMethod(myStream)\n * if (method) {\n * var asyncIterator = method.call(myStream)\n * }\n *\n * @template T the type of each iterated value\n * @param {AsyncIterable<T>} asyncIterable\n * An AsyncIterable object which defines an `@@asyncIterator` method.\n * @return {function(): AsyncIterator<T>} `@@asyncIterator` method.\n */\n/*:: declare export var getAsyncIteratorMethod:\n & (<+TValue>(asyncIterable: AsyncIterable<TValue>) => (() => AsyncIterator<TValue>))\n & ((asyncIterable: mixed) => (void | (() => AsyncIterator<mixed>))); */\nexport function getAsyncIteratorMethod(asyncIterable) {\n if (asyncIterable != null) {\n var method =\n (SYMBOL_ASYNC_ITERATOR && asyncIterable[SYMBOL_ASYNC_ITERATOR]) ||\n asyncIterable['@@asyncIterator']\n if (typeof method === 'function') {\n return method\n }\n }\n}\n\n/**\n * Similar to {@link getAsyncIterator}, this method returns a new AsyncIterator\n * given an AsyncIterable. However it will also create an AsyncIterator for a\n * non-async Iterable as well as non-Iterable Array-like collection, such as\n * Array in a pre-ES2015 environment.\n *\n * `createAsyncIterator` is complimentary to `forAwaitEach`, but allows a\n * buffering \"pull\"-based iteration as opposed to `forAwaitEach`'s\n * \"push\"-based iteration.\n *\n * `createAsyncIterator` produces an AsyncIterator for non-async Iterables as\n * described in the ECMAScript proposal [Async-from-Sync Iterator Objects](https://tc39.github.io/proposal-async-iteration/#sec-async-from-sync-iterator-objects).\n *\n * > Note: Creating `AsyncIterator`s requires the existence of `Promise`.\n * > While `Promise` has been available in modern browsers for a number of\n * > years, legacy browsers (like IE 11) may require a polyfill.\n *\n * @example\n *\n * var createAsyncIterator = require('iterall').createAsyncIterator\n *\n * var myArraylike = { length: 3, 0: 'Alpha', 1: 'Bravo', 2: 'Charlie' }\n * var iterator = createAsyncIterator(myArraylike)\n * iterator.next().then(console.log) // { value: 'Alpha', done: false }\n * iterator.next().then(console.log) // { value: 'Bravo', done: false }\n * iterator.next().then(console.log) // { value: 'Charlie', done: false }\n * iterator.next().then(console.log) // { value: undefined, done: true }\n *\n * @template T the type of each iterated value\n * @param {AsyncIterable<T>|Iterable<T>|{ length: number }} source\n * An AsyncIterable, Iterable, or Array-like object to produce an Iterator.\n * @return {AsyncIterator<T>} new AsyncIterator instance.\n */\n/*:: declare export var createAsyncIterator:\n & (<+TValue>(\n collection: Iterable<Promise<TValue> | TValue> | AsyncIterable<TValue>\n ) => AsyncIterator<TValue>)\n & ((collection: {length: number}) => AsyncIterator<mixed>)\n & ((collection: mixed) => (void | AsyncIterator<mixed>)); */\nexport function createAsyncIterator(source) {\n if (source != null) {\n var asyncIterator = getAsyncIterator(source)\n if (asyncIterator) {\n return asyncIterator\n }\n var iterator = createIterator(source)\n if (iterator) {\n return new AsyncFromSyncIterator(iterator)\n }\n }\n}\n\n// When the object provided to `createAsyncIterator` is not AsyncIterable but is\n// sync Iterable, this simple wrapper is created.\nfunction AsyncFromSyncIterator(iterator) {\n this._i = iterator\n}\n\n// Note: all AsyncIterators are themselves AsyncIterable.\nAsyncFromSyncIterator.prototype[$$asyncIterator] = function() {\n return this\n}\n\n// A simple state-machine determines the IteratorResult returned, yielding\n// each value in the Array-like object in order of their indicies.\nAsyncFromSyncIterator.prototype.next = function() {\n var step = this._i.next()\n return Promise.resolve(step.value).then(function(value) {\n return { value: value, done: step.done }\n })\n}\n\n/**\n * Given an object which either implements the AsyncIterable protocol or is\n * Array-like, iterate over it, calling the `callback` at each iteration.\n *\n * Use `forAwaitEach` where you would expect to use a [for-await-of](https://tc39.github.io/proposal-async-iteration/#sec-for-in-and-for-of-statements) loop.\n *\n * Similar to [Array#forEach][], the `callback` function accepts three\n * arguments, and is provided with `thisArg` as the calling context.\n *\n * > Note: Using `forAwaitEach` requires the existence of `Promise`.\n * > While `Promise` has been available in modern browsers for a number of\n * > years, legacy browsers (like IE 11) may require a polyfill.\n *\n * @example\n *\n * var forAwaitEach = require('iterall').forAwaitEach\n *\n * forAwaitEach(myIterable, function (value, index, iterable) {\n * console.log(value, index, iterable === myIterable)\n * })\n *\n * @example\n *\n * // ES2017:\n * for await (let value of myAsyncIterable) {\n * console.log(await doSomethingAsync(value))\n * }\n * console.log('done')\n *\n * // Any JavaScript environment:\n * forAwaitEach(myAsyncIterable, function (value) {\n * return doSomethingAsync(value).then(console.log)\n * }).then(function () {\n * console.log('done')\n * })\n *\n * @template T the type of each iterated value\n * @param {AsyncIterable<T>|Iterable<Promise<T> | T>|{ length: number }} source\n * The AsyncIterable or array to iterate over.\n * @param {function(T, number, object)} callback\n * Function to execute for each iteration, taking up to three arguments\n * @param [thisArg]\n * Optional. Value to use as `this` when executing `callback`.\n */\n/*:: declare export var forAwaitEach:\n & (<+TValue, TCollection: Iterable<Promise<TValue> | TValue> | AsyncIterable<TValue>>(\n collection: TCollection,\n callbackFn: (value: TValue, index: number, collection: TCollection) => any,\n thisArg?: any\n ) => Promise<void>)\n & (<TCollection: { length: number }>(\n collection: TCollection,\n callbackFn: (value: mixed, index: number, collection: TCollection) => any,\n thisArg?: any\n ) => Promise<void>); */\nexport function forAwaitEach(source, callback, thisArg) {\n var asyncIterator = createAsyncIterator(source)\n if (asyncIterator) {\n var i = 0\n return new Promise(function(resolve, reject) {\n function next() {\n asyncIterator\n .next()\n .then(function(step) {\n if (!step.done) {\n Promise.resolve(callback.call(thisArg, step.value, i++, source))\n .then(next)\n .catch(reject)\n } else {\n resolve()\n }\n // Explicitly return null, silencing bluebird-style warnings.\n return null\n })\n .catch(reject)\n // Explicitly return null, silencing bluebird-style warnings.\n return null\n }\n next()\n })\n }\n}\n","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/**\n * Returns true if a value is null, undefined, or NaN.\n */\nexport default function isNullish(value) {\n return value === null || value === undefined || value !== value;\n}","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { forEach, isCollection } from 'iterall';\nimport inspect from '../jsutils/inspect';\nimport isNullish from '../jsutils/isNullish';\nimport isInvalid from '../jsutils/isInvalid';\nimport objectValues from '../jsutils/objectValues';\nimport { Kind } from '../language/kinds';\nimport { isScalarType, isEnumType, isInputObjectType, isListType, isNonNullType } from '../type/definition';\nimport { GraphQLID } from '../type/scalars';\n/**\n * Produces a GraphQL Value AST given a JavaScript value.\n *\n * A GraphQL type must be provided, which will be used to interpret different\n * JavaScript values.\n *\n * | JSON Value | GraphQL Value |\n * | ------------- | -------------------- |\n * | Object | Input Object |\n * | Array | List |\n * | Boolean | Boolean |\n * | String | String / Enum Value |\n * | Number | Int / Float |\n * | Mixed | Enum Value |\n * | null | NullValue |\n *\n */\n\nexport function astFromValue(value, type) {\n if (isNonNullType(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if (astValue && astValue.kind === Kind.NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: Kind.NULL\n };\n } // undefined, NaN\n\n\n if (isInvalid(value)) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if (isListType(type)) {\n var itemType = type.ofType;\n\n if (isCollection(value)) {\n var valuesNodes = [];\n forEach(value, function (item) {\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode) {\n valuesNodes.push(itemNode);\n }\n });\n return {\n kind: Kind.LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if (isInputObjectType(type)) {\n if (value === null || _typeof(value) !== 'object') {\n return null;\n }\n\n var fields = objectValues(type.getFields());\n var fieldNodes = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = fields[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var field = _step.value;\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: Kind.OBJECT_FIELD,\n name: {\n kind: Kind.NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return {\n kind: Kind.OBJECT,\n fields: fieldNodes\n };\n }\n\n if (isScalarType(type) || isEnumType(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (isNullish(serialized)) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: Kind.BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number') {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: Kind.INT,\n value: stringNum\n } : {\n kind: Kind.FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (isEnumType(type)) {\n return {\n kind: Kind.ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === GraphQLID && integerStringRegExp.test(serialized)) {\n return {\n kind: Kind.INT,\n value: serialized\n };\n }\n\n return {\n kind: Kind.STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat(inspect(serialized)));\n }\n /* istanbul ignore next */\n\n\n throw new Error(\"Unknown type: \".concat(type, \".\"));\n}\n/**\n * IntValue:\n * - NegativeSign? 0\n * - NegativeSign? NonZeroDigit ( Digit+ )?\n */\n\nvar integerStringRegExp = /^-?(0|[1-9][0-9]*)$/;","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport inspect from '../jsutils/inspect';\nexport var QueryDocumentKeys = {\n Name: [],\n Document: ['definitions'],\n OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'],\n VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'],\n Variable: ['name'],\n SelectionSet: ['selections'],\n Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'],\n Argument: ['name', 'value'],\n FragmentSpread: ['name', 'directives'],\n InlineFragment: ['typeCondition', 'directives', 'selectionSet'],\n FragmentDefinition: ['name', // Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n 'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'],\n IntValue: [],\n FloatValue: [],\n StringValue: [],\n BooleanValue: [],\n NullValue: [],\n EnumValue: [],\n ListValue: ['values'],\n ObjectValue: ['fields'],\n ObjectField: ['name', 'value'],\n Directive: ['name', 'arguments'],\n NamedType: ['name'],\n ListType: ['type'],\n NonNullType: ['type'],\n SchemaDefinition: ['directives', 'operationTypes'],\n OperationTypeDefinition: ['type'],\n ScalarTypeDefinition: ['description', 'name', 'directives'],\n ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],\n FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'],\n InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'],\n InterfaceTypeDefinition: ['description', 'name', 'directives', 'fields'],\n UnionTypeDefinition: ['description', 'name', 'directives', 'types'],\n EnumTypeDefinition: ['description', 'name', 'directives', 'values'],\n EnumValueDefinition: ['description', 'name', 'directives'],\n InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'],\n DirectiveDefinition: ['description', 'name', 'arguments', 'locations'],\n SchemaExtension: ['directives', 'operationTypes'],\n ScalarTypeExtension: ['name', 'directives'],\n ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n InterfaceTypeExtension: ['name', 'directives', 'fields'],\n UnionTypeExtension: ['name', 'directives', 'types'],\n EnumTypeExtension: ['name', 'directives', 'values'],\n InputObjectTypeExtension: ['name', 'directives', 'fields']\n};\nexport var BREAK = {};\n/**\n * visit() will walk through an AST using a depth first traversal, calling\n * the visitor's enter function at each node in the traversal, and calling the\n * leave function after visiting that node and all of its child nodes.\n *\n * By returning different values from the enter and leave functions, the\n * behavior of the visitor can be altered, including skipping over a sub-tree of\n * the AST (by returning false), editing the AST by returning a value or null\n * to remove the value, or to stop the whole traversal by returning BREAK.\n *\n * When using visit() to edit an AST, the original AST will not be modified, and\n * a new version of the AST with the changes applied will be returned from the\n * visit function.\n *\n * const editedAST = visit(ast, {\n * enter(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: skip visiting this node\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * },\n * leave(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: no action\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * }\n * });\n *\n * Alternatively to providing enter() and leave() functions, a visitor can\n * instead provide functions named the same as the kinds of AST nodes, or\n * enter/leave visitors at a named key, leading to four permutations of\n * visitor API:\n *\n * 1) Named visitors triggered when entering a node a specific kind.\n *\n * visit(ast, {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * })\n *\n * 2) Named visitors that trigger upon entering and leaving a node of\n * a specific kind.\n *\n * visit(ast, {\n * Kind: {\n * enter(node) {\n * // enter the \"Kind\" node\n * }\n * leave(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n *\n * 3) Generic visitors that trigger upon entering and leaving any node.\n *\n * visit(ast, {\n * enter(node) {\n * // enter any node\n * },\n * leave(node) {\n * // leave any node\n * }\n * })\n *\n * 4) Parallel visitors for entering and leaving nodes of a specific kind.\n *\n * visit(ast, {\n * enter: {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * },\n * leave: {\n * Kind(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n */\n\nexport function visit(root, visitor) {\n var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys;\n\n /* eslint-disable no-undef-init */\n var stack = undefined;\n var inArray = Array.isArray(root);\n var keys = [root];\n var index = -1;\n var edits = [];\n var node = undefined;\n var key = undefined;\n var parent = undefined;\n var path = [];\n var ancestors = [];\n var newRoot = root;\n /* eslint-enable no-undef-init */\n\n do {\n index++;\n var isLeaving = index === keys.length;\n var isEdited = isLeaving && edits.length !== 0;\n\n if (isLeaving) {\n key = ancestors.length === 0 ? undefined : path[path.length - 1];\n node = parent;\n parent = ancestors.pop();\n\n if (isEdited) {\n if (inArray) {\n node = node.slice();\n } else {\n var clone = {};\n\n for (var k in node) {\n if (node.hasOwnProperty(k)) {\n clone[k] = node[k];\n }\n }\n\n node = clone;\n }\n\n var editOffset = 0;\n\n for (var ii = 0; ii < edits.length; ii++) {\n var editKey = edits[ii][0];\n var editValue = edits[ii][1];\n\n if (inArray) {\n editKey -= editOffset;\n }\n\n if (inArray && editValue === null) {\n node.splice(editKey, 1);\n editOffset++;\n } else {\n node[editKey] = editValue;\n }\n }\n }\n\n index = stack.index;\n keys = stack.keys;\n edits = stack.edits;\n inArray = stack.inArray;\n stack = stack.prev;\n } else {\n key = parent ? inArray ? index : keys[index] : undefined;\n node = parent ? parent[key] : newRoot;\n\n if (node === null || node === undefined) {\n continue;\n }\n\n if (parent) {\n path.push(key);\n }\n }\n\n var result = void 0;\n\n if (!Array.isArray(node)) {\n if (!isNode(node)) {\n throw new Error('Invalid AST Node: ' + inspect(node));\n }\n\n var visitFn = getVisitFn(visitor, node.kind, isLeaving);\n\n if (visitFn) {\n result = visitFn.call(visitor, node, key, parent, path, ancestors);\n\n if (result === BREAK) {\n break;\n }\n\n if (result === false) {\n if (!isLeaving) {\n path.pop();\n continue;\n }\n } else if (result !== undefined) {\n edits.push([key, result]);\n\n if (!isLeaving) {\n if (isNode(result)) {\n node = result;\n } else {\n path.pop();\n continue;\n }\n }\n }\n }\n }\n\n if (result === undefined && isEdited) {\n edits.push([key, node]);\n }\n\n if (isLeaving) {\n path.pop();\n } else {\n stack = {\n inArray: inArray,\n index: index,\n keys: keys,\n edits: edits,\n prev: stack\n };\n inArray = Array.isArray(node);\n keys = inArray ? node : visitorKeys[node.kind] || [];\n index = -1;\n edits = [];\n\n if (parent) {\n ancestors.push(parent);\n }\n\n parent = node;\n }\n } while (stack !== undefined);\n\n if (edits.length !== 0) {\n newRoot = edits[edits.length - 1][1];\n }\n\n return newRoot;\n}\n\nfunction isNode(maybeNode) {\n return Boolean(maybeNode && typeof maybeNode.kind === 'string');\n}\n/**\n * Creates a new visitor instance which delegates to many visitors to run in\n * parallel. Each visitor will be visited for each node before moving on.\n *\n * If a prior visitor edits a node, no following visitors will see that node.\n */\n\n\nexport function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (!skipping[i]) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}\n/**\n * Creates a new visitor instance which maintains a provided TypeInfo instance\n * along with visiting visitor.\n */\n\nexport function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}\n/**\n * Given a visitor instance, if it is leaving or not, and a node kind, return\n * the function the visitor runtime should call.\n */\n\nexport function getVisitFn(visitor, kind, isLeaving) {\n var kindVisitor = visitor[kind];\n\n if (kindVisitor) {\n if (!isLeaving && typeof kindVisitor === 'function') {\n // { Kind() {} }\n return kindVisitor;\n }\n\n var kindSpecificVisitor = isLeaving ? kindVisitor.leave : kindVisitor.enter;\n\n if (typeof kindSpecificVisitor === 'function') {\n // { Kind: { enter() {}, leave() {} } }\n return kindSpecificVisitor;\n }\n } else {\n var specificVisitor = isLeaving ? visitor.leave : visitor.enter;\n\n if (specificVisitor) {\n if (typeof specificVisitor === 'function') {\n // { enter() {}, leave() {} }\n return specificVisitor;\n }\n\n var specificKindVisitor = specificVisitor[kind];\n\n if (typeof specificKindVisitor === 'function') {\n // { enter: { Kind() {} }, leave: { Kind() {} } }\n return specificKindVisitor;\n }\n }\n }\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { visit } from './visitor';\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n */\n\nexport function print(ast) {\n return visit(ast, {\n leave: printDocASTReducer\n });\n}\nvar printDocASTReducer = {\n Name: function Name(node) {\n return node.value;\n },\n Variable: function Variable(node) {\n return '$' + node.name;\n },\n // Document\n Document: function Document(node) {\n return join(node.definitions, '\\n\\n') + '\\n';\n },\n OperationDefinition: function OperationDefinition(node) {\n var op = node.operation;\n var name = node.name;\n var varDefs = wrap('(', join(node.variableDefinitions, ', '), ')');\n var directives = join(node.directives, ' ');\n var selectionSet = node.selectionSet; // Anonymous queries with no directives or variable definitions can use\n // the query short form.\n\n return !name && !directives && !varDefs && op === 'query' ? selectionSet : join([op, join([name, varDefs]), directives, selectionSet], ' ');\n },\n VariableDefinition: function VariableDefinition(_ref) {\n var variable = _ref.variable,\n type = _ref.type,\n defaultValue = _ref.defaultValue,\n directives = _ref.directives;\n return variable + ': ' + type + wrap(' = ', defaultValue) + wrap(' ', join(directives, ' '));\n },\n SelectionSet: function SelectionSet(_ref2) {\n var selections = _ref2.selections;\n return block(selections);\n },\n Field: function Field(_ref3) {\n var alias = _ref3.alias,\n name = _ref3.name,\n args = _ref3.arguments,\n directives = _ref3.directives,\n selectionSet = _ref3.selectionSet;\n return join([wrap('', alias, ': ') + name + wrap('(', join(args, ', '), ')'), join(directives, ' '), selectionSet], ' ');\n },\n Argument: function Argument(_ref4) {\n var name = _ref4.name,\n value = _ref4.value;\n return name + ': ' + value;\n },\n // Fragments\n FragmentSpread: function FragmentSpread(_ref5) {\n var name = _ref5.name,\n directives = _ref5.directives;\n return '...' + name + wrap(' ', join(directives, ' '));\n },\n InlineFragment: function InlineFragment(_ref6) {\n var typeCondition = _ref6.typeCondition,\n directives = _ref6.directives,\n selectionSet = _ref6.selectionSet;\n return join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' ');\n },\n FragmentDefinition: function FragmentDefinition(_ref7) {\n var name = _ref7.name,\n typeCondition = _ref7.typeCondition,\n variableDefinitions = _ref7.variableDefinitions,\n directives = _ref7.directives,\n selectionSet = _ref7.selectionSet;\n return (// Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n \"fragment \".concat(name).concat(wrap('(', join(variableDefinitions, ', '), ')'), \" \") + \"on \".concat(typeCondition, \" \").concat(wrap('', join(directives, ' '), ' ')) + selectionSet\n );\n },\n // Value\n IntValue: function IntValue(_ref8) {\n var value = _ref8.value;\n return value;\n },\n FloatValue: function FloatValue(_ref9) {\n var value = _ref9.value;\n return value;\n },\n StringValue: function StringValue(_ref10, key) {\n var value = _ref10.value,\n isBlockString = _ref10.block;\n return isBlockString ? printBlockString(value, key === 'description') : JSON.stringify(value);\n },\n BooleanValue: function BooleanValue(_ref11) {\n var value = _ref11.value;\n return value ? 'true' : 'false';\n },\n NullValue: function NullValue() {\n return 'null';\n },\n EnumValue: function EnumValue(_ref12) {\n var value = _ref12.value;\n return value;\n },\n ListValue: function ListValue(_ref13) {\n var values = _ref13.values;\n return '[' + join(values, ', ') + ']';\n },\n ObjectValue: function ObjectValue(_ref14) {\n var fields = _ref14.fields;\n return '{' + join(fields, ', ') + '}';\n },\n ObjectField: function ObjectField(_ref15) {\n var name = _ref15.name,\n value = _ref15.value;\n return name + ': ' + value;\n },\n // Directive\n Directive: function Directive(_ref16) {\n var name = _ref16.name,\n args = _ref16.arguments;\n return '@' + name + wrap('(', join(args, ', '), ')');\n },\n // Type\n NamedType: function NamedType(_ref17) {\n var name = _ref17.name;\n return name;\n },\n ListType: function ListType(_ref18) {\n var type = _ref18.type;\n return '[' + type + ']';\n },\n NonNullType: function NonNullType(_ref19) {\n var type = _ref19.type;\n return type + '!';\n },\n // Type System Definitions\n SchemaDefinition: function SchemaDefinition(_ref20) {\n var directives = _ref20.directives,\n operationTypes = _ref20.operationTypes;\n return join(['schema', join(directives, ' '), block(operationTypes)], ' ');\n },\n OperationTypeDefinition: function OperationTypeDefinition(_ref21) {\n var operation = _ref21.operation,\n type = _ref21.type;\n return operation + ': ' + type;\n },\n ScalarTypeDefinition: addDescription(function (_ref22) {\n var name = _ref22.name,\n directives = _ref22.directives;\n return join(['scalar', name, join(directives, ' ')], ' ');\n }),\n ObjectTypeDefinition: addDescription(function (_ref23) {\n var name = _ref23.name,\n interfaces = _ref23.interfaces,\n directives = _ref23.directives,\n fields = _ref23.fields;\n return join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n }),\n FieldDefinition: addDescription(function (_ref24) {\n var name = _ref24.name,\n args = _ref24.arguments,\n type = _ref24.type,\n directives = _ref24.directives;\n return name + (args.every(function (arg) {\n return arg.indexOf('\\n') === -1;\n }) ? wrap('(', join(args, ', '), ')') : wrap('(\\n', indent(join(args, '\\n')), '\\n)')) + ': ' + type + wrap(' ', join(directives, ' '));\n }),\n InputValueDefinition: addDescription(function (_ref25) {\n var name = _ref25.name,\n type = _ref25.type,\n defaultValue = _ref25.defaultValue,\n directives = _ref25.directives;\n return join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' ');\n }),\n InterfaceTypeDefinition: addDescription(function (_ref26) {\n var name = _ref26.name,\n directives = _ref26.directives,\n fields = _ref26.fields;\n return join(['interface', name, join(directives, ' '), block(fields)], ' ');\n }),\n UnionTypeDefinition: addDescription(function (_ref27) {\n var name = _ref27.name,\n directives = _ref27.directives,\n types = _ref27.types;\n return join(['union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');\n }),\n EnumTypeDefinition: addDescription(function (_ref28) {\n var name = _ref28.name,\n directives = _ref28.directives,\n values = _ref28.values;\n return join(['enum', name, join(directives, ' '), block(values)], ' ');\n }),\n EnumValueDefinition: addDescription(function (_ref29) {\n var name = _ref29.name,\n directives = _ref29.directives;\n return join([name, join(directives, ' ')], ' ');\n }),\n InputObjectTypeDefinition: addDescription(function (_ref30) {\n var name = _ref30.name,\n directives = _ref30.directives,\n fields = _ref30.fields;\n return join(['input', name, join(directives, ' '), block(fields)], ' ');\n }),\n DirectiveDefinition: addDescription(function (_ref31) {\n var name = _ref31.name,\n args = _ref31.arguments,\n locations = _ref31.locations;\n return 'directive @' + name + (args.every(function (arg) {\n return arg.indexOf('\\n') === -1;\n }) ? wrap('(', join(args, ', '), ')') : wrap('(\\n', indent(join(args, '\\n')), '\\n)')) + ' on ' + join(locations, ' | ');\n }),\n SchemaExtension: function SchemaExtension(_ref32) {\n var directives = _ref32.directives,\n operationTypes = _ref32.operationTypes;\n return join(['extend schema', join(directives, ' '), block(operationTypes)], ' ');\n },\n ScalarTypeExtension: function ScalarTypeExtension(_ref33) {\n var name = _ref33.name,\n directives = _ref33.directives;\n return join(['extend scalar', name, join(directives, ' ')], ' ');\n },\n ObjectTypeExtension: function ObjectTypeExtension(_ref34) {\n var name = _ref34.name,\n interfaces = _ref34.interfaces,\n directives = _ref34.directives,\n fields = _ref34.fields;\n return join(['extend type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n },\n InterfaceTypeExtension: function InterfaceTypeExtension(_ref35) {\n var name = _ref35.name,\n directives = _ref35.directives,\n fields = _ref35.fields;\n return join(['extend interface', name, join(directives, ' '), block(fields)], ' ');\n },\n UnionTypeExtension: function UnionTypeExtension(_ref36) {\n var name = _ref36.name,\n directives = _ref36.directives,\n types = _ref36.types;\n return join(['extend union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');\n },\n EnumTypeExtension: function EnumTypeExtension(_ref37) {\n var name = _ref37.name,\n directives = _ref37.directives,\n values = _ref37.values;\n return join(['extend enum', name, join(directives, ' '), block(values)], ' ');\n },\n InputObjectTypeExtension: function InputObjectTypeExtension(_ref38) {\n var name = _ref38.name,\n directives = _ref38.directives,\n fields = _ref38.fields;\n return join(['extend input', name, join(directives, ' '), block(fields)], ' ');\n }\n};\n\nfunction addDescription(cb) {\n return function (node) {\n return join([node.description, cb(node)], '\\n');\n };\n}\n/**\n * Given maybeArray, print an empty string if it is null or empty, otherwise\n * print all items together separated by separator if provided\n */\n\n\nfunction join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}\n/**\n * Given array, print each item on its own line, wrapped in an\n * indented \"{ }\" block.\n */\n\n\nfunction block(array) {\n return array && array.length !== 0 ? '{\\n' + indent(join(array, '\\n')) + '\\n}' : '';\n}\n/**\n * If maybeString is not null or empty, then wrap with start and end, otherwise\n * print an empty string.\n */\n\n\nfunction wrap(start, maybeString, end) {\n return maybeString ? start + maybeString + (end || '') : '';\n}\n\nfunction indent(maybeString) {\n return maybeString && ' ' + maybeString.replace(/\\n/g, '\\n ');\n}\n/**\n * Print a block string in the indented block form by adding a leading and\n * trailing blank line. However, if a block string starts with whitespace and is\n * a single-line, adding a leading blank line would strip that whitespace.\n */\n\n\nfunction printBlockString(value, isDescription) {\n var escaped = value.replace(/\"\"\"/g, '\\\\\"\"\"');\n return (value[0] === ' ' || value[0] === '\\t') && value.indexOf('\\n') === -1 ? \"\\\"\\\"\\\"\".concat(escaped.replace(/\"$/, '\"\\n'), \"\\\"\\\"\\\"\") : \"\\\"\\\"\\\"\\n\".concat(isDescription ? escaped : indent(escaped), \"\\n\\\"\\\"\\\"\");\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport isInvalid from '../jsutils/isInvalid';\nimport objectValues from '../jsutils/objectValues';\nimport { astFromValue } from '../utilities/astFromValue';\nimport { print } from '../language/printer';\nimport { GraphQLObjectType, GraphQLEnumType, GraphQLList, GraphQLNonNull, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isListType, isNonNullType, isAbstractType, isNamedType } from './definition';\nimport { GraphQLString, GraphQLBoolean } from './scalars';\nimport { DirectiveLocation } from '../language/directiveLocation';\nexport var __Schema = new GraphQLObjectType({\n name: '__Schema',\n description: 'A GraphQL Schema defines the capabilities of a GraphQL server. It ' + 'exposes all available types and directives on the server, as well as ' + 'the entry points for query, mutation, and subscription operations.',\n fields: function fields() {\n return {\n types: {\n description: 'A list of all types supported by this server.',\n type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__Type))),\n resolve: function resolve(schema) {\n return objectValues(schema.getTypeMap());\n }\n },\n queryType: {\n description: 'The type that query operations will be rooted at.',\n type: GraphQLNonNull(__Type),\n resolve: function resolve(schema) {\n return schema.getQueryType();\n }\n },\n mutationType: {\n description: 'If this server supports mutation, the type that ' + 'mutation operations will be rooted at.',\n type: __Type,\n resolve: function resolve(schema) {\n return schema.getMutationType();\n }\n },\n subscriptionType: {\n description: 'If this server support subscription, the type that ' + 'subscription operations will be rooted at.',\n type: __Type,\n resolve: function resolve(schema) {\n return schema.getSubscriptionType();\n }\n },\n directives: {\n description: 'A list of all directives supported by this server.',\n type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__Directive))),\n resolve: function resolve(schema) {\n return schema.getDirectives();\n }\n }\n };\n }\n});\nexport var __Directive = new GraphQLObjectType({\n name: '__Directive',\n description: 'A Directive provides a way to describe alternate runtime execution and ' + 'type validation behavior in a GraphQL document.' + \"\\n\\nIn some cases, you need to provide options to alter GraphQL's \" + 'execution behavior in ways field arguments will not suffice, such as ' + 'conditionally including or skipping a field. Directives provide this by ' + 'describing additional information to the executor.',\n fields: function fields() {\n return {\n name: {\n type: GraphQLNonNull(GraphQLString),\n resolve: function resolve(obj) {\n return obj.name;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(obj) {\n return obj.description;\n }\n },\n locations: {\n type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__DirectiveLocation))),\n resolve: function resolve(obj) {\n return obj.locations;\n }\n },\n args: {\n type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue))),\n resolve: function resolve(directive) {\n return directive.args || [];\n }\n }\n };\n }\n});\nexport var __DirectiveLocation = new GraphQLEnumType({\n name: '__DirectiveLocation',\n description: 'A Directive can be adjacent to many parts of the GraphQL language, a ' + '__DirectiveLocation describes one such possible adjacencies.',\n values: {\n QUERY: {\n value: DirectiveLocation.QUERY,\n description: 'Location adjacent to a query operation.'\n },\n MUTATION: {\n value: DirectiveLocation.MUTATION,\n description: 'Location adjacent to a mutation operation.'\n },\n SUBSCRIPTION: {\n value: DirectiveLocation.SUBSCRIPTION,\n description: 'Location adjacent to a subscription operation.'\n },\n FIELD: {\n value: DirectiveLocation.FIELD,\n description: 'Location adjacent to a field.'\n },\n FRAGMENT_DEFINITION: {\n value: DirectiveLocation.FRAGMENT_DEFINITION,\n description: 'Location adjacent to a fragment definition.'\n },\n FRAGMENT_SPREAD: {\n value: DirectiveLocation.FRAGMENT_SPREAD,\n description: 'Location adjacent to a fragment spread.'\n },\n INLINE_FRAGMENT: {\n value: DirectiveLocation.INLINE_FRAGMENT,\n description: 'Location adjacent to an inline fragment.'\n },\n VARIABLE_DEFINITION: {\n value: DirectiveLocation.VARIABLE_DEFINITION,\n description: 'Location adjacent to a variable definition.'\n },\n SCHEMA: {\n value: DirectiveLocation.SCHEMA,\n description: 'Location adjacent to a schema definition.'\n },\n SCALAR: {\n value: DirectiveLocation.SCALAR,\n description: 'Location adjacent to a scalar definition.'\n },\n OBJECT: {\n value: DirectiveLocation.OBJECT,\n description: 'Location adjacent to an object type definition.'\n },\n FIELD_DEFINITION: {\n value: DirectiveLocation.FIELD_DEFINITION,\n description: 'Location adjacent to a field definition.'\n },\n ARGUMENT_DEFINITION: {\n value: DirectiveLocation.ARGUMENT_DEFINITION,\n description: 'Location adjacent to an argument definition.'\n },\n INTERFACE: {\n value: DirectiveLocation.INTERFACE,\n description: 'Location adjacent to an interface definition.'\n },\n UNION: {\n value: DirectiveLocation.UNION,\n description: 'Location adjacent to a union definition.'\n },\n ENUM: {\n value: DirectiveLocation.ENUM,\n description: 'Location adjacent to an enum definition.'\n },\n ENUM_VALUE: {\n value: DirectiveLocation.ENUM_VALUE,\n description: 'Location adjacent to an enum value definition.'\n },\n INPUT_OBJECT: {\n value: DirectiveLocation.INPUT_OBJECT,\n description: 'Location adjacent to an input object type definition.'\n },\n INPUT_FIELD_DEFINITION: {\n value: DirectiveLocation.INPUT_FIELD_DEFINITION,\n description: 'Location adjacent to an input object field definition.'\n }\n }\n});\nexport var __Type = new GraphQLObjectType({\n name: '__Type',\n description: 'The fundamental unit of any GraphQL Schema is the type. There are ' + 'many kinds of types in GraphQL as represented by the `__TypeKind` enum.' + '\\n\\nDepending on the kind of a type, certain fields describe ' + 'information about that type. Scalar types provide no information ' + 'beyond a name and description, while Enum types provide their values. ' + 'Object and Interface types provide the fields they describe. Abstract ' + 'types, Union and Interface, provide the Object types possible ' + 'at runtime. List and NonNull types compose other types.',\n fields: function fields() {\n return {\n kind: {\n type: GraphQLNonNull(__TypeKind),\n resolve: function resolve(type) {\n if (isScalarType(type)) {\n return TypeKind.SCALAR;\n } else if (isObjectType(type)) {\n return TypeKind.OBJECT;\n } else if (isInterfaceType(type)) {\n return TypeKind.INTERFACE;\n } else if (isUnionType(type)) {\n return TypeKind.UNION;\n } else if (isEnumType(type)) {\n return TypeKind.ENUM;\n } else if (isInputObjectType(type)) {\n return TypeKind.INPUT_OBJECT;\n } else if (isListType(type)) {\n return TypeKind.LIST;\n } else if (isNonNullType(type)) {\n return TypeKind.NON_NULL;\n }\n\n throw new Error('Unknown kind of type: ' + type);\n }\n },\n name: {\n type: GraphQLString,\n resolve: function resolve(obj) {\n return obj.name;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(obj) {\n return obj.description;\n }\n },\n fields: {\n type: GraphQLList(GraphQLNonNull(__Field)),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false\n }\n },\n resolve: function resolve(type, _ref) {\n var includeDeprecated = _ref.includeDeprecated;\n\n if (isObjectType(type) || isInterfaceType(type)) {\n var fields = objectValues(type.getFields());\n\n if (!includeDeprecated) {\n fields = fields.filter(function (field) {\n return !field.deprecationReason;\n });\n }\n\n return fields;\n }\n\n return null;\n }\n },\n interfaces: {\n type: GraphQLList(GraphQLNonNull(__Type)),\n resolve: function resolve(type) {\n if (isObjectType(type)) {\n return type.getInterfaces();\n }\n }\n },\n possibleTypes: {\n type: GraphQLList(GraphQLNonNull(__Type)),\n resolve: function resolve(type, args, context, _ref2) {\n var schema = _ref2.schema;\n\n if (isAbstractType(type)) {\n return schema.getPossibleTypes(type);\n }\n }\n },\n enumValues: {\n type: GraphQLList(GraphQLNonNull(__EnumValue)),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false\n }\n },\n resolve: function resolve(type, _ref3) {\n var includeDeprecated = _ref3.includeDeprecated;\n\n if (isEnumType(type)) {\n var values = type.getValues();\n\n if (!includeDeprecated) {\n values = values.filter(function (value) {\n return !value.deprecationReason;\n });\n }\n\n return values;\n }\n }\n },\n inputFields: {\n type: GraphQLList(GraphQLNonNull(__InputValue)),\n resolve: function resolve(type) {\n if (isInputObjectType(type)) {\n return objectValues(type.getFields());\n }\n }\n },\n ofType: {\n type: __Type,\n resolve: function resolve(obj) {\n return obj.ofType;\n }\n }\n };\n }\n});\nexport var __Field = new GraphQLObjectType({\n name: '__Field',\n description: 'Object and Interface types are described by a list of Fields, each of ' + 'which has a name, potentially a list of arguments, and a return type.',\n fields: function fields() {\n return {\n name: {\n type: GraphQLNonNull(GraphQLString),\n resolve: function resolve(obj) {\n return obj.name;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(obj) {\n return obj.description;\n }\n },\n args: {\n type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue))),\n resolve: function resolve(field) {\n return field.args || [];\n }\n },\n type: {\n type: GraphQLNonNull(__Type),\n resolve: function resolve(obj) {\n return obj.type;\n }\n },\n isDeprecated: {\n type: GraphQLNonNull(GraphQLBoolean),\n resolve: function resolve(obj) {\n return obj.isDeprecated;\n }\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: function resolve(obj) {\n return obj.deprecationReason;\n }\n }\n };\n }\n});\nexport var __InputValue = new GraphQLObjectType({\n name: '__InputValue',\n description: 'Arguments provided to Fields or Directives and the input fields of an ' + 'InputObject are represented as Input Values which describe their type ' + 'and optionally a default value.',\n fields: function fields() {\n return {\n name: {\n type: GraphQLNonNull(GraphQLString),\n resolve: function resolve(obj) {\n return obj.name;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(obj) {\n return obj.description;\n }\n },\n type: {\n type: GraphQLNonNull(__Type),\n resolve: function resolve(obj) {\n return obj.type;\n }\n },\n defaultValue: {\n type: GraphQLString,\n description: 'A GraphQL-formatted string representing the default value for this ' + 'input value.',\n resolve: function resolve(inputVal) {\n return isInvalid(inputVal.defaultValue) ? null : print(astFromValue(inputVal.defaultValue, inputVal.type));\n }\n }\n };\n }\n});\nexport var __EnumValue = new GraphQLObjectType({\n name: '__EnumValue',\n description: 'One possible value for a given Enum. Enum values are unique values, not ' + 'a placeholder for a string or numeric value. However an Enum value is ' + 'returned in a JSON response as a string.',\n fields: function fields() {\n return {\n name: {\n type: GraphQLNonNull(GraphQLString),\n resolve: function resolve(obj) {\n return obj.name;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(obj) {\n return obj.description;\n }\n },\n isDeprecated: {\n type: GraphQLNonNull(GraphQLBoolean),\n resolve: function resolve(obj) {\n return obj.isDeprecated;\n }\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: function resolve(obj) {\n return obj.deprecationReason;\n }\n }\n };\n }\n});\nexport var TypeKind = {\n SCALAR: 'SCALAR',\n OBJECT: 'OBJECT',\n INTERFACE: 'INTERFACE',\n UNION: 'UNION',\n ENUM: 'ENUM',\n INPUT_OBJECT: 'INPUT_OBJECT',\n LIST: 'LIST',\n NON_NULL: 'NON_NULL'\n};\nexport var __TypeKind = new GraphQLEnumType({\n name: '__TypeKind',\n description: 'An enum describing what kind of type a given `__Type` is.',\n values: {\n SCALAR: {\n value: TypeKind.SCALAR,\n description: 'Indicates this type is a scalar.'\n },\n OBJECT: {\n value: TypeKind.OBJECT,\n description: 'Indicates this type is an object. ' + '`fields` and `interfaces` are valid fields.'\n },\n INTERFACE: {\n value: TypeKind.INTERFACE,\n description: 'Indicates this type is an interface. ' + '`fields` and `possibleTypes` are valid fields.'\n },\n UNION: {\n value: TypeKind.UNION,\n description: 'Indicates this type is a union. `possibleTypes` is a valid field.'\n },\n ENUM: {\n value: TypeKind.ENUM,\n description: 'Indicates this type is an enum. `enumValues` is a valid field.'\n },\n INPUT_OBJECT: {\n value: TypeKind.INPUT_OBJECT,\n description: 'Indicates this type is an input object. ' + '`inputFields` is a valid field.'\n },\n LIST: {\n value: TypeKind.LIST,\n description: 'Indicates this type is a list. `ofType` is a valid field.'\n },\n NON_NULL: {\n value: TypeKind.NON_NULL,\n description: 'Indicates this type is a non-null. `ofType` is a valid field.'\n }\n }\n});\n/**\n * Note that these are GraphQLField and not GraphQLFieldConfig,\n * so the format for args is different.\n */\n\nexport var SchemaMetaFieldDef = {\n name: '__schema',\n type: GraphQLNonNull(__Schema),\n description: 'Access the current type schema of this server.',\n args: [],\n resolve: function resolve(source, args, context, _ref4) {\n var schema = _ref4.schema;\n return schema;\n }\n};\nexport var TypeMetaFieldDef = {\n name: '__type',\n type: __Type,\n description: 'Request the type information of a single type.',\n args: [{\n name: 'name',\n type: GraphQLNonNull(GraphQLString)\n }],\n resolve: function resolve(source, _ref5, context, _ref6) {\n var name = _ref5.name;\n var schema = _ref6.schema;\n return schema.getType(name);\n }\n};\nexport var TypeNameMetaFieldDef = {\n name: '__typename',\n type: GraphQLNonNull(GraphQLString),\n description: 'The name of the current Object type at runtime.',\n args: [],\n resolve: function resolve(source, args, context, _ref7) {\n var parentType = _ref7.parentType;\n return parentType.name;\n }\n};\nexport var introspectionTypes = [__Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind];\nexport function isIntrospectionType(type) {\n return isNamedType(type) && ( // Would prefer to use introspectionTypes.some(), however %checks needs\n // a simple expression.\n type.name === __Schema.name || type.name === __Directive.name || type.name === __DirectiveLocation.name || type.name === __Type.name || type.name === __Field.name || type.name === __InputValue.name || type.name === __EnumValue.name || type.name === __TypeKind.name);\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nexport default function find(list, predicate) {\n for (var i = 0; i < list.length; i++) {\n if (predicate(list[i])) {\n return list[i];\n }\n }\n}","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { isAbstractType, isObjectType, isInterfaceType, isUnionType, isInputObjectType, isWrappingType } from './definition';\nimport { GraphQLDirective, isDirective, specifiedDirectives } from './directives';\nimport inspect from '../jsutils/inspect';\nimport { __Schema } from './introspection';\nimport defineToStringTag from '../jsutils/defineToStringTag';\nimport find from '../jsutils/find';\nimport instanceOf from '../jsutils/instanceOf';\nimport invariant from '../jsutils/invariant';\nimport objectValues from '../jsutils/objectValues';\n// eslint-disable-next-line no-redeclare\nexport function isSchema(schema) {\n return instanceOf(schema, GraphQLSchema);\n}\n/**\n * Schema Definition\n *\n * A Schema is created by supplying the root types of each type of operation,\n * query and mutation (optional). A schema definition is then supplied to the\n * validator and executor.\n *\n * Example:\n *\n * const MyAppSchema = new GraphQLSchema({\n * query: MyAppQueryRootType,\n * mutation: MyAppMutationRootType,\n * })\n *\n * Note: If an array of `directives` are provided to GraphQLSchema, that will be\n * the exact list of directives represented and allowed. If `directives` is not\n * provided then a default set of the specified directives (e.g. @include and\n * @skip) will be used. If you wish to provide *additional* directives to these\n * specified directives, you must explicitly declare them. Example:\n *\n * const MyAppSchema = new GraphQLSchema({\n * ...\n * directives: specifiedDirectives.concat([ myCustomDirective ]),\n * })\n *\n */\n\nexport var GraphQLSchema =\n/*#__PURE__*/\nfunction () {\n // Used as a cache for validateSchema().\n // Referenced by validateSchema().\n function GraphQLSchema(config) {\n _defineProperty(this, \"astNode\", void 0);\n\n _defineProperty(this, \"extensionASTNodes\", void 0);\n\n _defineProperty(this, \"_queryType\", void 0);\n\n _defineProperty(this, \"_mutationType\", void 0);\n\n _defineProperty(this, \"_subscriptionType\", void 0);\n\n _defineProperty(this, \"_directives\", void 0);\n\n _defineProperty(this, \"_typeMap\", void 0);\n\n _defineProperty(this, \"_implementations\", void 0);\n\n _defineProperty(this, \"_possibleTypeMap\", void 0);\n\n _defineProperty(this, \"__validationErrors\", void 0);\n\n _defineProperty(this, \"__allowedLegacyNames\", void 0);\n\n // If this schema was built from a source known to be valid, then it may be\n // marked with assumeValid to avoid an additional type system validation.\n if (config && config.assumeValid) {\n this.__validationErrors = [];\n } else {\n // Otherwise check for common mistakes during construction to produce\n // clear and early error messages.\n !(_typeof(config) === 'object') ? invariant(0, 'Must provide configuration object.') : void 0;\n !(!config.types || Array.isArray(config.types)) ? invariant(0, \"\\\"types\\\" must be Array if provided but got: \".concat(inspect(config.types), \".\")) : void 0;\n !(!config.directives || Array.isArray(config.directives)) ? invariant(0, '\"directives\" must be Array if provided but got: ' + \"\".concat(inspect(config.directives), \".\")) : void 0;\n !(!config.allowedLegacyNames || Array.isArray(config.allowedLegacyNames)) ? invariant(0, '\"allowedLegacyNames\" must be Array if provided but got: ' + \"\".concat(inspect(config.allowedLegacyNames), \".\")) : void 0;\n }\n\n this.__allowedLegacyNames = config.allowedLegacyNames || [];\n this._queryType = config.query;\n this._mutationType = config.mutation;\n this._subscriptionType = config.subscription; // Provide specified directives (e.g. @include and @skip) by default.\n\n this._directives = config.directives || specifiedDirectives;\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes; // Build type map now to detect any errors within this schema.\n\n var initialTypes = [this.getQueryType(), this.getMutationType(), this.getSubscriptionType(), __Schema];\n var types = config.types;\n\n if (types) {\n initialTypes = initialTypes.concat(types);\n } // Keep track of all types referenced within the schema.\n\n\n var typeMap = Object.create(null); // First by deeply visiting all initial types.\n\n typeMap = initialTypes.reduce(typeMapReducer, typeMap); // Then by deeply visiting all directive types.\n\n typeMap = this._directives.reduce(typeMapDirectiveReducer, typeMap); // Storing the resulting map for reference by the schema.\n\n this._typeMap = typeMap; // Keep track of all implementations by interface name.\n\n this._implementations = Object.create(null);\n\n var _arr = Object.keys(this._typeMap);\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var typeName = _arr[_i];\n var type = this._typeMap[typeName];\n\n if (isObjectType(type)) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = type.getInterfaces()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var iface = _step.value;\n\n if (isInterfaceType(iface)) {\n var impls = this._implementations[iface.name];\n\n if (impls) {\n impls.push(type);\n } else {\n this._implementations[iface.name] = [type];\n }\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n } else if (isAbstractType(type) && !this._implementations[type.name]) {\n this._implementations[type.name] = [];\n }\n }\n }\n\n var _proto = GraphQLSchema.prototype;\n\n _proto.getQueryType = function getQueryType() {\n return this._queryType;\n };\n\n _proto.getMutationType = function getMutationType() {\n return this._mutationType;\n };\n\n _proto.getSubscriptionType = function getSubscriptionType() {\n return this._subscriptionType;\n };\n\n _proto.getTypeMap = function getTypeMap() {\n return this._typeMap;\n };\n\n _proto.getType = function getType(name) {\n return this.getTypeMap()[name];\n };\n\n _proto.getPossibleTypes = function getPossibleTypes(abstractType) {\n if (isUnionType(abstractType)) {\n return abstractType.getTypes();\n }\n\n return this._implementations[abstractType.name];\n };\n\n _proto.isPossibleType = function isPossibleType(abstractType, possibleType) {\n var possibleTypeMap = this._possibleTypeMap;\n\n if (!possibleTypeMap) {\n this._possibleTypeMap = possibleTypeMap = Object.create(null);\n }\n\n if (!possibleTypeMap[abstractType.name]) {\n var possibleTypes = this.getPossibleTypes(abstractType);\n possibleTypeMap[abstractType.name] = possibleTypes.reduce(function (map, type) {\n return map[type.name] = true, map;\n }, Object.create(null));\n }\n\n return Boolean(possibleTypeMap[abstractType.name][possibleType.name]);\n };\n\n _proto.getDirectives = function getDirectives() {\n return this._directives;\n };\n\n _proto.getDirective = function getDirective(name) {\n return find(this.getDirectives(), function (directive) {\n return directive.name === name;\n });\n };\n\n return GraphQLSchema;\n}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported\n\ndefineToStringTag(GraphQLSchema);\n\nfunction typeMapReducer(map, type) {\n if (!type) {\n return map;\n }\n\n if (isWrappingType(type)) {\n return typeMapReducer(map, type.ofType);\n }\n\n if (map[type.name]) {\n !(map[type.name] === type) ? invariant(0, 'Schema must contain unique named types but contains multiple ' + \"types named \\\"\".concat(type.name, \"\\\".\")) : void 0;\n return map;\n }\n\n map[type.name] = type;\n var reducedMap = map;\n\n if (isUnionType(type)) {\n reducedMap = type.getTypes().reduce(typeMapReducer, reducedMap);\n }\n\n if (isObjectType(type)) {\n reducedMap = type.getInterfaces().reduce(typeMapReducer, reducedMap);\n }\n\n if (isObjectType(type) || isInterfaceType(type)) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = objectValues(type.getFields())[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var field = _step2.value;\n\n if (field.args) {\n var fieldArgTypes = field.args.map(function (arg) {\n return arg.type;\n });\n reducedMap = fieldArgTypes.reduce(typeMapReducer, reducedMap);\n }\n\n reducedMap = typeMapReducer(reducedMap, field.type);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n\n if (isInputObjectType(type)) {\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = objectValues(type.getFields())[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var _field = _step3.value;\n reducedMap = typeMapReducer(reducedMap, _field.type);\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return != null) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n }\n\n return reducedMap;\n}\n\nfunction typeMapDirectiveReducer(map, directive) {\n // Directives are not validated until validateSchema() is called.\n if (!isDirective(directive)) {\n return map;\n }\n\n return directive.args.reduce(function (_map, arg) {\n return typeMapReducer(_map, arg.type);\n }, map);\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/**\n * Represents a location in a Source.\n */\n\n/**\n * Takes a Source and a UTF-8 character offset, and returns the corresponding\n * line and column as a SourceLocation.\n */\nexport function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { getLocation } from '../language/location';\n\n/**\n * Prints a GraphQLError to a string, representing useful location information\n * about the error's position in the source.\n */\nexport function printError(error) {\n var printedLocations = [];\n\n if (error.nodes) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = error.nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var node = _step.value;\n\n if (node.loc) {\n printedLocations.push(highlightSourceAtLocation(node.loc.source, getLocation(node.loc.source, node.loc.start)));\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n } else if (error.source && error.locations) {\n var source = error.source;\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = error.locations[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var location = _step2.value;\n printedLocations.push(highlightSourceAtLocation(source, location));\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n\n return printedLocations.length === 0 ? error.message : [error.message].concat(printedLocations).join('\\n\\n') + '\\n';\n}\n/**\n * Render a helpful description of the location of the error in the GraphQL\n * Source document.\n */\n\nfunction highlightSourceAtLocation(source, location) {\n var firstLineColumnOffset = source.locationOffset.column - 1;\n var body = whitespace(firstLineColumnOffset) + source.body;\n var lineIndex = location.line - 1;\n var lineOffset = source.locationOffset.line - 1;\n var lineNum = location.line + lineOffset;\n var columnOffset = location.line === 1 ? firstLineColumnOffset : 0;\n var columnNum = location.column + columnOffset;\n var lines = body.split(/\\r\\n|[\\n\\r]/g);\n return \"\".concat(source.name, \" (\").concat(lineNum, \":\").concat(columnNum, \")\\n\") + printPrefixedLines([// Lines specified like this: [\"prefix\", \"string\"],\n [\"\".concat(lineNum - 1, \": \"), lines[lineIndex - 1]], [\"\".concat(lineNum, \": \"), lines[lineIndex]], ['', whitespace(columnNum - 1) + '^'], [\"\".concat(lineNum + 1, \": \"), lines[lineIndex + 1]]]);\n}\n\nfunction printPrefixedLines(lines) {\n var existingLines = lines.filter(function (_ref) {\n var _ = _ref[0],\n line = _ref[1];\n return line !== undefined;\n });\n var padLen = 0;\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = existingLines[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var _ref4 = _step3.value;\n var prefix = _ref4[0];\n padLen = Math.max(padLen, prefix.length);\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return != null) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n return existingLines.map(function (_ref3) {\n var prefix = _ref3[0],\n line = _ref3[1];\n return lpad(padLen, prefix) + line;\n }).join('\\n');\n}\n\nfunction whitespace(len) {\n return Array(len + 1).join(' ');\n}\n\nfunction lpad(len, str) {\n return whitespace(len - str.length) + str;\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { printError } from './printError';\nimport { getLocation } from '../language/location';\nexport function GraphQLError( // eslint-disable-line no-redeclare\nmessage, nodes, source, positions, path, originalError, extensions) {\n // Compute list of blame nodes.\n var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined; // Compute locations in the source for the given nodes/positions.\n\n\n var _source = source;\n\n if (!_source && _nodes) {\n var node = _nodes[0];\n _source = node && node.loc && node.loc.source;\n }\n\n var _positions = positions;\n\n if (!_positions && _nodes) {\n _positions = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(node.loc.start);\n }\n\n return list;\n }, []);\n }\n\n if (_positions && _positions.length === 0) {\n _positions = undefined;\n }\n\n var _locations;\n\n if (positions && source) {\n _locations = positions.map(function (pos) {\n return getLocation(source, pos);\n });\n } else if (_nodes) {\n _locations = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(getLocation(node.loc.source, node.loc.start));\n }\n\n return list;\n }, []);\n }\n\n var _extensions = extensions || originalError && originalError.extensions;\n\n Object.defineProperties(this, {\n message: {\n value: message,\n // By being enumerable, JSON.stringify will include `message` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true,\n writable: true\n },\n locations: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: _locations || undefined,\n // By being enumerable, JSON.stringify will include `locations` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: Boolean(_locations)\n },\n path: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: path || undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: Boolean(path)\n },\n nodes: {\n value: _nodes || undefined\n },\n source: {\n value: _source || undefined\n },\n positions: {\n value: _positions || undefined\n },\n originalError: {\n value: originalError\n },\n extensions: {\n // Coercing falsey values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: _extensions || undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: Boolean(_extensions)\n }\n }); // Include (non-enumerable) stack trace.\n\n if (originalError && originalError.stack) {\n Object.defineProperty(this, 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true\n });\n } else if (Error.captureStackTrace) {\n Error.captureStackTrace(this, GraphQLError);\n } else {\n Object.defineProperty(this, 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true\n });\n }\n}\nGraphQLError.prototype = Object.create(Error.prototype, {\n constructor: {\n value: GraphQLError\n },\n name: {\n value: 'GraphQLError'\n },\n toString: {\n value: function toString() {\n return printError(this);\n }\n }\n});","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../error/GraphQLError';\nimport invariant from '../jsutils/invariant';\nvar NAME_RX = /^[_a-zA-Z][_a-zA-Z0-9]*$/;\n/**\n * Upholds the spec rules about naming.\n */\n\nexport function assertValidName(name) {\n var error = isValidNameError(name);\n\n if (error) {\n throw error;\n }\n\n return name;\n}\n/**\n * Returns an Error if a name is invalid.\n */\n\nexport function isValidNameError(name, node) {\n !(typeof name === 'string') ? invariant(0, 'Expected string') : void 0;\n\n if (name.length > 1 && name[0] === '_' && name[1] === '_') {\n return new GraphQLError(\"Name \\\"\".concat(name, \"\\\" must not begin with \\\"__\\\", which is reserved by \") + 'GraphQL introspection.', node);\n }\n\n if (!NAME_RX.test(name)) {\n return new GraphQLError(\"Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \\\"\".concat(name, \"\\\" does not.\"), node);\n }\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { isObjectType, isListType, isNonNullType, isAbstractType } from '../type/definition';\n\n/**\n * Provided two types, return true if the types are equal (invariant).\n */\nexport function isEqualType(typeA, typeB) {\n // Equivalent types are equal.\n if (typeA === typeB) {\n return true;\n } // If either type is non-null, the other must also be non-null.\n\n\n if (isNonNullType(typeA) && isNonNullType(typeB)) {\n return isEqualType(typeA.ofType, typeB.ofType);\n } // If either type is a list, the other must also be a list.\n\n\n if (isListType(typeA) && isListType(typeB)) {\n return isEqualType(typeA.ofType, typeB.ofType);\n } // Otherwise the types are not equal.\n\n\n return false;\n}\n/**\n * Provided a type and a super type, return true if the first type is either\n * equal or a subset of the second super type (covariant).\n */\n\nexport function isTypeSubTypeOf(schema, maybeSubType, superType) {\n // Equivalent type is a valid subtype\n if (maybeSubType === superType) {\n return true;\n } // If superType is non-null, maybeSubType must also be non-null.\n\n\n if (isNonNullType(superType)) {\n if (isNonNullType(maybeSubType)) {\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType);\n }\n\n return false;\n }\n\n if (isNonNullType(maybeSubType)) {\n // If superType is nullable, maybeSubType may be non-null or nullable.\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType);\n } // If superType type is a list, maybeSubType type must also be a list.\n\n\n if (isListType(superType)) {\n if (isListType(maybeSubType)) {\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType);\n }\n\n return false;\n }\n\n if (isListType(maybeSubType)) {\n // If superType is not a list, maybeSubType must also be not a list.\n return false;\n } // If superType type is an abstract type, maybeSubType type may be a currently\n // possible object type.\n\n\n if (isAbstractType(superType) && isObjectType(maybeSubType) && schema.isPossibleType(superType, maybeSubType)) {\n return true;\n } // Otherwise, the child type is not a valid subtype of the parent type.\n\n\n return false;\n}\n/**\n * Provided two composite types, determine if they \"overlap\". Two composite\n * types overlap when the Sets of possible concrete types for each intersect.\n *\n * This is often used to determine if a fragment of a given type could possibly\n * be visited in a context of another type.\n *\n * This function is commutative.\n */\n\nexport function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if (isAbstractType(typeA)) {\n if (isAbstractType(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema.getPossibleTypes(typeA).some(function (type) {\n return schema.isPossibleType(typeB, type);\n });\n } // Determine if the latter type is a possible concrete type of the former.\n\n\n return schema.isPossibleType(typeA, typeB);\n }\n\n if (isAbstractType(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isPossibleType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n\n return false;\n}","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport invariant from '../jsutils/invariant';\nimport defineToStringTag from '../jsutils/defineToStringTag';\n\n/**\n * A representation of source input to GraphQL.\n * `name` and `locationOffset` are optional. They are useful for clients who\n * store GraphQL documents in source files; for example, if the GraphQL input\n * starts at line 40 in a file named Foo.graphql, it might be useful for name to\n * be \"Foo.graphql\" and location to be `{ line: 40, column: 0 }`.\n * line and column in locationOffset are 1-indexed\n */\nexport var Source = function Source(body, name, locationOffset) {\n _defineProperty(this, \"body\", void 0);\n\n _defineProperty(this, \"name\", void 0);\n\n _defineProperty(this, \"locationOffset\", void 0);\n\n this.body = body;\n this.name = name || 'GraphQL request';\n this.locationOffset = locationOffset || {\n line: 1,\n column: 1\n };\n !(this.locationOffset.line > 0) ? invariant(0, 'line in locationOffset is 1-indexed and must be positive') : void 0;\n !(this.locationOffset.column > 0) ? invariant(0, 'column in locationOffset is 1-indexed and must be positive') : void 0;\n}; // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported\n\ndefineToStringTag(Source);","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from './GraphQLError';\n/**\n * Produces a GraphQLError representing a syntax error, containing useful\n * descriptive information about the syntax error's position in the source.\n */\n\nexport function syntaxError(source, position, description) {\n return new GraphQLError(\"Syntax Error: \".concat(description), undefined, source, [position]);\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from './GraphQLError';\n\n/**\n * Given an arbitrary Error, presumably thrown while attempting to execute a\n * GraphQL operation, produce a new GraphQLError aware of the location in the\n * document responsible for the original Error.\n */\nexport function locatedError(originalError, nodes, path) {\n // Note: this uses a brand-check to support GraphQL errors originating from\n // other contexts.\n if (originalError && Array.isArray(originalError.path)) {\n return originalError;\n }\n\n return new GraphQLError(originalError && originalError.message, originalError && originalError.nodes || nodes, originalError && originalError.source, originalError && originalError.positions, path, originalError);\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport invariant from '../jsutils/invariant';\n\n/**\n * Given a GraphQLError, format it according to the rules described by the\n * Response Format, Errors section of the GraphQL Specification.\n */\nexport function formatError(error) {\n !error ? invariant(0, 'Received null or undefined error.') : void 0;\n var message = error.message || 'An unknown error occurred.';\n var locations = error.locations;\n var path = error.path;\n var extensions = error.extensions;\n return extensions ? {\n message: message,\n locations: locations,\n path: path,\n extensions: extensions\n } : {\n message: message,\n locations: locations,\n path: path\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nexport { GraphQLError } from './GraphQLError';\nexport { syntaxError } from './syntaxError';\nexport { locatedError } from './locatedError';\nexport { printError } from './printError';\nexport { formatError } from './formatError';","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/**\n * Produces the value of a block string from its parsed raw value, similar to\n * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.\n *\n * This implements the GraphQL spec's BlockStringValue() static algorithm.\n */\nexport default function blockStringValue(rawString) {\n // Expand a block string's raw value into independent lines.\n var lines = rawString.split(/\\r\\n|[\\n\\r]/g); // Remove common indentation from all lines but first.\n\n var commonIndent = null;\n\n for (var i = 1; i < lines.length; i++) {\n var line = lines[i];\n var indent = leadingWhitespace(line);\n\n if (indent < line.length && (commonIndent === null || indent < commonIndent)) {\n commonIndent = indent;\n\n if (commonIndent === 0) {\n break;\n }\n }\n }\n\n if (commonIndent) {\n for (var _i = 1; _i < lines.length; _i++) {\n lines[_i] = lines[_i].slice(commonIndent);\n }\n } // Remove leading and trailing blank lines.\n\n\n while (lines.length > 0 && isBlank(lines[0])) {\n lines.shift();\n }\n\n while (lines.length > 0 && isBlank(lines[lines.length - 1])) {\n lines.pop();\n } // Return a string of the lines joined with U+000A.\n\n\n return lines.join('\\n');\n}\n\nfunction leadingWhitespace(str) {\n var i = 0;\n\n while (i < str.length && (str[i] === ' ' || str[i] === '\\t')) {\n i++;\n }\n\n return i;\n}\n\nfunction isBlank(str) {\n return leadingWhitespace(str) === str.length;\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { syntaxError } from '../error';\nimport blockStringValue from './blockStringValue';\n/**\n * Given a Source object, this returns a Lexer for that source.\n * A Lexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n */\n\nexport function createLexer(source, options) {\n var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null);\n var lexer = {\n source: source,\n options: options,\n lastToken: startOfFileToken,\n token: startOfFileToken,\n line: 1,\n lineStart: 0,\n advance: advanceLexer,\n lookahead: lookahead\n };\n return lexer;\n}\n\nfunction advanceLexer() {\n this.lastToken = this.token;\n var token = this.token = this.lookahead();\n return token;\n}\n\nfunction lookahead() {\n var token = this.token;\n\n if (token.kind !== TokenKind.EOF) {\n do {\n // Note: next is only mutable during parsing, so we cast to allow this.\n token = token.next || (token.next = readToken(this, token));\n } while (token.kind === TokenKind.COMMENT);\n }\n\n return token;\n}\n/**\n * The return type of createLexer.\n */\n\n\n/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\nexport var TokenKind = Object.freeze({\n SOF: '<SOF>',\n EOF: '<EOF>',\n BANG: '!',\n DOLLAR: '$',\n AMP: '&',\n PAREN_L: '(',\n PAREN_R: ')',\n SPREAD: '...',\n COLON: ':',\n EQUALS: '=',\n AT: '@',\n BRACKET_L: '[',\n BRACKET_R: ']',\n BRACE_L: '{',\n PIPE: '|',\n BRACE_R: '}',\n NAME: 'Name',\n INT: 'Int',\n FLOAT: 'Float',\n STRING: 'String',\n BLOCK_STRING: 'BlockString',\n COMMENT: 'Comment'\n});\n/**\n * The enum type representing the token kinds values.\n */\n\n/**\n * A helper function to describe a token as a string for debugging\n */\nexport function getTokenDesc(token) {\n var value = token.value;\n return value ? \"\".concat(token.kind, \" \\\"\").concat(value, \"\\\"\") : token.kind;\n}\nvar charCodeAt = String.prototype.charCodeAt;\nvar slice = String.prototype.slice;\n/**\n * Helper function for constructing the Token object.\n */\n\nfunction Tok(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n} // Print a simplified form when appearing in JSON/util.inspect.\n\n\nTok.prototype.toJSON = Tok.prototype.inspect = function toJSON() {\n return {\n kind: this.kind,\n value: this.value,\n line: this.line,\n column: this.column\n };\n};\n\nfunction printCharCode(code) {\n return (// NaN/undefined represents access beyond the end of the file.\n isNaN(code) ? TokenKind.EOF : // Trust JSON for ASCII.\n code < 0x007f ? JSON.stringify(String.fromCharCode(code)) : // Otherwise print the escaped form.\n \"\\\"\\\\u\".concat(('00' + code.toString(16).toUpperCase()).slice(-4), \"\\\"\")\n );\n}\n/**\n * Gets the next token from the source starting at the given position.\n *\n * This skips over whitespace and comments until it finds the next lexable\n * token, then lexes punctuators immediately or calls the appropriate helper\n * function for more complicated tokens.\n */\n\n\nfunction readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n\n if (pos >= bodyLength) {\n return new Tok(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n }\n\n var code = charCodeAt.call(body, pos); // SourceCharacter\n\n switch (code) {\n // !\n case 33:\n return new Tok(TokenKind.BANG, pos, pos + 1, line, col, prev);\n // #\n\n case 35:\n return readComment(source, pos, line, col, prev);\n // $\n\n case 36:\n return new Tok(TokenKind.DOLLAR, pos, pos + 1, line, col, prev);\n // &\n\n case 38:\n return new Tok(TokenKind.AMP, pos, pos + 1, line, col, prev);\n // (\n\n case 40:\n return new Tok(TokenKind.PAREN_L, pos, pos + 1, line, col, prev);\n // )\n\n case 41:\n return new Tok(TokenKind.PAREN_R, pos, pos + 1, line, col, prev);\n // .\n\n case 46:\n if (charCodeAt.call(body, pos + 1) === 46 && charCodeAt.call(body, pos + 2) === 46) {\n return new Tok(TokenKind.SPREAD, pos, pos + 3, line, col, prev);\n }\n\n break;\n // :\n\n case 58:\n return new Tok(TokenKind.COLON, pos, pos + 1, line, col, prev);\n // =\n\n case 61:\n return new Tok(TokenKind.EQUALS, pos, pos + 1, line, col, prev);\n // @\n\n case 64:\n return new Tok(TokenKind.AT, pos, pos + 1, line, col, prev);\n // [\n\n case 91:\n return new Tok(TokenKind.BRACKET_L, pos, pos + 1, line, col, prev);\n // ]\n\n case 93:\n return new Tok(TokenKind.BRACKET_R, pos, pos + 1, line, col, prev);\n // {\n\n case 123:\n return new Tok(TokenKind.BRACE_L, pos, pos + 1, line, col, prev);\n // |\n\n case 124:\n return new Tok(TokenKind.PIPE, pos, pos + 1, line, col, prev);\n // }\n\n case 125:\n return new Tok(TokenKind.BRACE_R, pos, pos + 1, line, col, prev);\n // A-Z _ a-z\n\n case 65:\n case 66:\n case 67:\n case 68:\n case 69:\n case 70:\n case 71:\n case 72:\n case 73:\n case 74:\n case 75:\n case 76:\n case 77:\n case 78:\n case 79:\n case 80:\n case 81:\n case 82:\n case 83:\n case 84:\n case 85:\n case 86:\n case 87:\n case 88:\n case 89:\n case 90:\n case 95:\n case 97:\n case 98:\n case 99:\n case 100:\n case 101:\n case 102:\n case 103:\n case 104:\n case 105:\n case 106:\n case 107:\n case 108:\n case 109:\n case 110:\n case 111:\n case 112:\n case 113:\n case 114:\n case 115:\n case 116:\n case 117:\n case 118:\n case 119:\n case 120:\n case 121:\n case 122:\n return readName(source, pos, line, col, prev);\n // - 0-9\n\n case 45:\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n return readNumber(source, pos, code, line, col, prev);\n // \"\n\n case 34:\n if (charCodeAt.call(body, pos + 1) === 34 && charCodeAt.call(body, pos + 2) === 34) {\n return readBlockString(source, pos, line, col, prev);\n }\n\n return readString(source, pos, line, col, prev);\n }\n\n throw syntaxError(source, pos, unexpectedCharacterMessage(code));\n}\n/**\n * Report a message that an unexpected character was encountered.\n */\n\n\nfunction unexpectedCharacterMessage(code) {\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n return \"Cannot contain the invalid character \".concat(printCharCode(code), \".\");\n }\n\n if (code === 39) {\n // '\n return \"Unexpected single quote character ('), did you mean to use \" + 'a double quote (\")?';\n }\n\n return \"Cannot parse the unexpected character \".concat(printCharCode(code), \".\");\n}\n/**\n * Reads from body starting at startPosition until it finds a non-whitespace\n * or commented character, then returns the position of that character for\n * lexing.\n */\n\n\nfunction positionAfterWhitespace(body, startPosition, lexer) {\n var bodyLength = body.length;\n var position = startPosition;\n\n while (position < bodyLength) {\n var code = charCodeAt.call(body, position); // tab | space | comma | BOM\n\n if (code === 9 || code === 32 || code === 44 || code === 0xfeff) {\n ++position;\n } else if (code === 10) {\n // new line\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n } else if (code === 13) {\n // carriage return\n if (charCodeAt.call(body, position + 1) === 10) {\n position += 2;\n } else {\n ++position;\n }\n\n ++lexer.line;\n lexer.lineStart = position;\n } else {\n break;\n }\n }\n\n return position;\n}\n/**\n * Reads a comment token from the source file.\n *\n * #[\\u0009\\u0020-\\uFFFF]*\n */\n\n\nfunction readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = charCodeAt.call(body, ++position);\n } while (code !== null && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Tok(TokenKind.COMMENT, start, position, line, col, prev, slice.call(body, start + 1, position));\n}\n/**\n * Reads a number token from the source file, either a float\n * or an int depending on whether a decimal point appears.\n *\n * Int: -?(0|[1-9][0-9]*)\n * Float: -?(0|[1-9][0-9]*)(\\.[0-9]+)?((E|e)(+|-)?[0-9]+)?\n */\n\n\nfunction readNumber(source, start, firstCode, line, col, prev) {\n var body = source.body;\n var code = firstCode;\n var position = start;\n var isFloat = false;\n\n if (code === 45) {\n // -\n code = charCodeAt.call(body, ++position);\n }\n\n if (code === 48) {\n // 0\n code = charCodeAt.call(body, ++position);\n\n if (code >= 48 && code <= 57) {\n throw syntaxError(source, position, \"Invalid number, unexpected digit after 0: \".concat(printCharCode(code), \".\"));\n }\n } else {\n position = readDigits(source, position, code);\n code = charCodeAt.call(body, position);\n }\n\n if (code === 46) {\n // .\n isFloat = true;\n code = charCodeAt.call(body, ++position);\n position = readDigits(source, position, code);\n code = charCodeAt.call(body, position);\n }\n\n if (code === 69 || code === 101) {\n // E e\n isFloat = true;\n code = charCodeAt.call(body, ++position);\n\n if (code === 43 || code === 45) {\n // + -\n code = charCodeAt.call(body, ++position);\n }\n\n position = readDigits(source, position, code);\n }\n\n return new Tok(isFloat ? TokenKind.FLOAT : TokenKind.INT, start, position, line, col, prev, slice.call(body, start, position));\n}\n/**\n * Returns the new position in the source after reading digits.\n */\n\n\nfunction readDigits(source, start, firstCode) {\n var body = source.body;\n var position = start;\n var code = firstCode;\n\n if (code >= 48 && code <= 57) {\n // 0 - 9\n do {\n code = charCodeAt.call(body, ++position);\n } while (code >= 48 && code <= 57); // 0 - 9\n\n\n return position;\n }\n\n throw syntaxError(source, position, \"Invalid number, expected digit but got: \".concat(printCharCode(code), \".\"));\n}\n/**\n * Reads a string token from the source file.\n *\n * \"([^\"\\\\\\u000A\\u000D]|(\\\\(u[0-9a-fA-F]{4}|[\"\\\\/bfnrt])))*\"\n */\n\n\nfunction readString(source, start, line, col, prev) {\n var body = source.body;\n var position = start + 1;\n var chunkStart = position;\n var code = 0;\n var value = '';\n\n while (position < body.length && (code = charCodeAt.call(body, position)) !== null && // not LineTerminator\n code !== 0x000a && code !== 0x000d) {\n // Closing Quote (\")\n if (code === 34) {\n value += slice.call(body, chunkStart, position);\n return new Tok(TokenKind.STRING, start, position + 1, line, col, prev, value);\n } // SourceCharacter\n\n\n if (code < 0x0020 && code !== 0x0009) {\n throw syntaxError(source, position, \"Invalid character within String: \".concat(printCharCode(code), \".\"));\n }\n\n ++position;\n\n if (code === 92) {\n // \\\n value += slice.call(body, chunkStart, position - 1);\n code = charCodeAt.call(body, position);\n\n switch (code) {\n case 34:\n value += '\"';\n break;\n\n case 47:\n value += '/';\n break;\n\n case 92:\n value += '\\\\';\n break;\n\n case 98:\n value += '\\b';\n break;\n\n case 102:\n value += '\\f';\n break;\n\n case 110:\n value += '\\n';\n break;\n\n case 114:\n value += '\\r';\n break;\n\n case 116:\n value += '\\t';\n break;\n\n case 117:\n // u\n var charCode = uniCharCode(charCodeAt.call(body, position + 1), charCodeAt.call(body, position + 2), charCodeAt.call(body, position + 3), charCodeAt.call(body, position + 4));\n\n if (charCode < 0) {\n throw syntaxError(source, position, 'Invalid character escape sequence: ' + \"\\\\u\".concat(body.slice(position + 1, position + 5), \".\"));\n }\n\n value += String.fromCharCode(charCode);\n position += 4;\n break;\n\n default:\n throw syntaxError(source, position, \"Invalid character escape sequence: \\\\\".concat(String.fromCharCode(code), \".\"));\n }\n\n ++position;\n chunkStart = position;\n }\n }\n\n throw syntaxError(source, position, 'Unterminated string.');\n}\n/**\n * Reads a block string token from the source file.\n *\n * \"\"\"(\"?\"?(\\\\\"\"\"|\\\\(?!=\"\"\")|[^\"\\\\]))*\"\"\"\n */\n\n\nfunction readBlockString(source, start, line, col, prev) {\n var body = source.body;\n var position = start + 3;\n var chunkStart = position;\n var code = 0;\n var rawValue = '';\n\n while (position < body.length && (code = charCodeAt.call(body, position)) !== null) {\n // Closing Triple-Quote (\"\"\")\n if (code === 34 && charCodeAt.call(body, position + 1) === 34 && charCodeAt.call(body, position + 2) === 34) {\n rawValue += slice.call(body, chunkStart, position);\n return new Tok(TokenKind.BLOCK_STRING, start, position + 3, line, col, prev, blockStringValue(rawValue));\n } // SourceCharacter\n\n\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw syntaxError(source, position, \"Invalid character within String: \".concat(printCharCode(code), \".\"));\n } // Escape Triple-Quote (\\\"\"\")\n\n\n if (code === 92 && charCodeAt.call(body, position + 1) === 34 && charCodeAt.call(body, position + 2) === 34 && charCodeAt.call(body, position + 3) === 34) {\n rawValue += slice.call(body, chunkStart, position) + '\"\"\"';\n position += 4;\n chunkStart = position;\n } else {\n ++position;\n }\n }\n\n throw syntaxError(source, position, 'Unterminated string.');\n}\n/**\n * Converts four hexadecimal chars to the integer that the\n * string represents. For example, uniCharCode('0','0','0','f')\n * will return 15, and uniCharCode('0','0','f','f') returns 255.\n *\n * Returns a negative number on error, if a char was invalid.\n *\n * This is implemented by noting that char2hex() returns -1 on error,\n * which means the result of ORing the char2hex() will also be negative.\n */\n\n\nfunction uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}\n/**\n * Converts a hex character to its integer value.\n * '0' becomes 0, '9' becomes 9\n * 'A' becomes 10, 'F' becomes 15\n * 'a' becomes 10, 'f' becomes 15\n *\n * Returns -1 on error.\n */\n\n\nfunction char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}\n/**\n * Reads an alphanumeric + underscore name from the source.\n *\n * [_A-Za-z][_0-9A-Za-z]*\n */\n\n\nfunction readName(source, start, line, col, prev) {\n var body = source.body;\n var bodyLength = body.length;\n var position = start + 1;\n var code = 0;\n\n while (position !== bodyLength && (code = charCodeAt.call(body, position)) !== null && (code === 95 || // _\n code >= 48 && code <= 57 || // 0-9\n code >= 65 && code <= 90 || // A-Z\n code >= 97 && code <= 122) // a-z\n ) {\n ++position;\n }\n\n return new Tok(TokenKind.NAME, start, position, line, col, prev, slice.call(body, start, position));\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport inspect from '../jsutils/inspect';\nimport { Source } from './source';\nimport { syntaxError } from '../error';\nimport { createLexer, TokenKind, getTokenDesc } from './lexer';\nimport { Kind } from './kinds';\nimport { DirectiveLocation } from './directiveLocation';\n/**\n * Configuration options to control parser behavior\n */\n\n/**\n * Given a GraphQL source, parses it into a Document.\n * Throws GraphQLError if a syntax error is encountered.\n */\nexport function parse(source, options) {\n var sourceObj = typeof source === 'string' ? new Source(source) : source;\n\n if (!(sourceObj instanceof Source)) {\n throw new TypeError(\"Must provide Source. Received: \".concat(inspect(sourceObj)));\n }\n\n var lexer = createLexer(sourceObj, options || {});\n return parseDocument(lexer);\n}\n/**\n * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for\n * that value.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Values directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: valueFromAST().\n */\n\nexport function parseValue(source, options) {\n var sourceObj = typeof source === 'string' ? new Source(source) : source;\n var lexer = createLexer(sourceObj, options || {});\n expect(lexer, TokenKind.SOF);\n var value = parseValueLiteral(lexer, false);\n expect(lexer, TokenKind.EOF);\n return value;\n}\n/**\n * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for\n * that type.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Types directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: typeFromAST().\n */\n\nexport function parseType(source, options) {\n var sourceObj = typeof source === 'string' ? new Source(source) : source;\n var lexer = createLexer(sourceObj, options || {});\n expect(lexer, TokenKind.SOF);\n var type = parseTypeReference(lexer);\n expect(lexer, TokenKind.EOF);\n return type;\n}\n/**\n * Converts a name lex token into a name parse node.\n */\n\nfunction parseName(lexer) {\n var token = expect(lexer, TokenKind.NAME);\n return {\n kind: Kind.NAME,\n value: token.value,\n loc: loc(lexer, token)\n };\n} // Implements the parsing rules in the Document section.\n\n/**\n * Document : Definition+\n */\n\n\nfunction parseDocument(lexer) {\n var start = lexer.token;\n return {\n kind: Kind.DOCUMENT,\n definitions: many(lexer, TokenKind.SOF, parseDefinition, TokenKind.EOF),\n loc: loc(lexer, start)\n };\n}\n/**\n * Definition :\n * - ExecutableDefinition\n * - TypeSystemDefinition\n * - TypeSystemExtension\n */\n\n\nfunction parseDefinition(lexer) {\n if (peek(lexer, TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n case 'fragment':\n return parseExecutableDefinition(lexer);\n\n case 'schema':\n case 'scalar':\n case 'type':\n case 'interface':\n case 'union':\n case 'enum':\n case 'input':\n case 'directive':\n return parseTypeSystemDefinition(lexer);\n\n case 'extend':\n return parseTypeSystemExtension(lexer);\n }\n } else if (peek(lexer, TokenKind.BRACE_L)) {\n return parseExecutableDefinition(lexer);\n } else if (peekDescription(lexer)) {\n return parseTypeSystemDefinition(lexer);\n }\n\n throw unexpected(lexer);\n}\n/**\n * ExecutableDefinition :\n * - OperationDefinition\n * - FragmentDefinition\n */\n\n\nfunction parseExecutableDefinition(lexer) {\n if (peek(lexer, TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return parseOperationDefinition(lexer);\n\n case 'fragment':\n return parseFragmentDefinition(lexer);\n }\n } else if (peek(lexer, TokenKind.BRACE_L)) {\n return parseOperationDefinition(lexer);\n }\n\n throw unexpected(lexer);\n} // Implements the parsing rules in the Operations section.\n\n/**\n * OperationDefinition :\n * - SelectionSet\n * - OperationType Name? VariableDefinitions? Directives? SelectionSet\n */\n\n\nfunction parseOperationDefinition(lexer) {\n var start = lexer.token;\n\n if (peek(lexer, TokenKind.BRACE_L)) {\n return {\n kind: Kind.OPERATION_DEFINITION,\n operation: 'query',\n name: undefined,\n variableDefinitions: [],\n directives: [],\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n }\n\n var operation = parseOperationType(lexer);\n var name;\n\n if (peek(lexer, TokenKind.NAME)) {\n name = parseName(lexer);\n }\n\n return {\n kind: Kind.OPERATION_DEFINITION,\n operation: operation,\n name: name,\n variableDefinitions: parseVariableDefinitions(lexer),\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n}\n/**\n * OperationType : one of query mutation subscription\n */\n\n\nfunction parseOperationType(lexer) {\n var operationToken = expect(lexer, TokenKind.NAME);\n\n switch (operationToken.value) {\n case 'query':\n return 'query';\n\n case 'mutation':\n return 'mutation';\n\n case 'subscription':\n return 'subscription';\n }\n\n throw unexpected(lexer, operationToken);\n}\n/**\n * VariableDefinitions : ( VariableDefinition+ )\n */\n\n\nfunction parseVariableDefinitions(lexer) {\n return peek(lexer, TokenKind.PAREN_L) ? many(lexer, TokenKind.PAREN_L, parseVariableDefinition, TokenKind.PAREN_R) : [];\n}\n/**\n * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?\n */\n\n\nfunction parseVariableDefinition(lexer) {\n var start = lexer.token;\n\n if (lexer.options.experimentalVariableDefinitionDirectives) {\n return {\n kind: Kind.VARIABLE_DEFINITION,\n variable: parseVariable(lexer),\n type: (expect(lexer, TokenKind.COLON), parseTypeReference(lexer)),\n defaultValue: skip(lexer, TokenKind.EQUALS) ? parseValueLiteral(lexer, true) : undefined,\n directives: parseDirectives(lexer, true),\n loc: loc(lexer, start)\n };\n }\n\n return {\n kind: Kind.VARIABLE_DEFINITION,\n variable: parseVariable(lexer),\n type: (expect(lexer, TokenKind.COLON), parseTypeReference(lexer)),\n defaultValue: skip(lexer, TokenKind.EQUALS) ? parseValueLiteral(lexer, true) : undefined,\n loc: loc(lexer, start)\n };\n}\n/**\n * Variable : $ Name\n */\n\n\nfunction parseVariable(lexer) {\n var start = lexer.token;\n expect(lexer, TokenKind.DOLLAR);\n return {\n kind: Kind.VARIABLE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n}\n/**\n * SelectionSet : { Selection+ }\n */\n\n\nfunction parseSelectionSet(lexer) {\n var start = lexer.token;\n return {\n kind: Kind.SELECTION_SET,\n selections: many(lexer, TokenKind.BRACE_L, parseSelection, TokenKind.BRACE_R),\n loc: loc(lexer, start)\n };\n}\n/**\n * Selection :\n * - Field\n * - FragmentSpread\n * - InlineFragment\n */\n\n\nfunction parseSelection(lexer) {\n return peek(lexer, TokenKind.SPREAD) ? parseFragment(lexer) : parseField(lexer);\n}\n/**\n * Field : Alias? Name Arguments? Directives? SelectionSet?\n *\n * Alias : Name :\n */\n\n\nfunction parseField(lexer) {\n var start = lexer.token;\n var nameOrAlias = parseName(lexer);\n var alias;\n var name;\n\n if (skip(lexer, TokenKind.COLON)) {\n alias = nameOrAlias;\n name = parseName(lexer);\n } else {\n name = nameOrAlias;\n }\n\n return {\n kind: Kind.FIELD,\n alias: alias,\n name: name,\n arguments: parseArguments(lexer, false),\n directives: parseDirectives(lexer, false),\n selectionSet: peek(lexer, TokenKind.BRACE_L) ? parseSelectionSet(lexer) : undefined,\n loc: loc(lexer, start)\n };\n}\n/**\n * Arguments[Const] : ( Argument[?Const]+ )\n */\n\n\nfunction parseArguments(lexer, isConst) {\n var item = isConst ? parseConstArgument : parseArgument;\n return peek(lexer, TokenKind.PAREN_L) ? many(lexer, TokenKind.PAREN_L, item, TokenKind.PAREN_R) : [];\n}\n/**\n * Argument[Const] : Name : Value[?Const]\n */\n\n\nfunction parseArgument(lexer) {\n var start = lexer.token;\n return {\n kind: Kind.ARGUMENT,\n name: parseName(lexer),\n value: (expect(lexer, TokenKind.COLON), parseValueLiteral(lexer, false)),\n loc: loc(lexer, start)\n };\n}\n\nfunction parseConstArgument(lexer) {\n var start = lexer.token;\n return {\n kind: Kind.ARGUMENT,\n name: parseName(lexer),\n value: (expect(lexer, TokenKind.COLON), parseConstValue(lexer)),\n loc: loc(lexer, start)\n };\n} // Implements the parsing rules in the Fragments section.\n\n/**\n * Corresponds to both FragmentSpread and InlineFragment in the spec.\n *\n * FragmentSpread : ... FragmentName Directives?\n *\n * InlineFragment : ... TypeCondition? Directives? SelectionSet\n */\n\n\nfunction parseFragment(lexer) {\n var start = lexer.token;\n expect(lexer, TokenKind.SPREAD);\n\n if (peek(lexer, TokenKind.NAME) && lexer.token.value !== 'on') {\n return {\n kind: Kind.FRAGMENT_SPREAD,\n name: parseFragmentName(lexer),\n directives: parseDirectives(lexer, false),\n loc: loc(lexer, start)\n };\n }\n\n var typeCondition;\n\n if (lexer.token.value === 'on') {\n lexer.advance();\n typeCondition = parseNamedType(lexer);\n }\n\n return {\n kind: Kind.INLINE_FRAGMENT,\n typeCondition: typeCondition,\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n}\n/**\n * FragmentDefinition :\n * - fragment FragmentName on TypeCondition Directives? SelectionSet\n *\n * TypeCondition : NamedType\n */\n\n\nfunction parseFragmentDefinition(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'fragment'); // Experimental support for defining variables within fragments changes\n // the grammar of FragmentDefinition:\n // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet\n\n if (lexer.options.experimentalFragmentVariables) {\n return {\n kind: Kind.FRAGMENT_DEFINITION,\n name: parseFragmentName(lexer),\n variableDefinitions: parseVariableDefinitions(lexer),\n typeCondition: (expectKeyword(lexer, 'on'), parseNamedType(lexer)),\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n }\n\n return {\n kind: Kind.FRAGMENT_DEFINITION,\n name: parseFragmentName(lexer),\n typeCondition: (expectKeyword(lexer, 'on'), parseNamedType(lexer)),\n directives: parseDirectives(lexer, false),\n selectionSet: parseSelectionSet(lexer),\n loc: loc(lexer, start)\n };\n}\n/**\n * FragmentName : Name but not `on`\n */\n\n\nfunction parseFragmentName(lexer) {\n if (lexer.token.value === 'on') {\n throw unexpected(lexer);\n }\n\n return parseName(lexer);\n} // Implements the parsing rules in the Values section.\n\n/**\n * Value[Const] :\n * - [~Const] Variable\n * - IntValue\n * - FloatValue\n * - StringValue\n * - BooleanValue\n * - NullValue\n * - EnumValue\n * - ListValue[?Const]\n * - ObjectValue[?Const]\n *\n * BooleanValue : one of `true` `false`\n *\n * NullValue : `null`\n *\n * EnumValue : Name but not `true`, `false` or `null`\n */\n\n\nfunction parseValueLiteral(lexer, isConst) {\n var token = lexer.token;\n\n switch (token.kind) {\n case TokenKind.BRACKET_L:\n return parseList(lexer, isConst);\n\n case TokenKind.BRACE_L:\n return parseObject(lexer, isConst);\n\n case TokenKind.INT:\n lexer.advance();\n return {\n kind: Kind.INT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case TokenKind.FLOAT:\n lexer.advance();\n return {\n kind: Kind.FLOAT,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n return parseStringLiteral(lexer);\n\n case TokenKind.NAME:\n if (token.value === 'true' || token.value === 'false') {\n lexer.advance();\n return {\n kind: Kind.BOOLEAN,\n value: token.value === 'true',\n loc: loc(lexer, token)\n };\n } else if (token.value === 'null') {\n lexer.advance();\n return {\n kind: Kind.NULL,\n loc: loc(lexer, token)\n };\n }\n\n lexer.advance();\n return {\n kind: Kind.ENUM,\n value: token.value,\n loc: loc(lexer, token)\n };\n\n case TokenKind.DOLLAR:\n if (!isConst) {\n return parseVariable(lexer);\n }\n\n break;\n }\n\n throw unexpected(lexer);\n}\n\nfunction parseStringLiteral(lexer) {\n var token = lexer.token;\n lexer.advance();\n return {\n kind: Kind.STRING,\n value: token.value,\n block: token.kind === TokenKind.BLOCK_STRING,\n loc: loc(lexer, token)\n };\n}\n\nexport function parseConstValue(lexer) {\n return parseValueLiteral(lexer, true);\n}\n\nfunction parseValueValue(lexer) {\n return parseValueLiteral(lexer, false);\n}\n/**\n * ListValue[Const] :\n * - [ ]\n * - [ Value[?Const]+ ]\n */\n\n\nfunction parseList(lexer, isConst) {\n var start = lexer.token;\n var item = isConst ? parseConstValue : parseValueValue;\n return {\n kind: Kind.LIST,\n values: any(lexer, TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),\n loc: loc(lexer, start)\n };\n}\n/**\n * ObjectValue[Const] :\n * - { }\n * - { ObjectField[?Const]+ }\n */\n\n\nfunction parseObject(lexer, isConst) {\n var start = lexer.token;\n expect(lexer, TokenKind.BRACE_L);\n var fields = [];\n\n while (!skip(lexer, TokenKind.BRACE_R)) {\n fields.push(parseObjectField(lexer, isConst));\n }\n\n return {\n kind: Kind.OBJECT,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n/**\n * ObjectField[Const] : Name : Value[?Const]\n */\n\n\nfunction parseObjectField(lexer, isConst) {\n var start = lexer.token;\n return {\n kind: Kind.OBJECT_FIELD,\n name: parseName(lexer),\n value: (expect(lexer, TokenKind.COLON), parseValueLiteral(lexer, isConst)),\n loc: loc(lexer, start)\n };\n} // Implements the parsing rules in the Directives section.\n\n/**\n * Directives[Const] : Directive[?Const]+\n */\n\n\nfunction parseDirectives(lexer, isConst) {\n var directives = [];\n\n while (peek(lexer, TokenKind.AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n\n return directives;\n}\n/**\n * Directive[Const] : @ Name Arguments[?Const]?\n */\n\n\nfunction parseDirective(lexer, isConst) {\n var start = lexer.token;\n expect(lexer, TokenKind.AT);\n return {\n kind: Kind.DIRECTIVE,\n name: parseName(lexer),\n arguments: parseArguments(lexer, isConst),\n loc: loc(lexer, start)\n };\n} // Implements the parsing rules in the Types section.\n\n/**\n * Type :\n * - NamedType\n * - ListType\n * - NonNullType\n */\n\n\nexport function parseTypeReference(lexer) {\n var start = lexer.token;\n var type;\n\n if (skip(lexer, TokenKind.BRACKET_L)) {\n type = parseTypeReference(lexer);\n expect(lexer, TokenKind.BRACKET_R);\n type = {\n kind: Kind.LIST_TYPE,\n type: type,\n loc: loc(lexer, start)\n };\n } else {\n type = parseNamedType(lexer);\n }\n\n if (skip(lexer, TokenKind.BANG)) {\n return {\n kind: Kind.NON_NULL_TYPE,\n type: type,\n loc: loc(lexer, start)\n };\n }\n\n return type;\n}\n/**\n * NamedType : Name\n */\n\nexport function parseNamedType(lexer) {\n var start = lexer.token;\n return {\n kind: Kind.NAMED_TYPE,\n name: parseName(lexer),\n loc: loc(lexer, start)\n };\n} // Implements the parsing rules in the Type Definition section.\n\n/**\n * TypeSystemDefinition :\n * - SchemaDefinition\n * - TypeDefinition\n * - DirectiveDefinition\n *\n * TypeDefinition :\n * - ScalarTypeDefinition\n * - ObjectTypeDefinition\n * - InterfaceTypeDefinition\n * - UnionTypeDefinition\n * - EnumTypeDefinition\n * - InputObjectTypeDefinition\n */\n\nfunction parseTypeSystemDefinition(lexer) {\n // Many definitions begin with a description and require a lookahead.\n var keywordToken = peekDescription(lexer) ? lexer.lookahead() : lexer.token;\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return parseSchemaDefinition(lexer);\n\n case 'scalar':\n return parseScalarTypeDefinition(lexer);\n\n case 'type':\n return parseObjectTypeDefinition(lexer);\n\n case 'interface':\n return parseInterfaceTypeDefinition(lexer);\n\n case 'union':\n return parseUnionTypeDefinition(lexer);\n\n case 'enum':\n return parseEnumTypeDefinition(lexer);\n\n case 'input':\n return parseInputObjectTypeDefinition(lexer);\n\n case 'directive':\n return parseDirectiveDefinition(lexer);\n }\n }\n\n throw unexpected(lexer, keywordToken);\n}\n\nfunction peekDescription(lexer) {\n return peek(lexer, TokenKind.STRING) || peek(lexer, TokenKind.BLOCK_STRING);\n}\n/**\n * Description : StringValue\n */\n\n\nfunction parseDescription(lexer) {\n if (peekDescription(lexer)) {\n return parseStringLiteral(lexer);\n }\n}\n/**\n * SchemaDefinition : schema Directives[Const]? { OperationTypeDefinition+ }\n */\n\n\nfunction parseSchemaDefinition(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'schema');\n var directives = parseDirectives(lexer, true);\n var operationTypes = many(lexer, TokenKind.BRACE_L, parseOperationTypeDefinition, TokenKind.BRACE_R);\n return {\n kind: Kind.SCHEMA_DEFINITION,\n directives: directives,\n operationTypes: operationTypes,\n loc: loc(lexer, start)\n };\n}\n/**\n * OperationTypeDefinition : OperationType : NamedType\n */\n\n\nfunction parseOperationTypeDefinition(lexer) {\n var start = lexer.token;\n var operation = parseOperationType(lexer);\n expect(lexer, TokenKind.COLON);\n var type = parseNamedType(lexer);\n return {\n kind: Kind.OPERATION_TYPE_DEFINITION,\n operation: operation,\n type: type,\n loc: loc(lexer, start)\n };\n}\n/**\n * ScalarTypeDefinition : Description? scalar Name Directives[Const]?\n */\n\n\nfunction parseScalarTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'scalar');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n return {\n kind: Kind.SCALAR_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n/**\n * ObjectTypeDefinition :\n * Description?\n * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?\n */\n\n\nfunction parseObjectTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n return {\n kind: Kind.OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n/**\n * ImplementsInterfaces :\n * - implements `&`? NamedType\n * - ImplementsInterfaces & NamedType\n */\n\n\nfunction parseImplementsInterfaces(lexer) {\n var types = [];\n\n if (lexer.token.value === 'implements') {\n lexer.advance(); // Optional leading ampersand\n\n skip(lexer, TokenKind.AMP);\n\n do {\n types.push(parseNamedType(lexer));\n } while (skip(lexer, TokenKind.AMP) || // Legacy support for the SDL?\n lexer.options.allowLegacySDLImplementsInterfaces && peek(lexer, TokenKind.NAME));\n }\n\n return types;\n}\n/**\n * FieldsDefinition : { FieldDefinition+ }\n */\n\n\nfunction parseFieldsDefinition(lexer) {\n // Legacy support for the SDL?\n if (lexer.options.allowLegacySDLEmptyFields && peek(lexer, TokenKind.BRACE_L) && lexer.lookahead().kind === TokenKind.BRACE_R) {\n lexer.advance();\n lexer.advance();\n return [];\n }\n\n return peek(lexer, TokenKind.BRACE_L) ? many(lexer, TokenKind.BRACE_L, parseFieldDefinition, TokenKind.BRACE_R) : [];\n}\n/**\n * FieldDefinition :\n * - Description? Name ArgumentsDefinition? : Type Directives[Const]?\n */\n\n\nfunction parseFieldDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n var name = parseName(lexer);\n var args = parseArgumentDefs(lexer);\n expect(lexer, TokenKind.COLON);\n var type = parseTypeReference(lexer);\n var directives = parseDirectives(lexer, true);\n return {\n kind: Kind.FIELD_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n type: type,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n/**\n * ArgumentsDefinition : ( InputValueDefinition+ )\n */\n\n\nfunction parseArgumentDefs(lexer) {\n if (!peek(lexer, TokenKind.PAREN_L)) {\n return [];\n }\n\n return many(lexer, TokenKind.PAREN_L, parseInputValueDef, TokenKind.PAREN_R);\n}\n/**\n * InputValueDefinition :\n * - Description? Name : Type DefaultValue? Directives[Const]?\n */\n\n\nfunction parseInputValueDef(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n var name = parseName(lexer);\n expect(lexer, TokenKind.COLON);\n var type = parseTypeReference(lexer);\n var defaultValue;\n\n if (skip(lexer, TokenKind.EQUALS)) {\n defaultValue = parseConstValue(lexer);\n }\n\n var directives = parseDirectives(lexer, true);\n return {\n kind: Kind.INPUT_VALUE_DEFINITION,\n description: description,\n name: name,\n type: type,\n defaultValue: defaultValue,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n/**\n * InterfaceTypeDefinition :\n * - Description? interface Name Directives[Const]? FieldsDefinition?\n */\n\n\nfunction parseInterfaceTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'interface');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n return {\n kind: Kind.INTERFACE_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n/**\n * UnionTypeDefinition :\n * - Description? union Name Directives[Const]? UnionMemberTypes?\n */\n\n\nfunction parseUnionTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n return {\n kind: Kind.UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}\n/**\n * UnionMemberTypes :\n * - = `|`? NamedType\n * - UnionMemberTypes | NamedType\n */\n\n\nfunction parseUnionMemberTypes(lexer) {\n var types = [];\n\n if (skip(lexer, TokenKind.EQUALS)) {\n // Optional leading pipe\n skip(lexer, TokenKind.PIPE);\n\n do {\n types.push(parseNamedType(lexer));\n } while (skip(lexer, TokenKind.PIPE));\n }\n\n return types;\n}\n/**\n * EnumTypeDefinition :\n * - Description? enum Name Directives[Const]? EnumValuesDefinition?\n */\n\n\nfunction parseEnumTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n return {\n kind: Kind.ENUM_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}\n/**\n * EnumValuesDefinition : { EnumValueDefinition+ }\n */\n\n\nfunction parseEnumValuesDefinition(lexer) {\n return peek(lexer, TokenKind.BRACE_L) ? many(lexer, TokenKind.BRACE_L, parseEnumValueDefinition, TokenKind.BRACE_R) : [];\n}\n/**\n * EnumValueDefinition : Description? EnumValue Directives[Const]?\n *\n * EnumValue : Name\n */\n\n\nfunction parseEnumValueDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n return {\n kind: Kind.ENUM_VALUE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n/**\n * InputObjectTypeDefinition :\n * - Description? input Name Directives[Const]? InputFieldsDefinition?\n */\n\n\nfunction parseInputObjectTypeDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'input');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseInputFieldsDefinition(lexer);\n return {\n kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n/**\n * InputFieldsDefinition : { InputValueDefinition+ }\n */\n\n\nfunction parseInputFieldsDefinition(lexer) {\n return peek(lexer, TokenKind.BRACE_L) ? many(lexer, TokenKind.BRACE_L, parseInputValueDef, TokenKind.BRACE_R) : [];\n}\n/**\n * TypeSystemExtension :\n * - SchemaExtension\n * - TypeExtension\n *\n * TypeExtension :\n * - ScalarTypeExtension\n * - ObjectTypeExtension\n * - InterfaceTypeExtension\n * - UnionTypeExtension\n * - EnumTypeExtension\n * - InputObjectTypeDefinition\n */\n\n\nfunction parseTypeSystemExtension(lexer) {\n var keywordToken = lexer.lookahead();\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return parseSchemaExtension(lexer);\n\n case 'scalar':\n return parseScalarTypeExtension(lexer);\n\n case 'type':\n return parseObjectTypeExtension(lexer);\n\n case 'interface':\n return parseInterfaceTypeExtension(lexer);\n\n case 'union':\n return parseUnionTypeExtension(lexer);\n\n case 'enum':\n return parseEnumTypeExtension(lexer);\n\n case 'input':\n return parseInputObjectTypeExtension(lexer);\n }\n }\n\n throw unexpected(lexer, keywordToken);\n}\n/**\n * SchemaExtension :\n * - extend schema Directives[Const]? { OperationTypeDefinition+ }\n * - extend schema Directives[Const]\n */\n\n\nfunction parseSchemaExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'schema');\n var directives = parseDirectives(lexer, true);\n var operationTypes = peek(lexer, TokenKind.BRACE_L) ? many(lexer, TokenKind.BRACE_L, parseOperationTypeDefinition, TokenKind.BRACE_R) : [];\n\n if (directives.length === 0 && operationTypes.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: Kind.SCHEMA_EXTENSION,\n directives: directives,\n operationTypes: operationTypes,\n loc: loc(lexer, start)\n };\n}\n/**\n * ScalarTypeExtension :\n * - extend scalar Name Directives[Const]\n */\n\n\nfunction parseScalarTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'scalar');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n\n if (directives.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: Kind.SCALAR_TYPE_EXTENSION,\n name: name,\n directives: directives,\n loc: loc(lexer, start)\n };\n}\n/**\n * ObjectTypeExtension :\n * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend type Name ImplementsInterfaces? Directives[Const]\n * - extend type Name ImplementsInterfaces\n */\n\n\nfunction parseObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'type');\n var name = parseName(lexer);\n var interfaces = parseImplementsInterfaces(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: Kind.OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n/**\n * InterfaceTypeExtension :\n * - extend interface Name Directives[Const]? FieldsDefinition\n * - extend interface Name Directives[Const]\n */\n\n\nfunction parseInterfaceTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'interface');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n\n if (directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: Kind.INTERFACE_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n/**\n * UnionTypeExtension :\n * - extend union Name Directives[Const]? UnionMemberTypes\n * - extend union Name Directives[Const]\n */\n\n\nfunction parseUnionTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'union');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var types = parseUnionMemberTypes(lexer);\n\n if (directives.length === 0 && types.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: Kind.UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: loc(lexer, start)\n };\n}\n/**\n * EnumTypeExtension :\n * - extend enum Name Directives[Const]? EnumValuesDefinition\n * - extend enum Name Directives[Const]\n */\n\n\nfunction parseEnumTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'enum');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var values = parseEnumValuesDefinition(lexer);\n\n if (directives.length === 0 && values.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: Kind.ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: loc(lexer, start)\n };\n}\n/**\n * InputObjectTypeExtension :\n * - extend input Name Directives[Const]? InputFieldsDefinition\n * - extend input Name Directives[Const]\n */\n\n\nfunction parseInputObjectTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'input');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseInputFieldsDefinition(lexer);\n\n if (directives.length === 0 && fields.length === 0) {\n throw unexpected(lexer);\n }\n\n return {\n kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: loc(lexer, start)\n };\n}\n/**\n * DirectiveDefinition :\n * - Description? directive @ Name ArgumentsDefinition? on DirectiveLocations\n */\n\n\nfunction parseDirectiveDefinition(lexer) {\n var start = lexer.token;\n var description = parseDescription(lexer);\n expectKeyword(lexer, 'directive');\n expect(lexer, TokenKind.AT);\n var name = parseName(lexer);\n var args = parseArgumentDefs(lexer);\n expectKeyword(lexer, 'on');\n var locations = parseDirectiveLocations(lexer);\n return {\n kind: Kind.DIRECTIVE_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n locations: locations,\n loc: loc(lexer, start)\n };\n}\n/**\n * DirectiveLocations :\n * - `|`? DirectiveLocation\n * - DirectiveLocations | DirectiveLocation\n */\n\n\nfunction parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, TokenKind.PIPE);\n var locations = [];\n\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, TokenKind.PIPE));\n\n return locations;\n}\n/*\n * DirectiveLocation :\n * - ExecutableDirectiveLocation\n * - TypeSystemDirectiveLocation\n *\n * ExecutableDirectiveLocation : one of\n * `QUERY`\n * `MUTATION`\n * `SUBSCRIPTION`\n * `FIELD`\n * `FRAGMENT_DEFINITION`\n * `FRAGMENT_SPREAD`\n * `INLINE_FRAGMENT`\n *\n * TypeSystemDirectiveLocation : one of\n * `SCHEMA`\n * `SCALAR`\n * `OBJECT`\n * `FIELD_DEFINITION`\n * `ARGUMENT_DEFINITION`\n * `INTERFACE`\n * `UNION`\n * `ENUM`\n * `ENUM_VALUE`\n * `INPUT_OBJECT`\n * `INPUT_FIELD_DEFINITION`\n */\n\n\nfunction parseDirectiveLocation(lexer) {\n var start = lexer.token;\n var name = parseName(lexer);\n\n if (DirectiveLocation.hasOwnProperty(name.value)) {\n return name;\n }\n\n throw unexpected(lexer, start);\n} // Core parsing utility functions\n\n/**\n * Returns a location object, used to identify the place in\n * the source that created a given parsed object.\n */\n\n\nfunction loc(lexer, startToken) {\n if (!lexer.options.noLocation) {\n return new Loc(startToken, lexer.lastToken, lexer.source);\n }\n}\n\nfunction Loc(startToken, endToken, source) {\n this.start = startToken.start;\n this.end = endToken.end;\n this.startToken = startToken;\n this.endToken = endToken;\n this.source = source;\n} // Print a simplified form when appearing in JSON/util.inspect.\n\n\nLoc.prototype.toJSON = Loc.prototype.inspect = function toJSON() {\n return {\n start: this.start,\n end: this.end\n };\n};\n/**\n * Determines if the next token is of a given kind\n */\n\n\nfunction peek(lexer, kind) {\n return lexer.token.kind === kind;\n}\n/**\n * If the next token is of the given kind, return true after advancing\n * the lexer. Otherwise, do not change the parser state and return false.\n */\n\n\nfunction skip(lexer, kind) {\n var match = lexer.token.kind === kind;\n\n if (match) {\n lexer.advance();\n }\n\n return match;\n}\n/**\n * If the next token is of the given kind, return that token after advancing\n * the lexer. Otherwise, do not change the parser state and throw an error.\n */\n\n\nfunction expect(lexer, kind) {\n var token = lexer.token;\n\n if (token.kind === kind) {\n lexer.advance();\n return token;\n }\n\n throw syntaxError(lexer.source, token.start, \"Expected \".concat(kind, \", found \").concat(getTokenDesc(token)));\n}\n/**\n * If the next token is a keyword with the given value, return that token after\n * advancing the lexer. Otherwise, do not change the parser state and return\n * false.\n */\n\n\nfunction expectKeyword(lexer, value) {\n var token = lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n lexer.advance();\n return token;\n }\n\n throw syntaxError(lexer.source, token.start, \"Expected \\\"\".concat(value, \"\\\", found \").concat(getTokenDesc(token)));\n}\n/**\n * Helper function for creating an error when an unexpected lexed token\n * is encountered.\n */\n\n\nfunction unexpected(lexer, atToken) {\n var token = atToken || lexer.token;\n return syntaxError(lexer.source, token.start, \"Unexpected \".concat(getTokenDesc(token)));\n}\n/**\n * Returns a possibly empty list of parse nodes, determined by\n * the parseFn. This list begins with a lex token of openKind\n * and ends with a lex token of closeKind. Advances the parser\n * to the next lex token after the closing token.\n */\n\n\nfunction any(lexer, openKind, parseFn, closeKind) {\n expect(lexer, openKind);\n var nodes = [];\n\n while (!skip(lexer, closeKind)) {\n nodes.push(parseFn(lexer));\n }\n\n return nodes;\n}\n/**\n * Returns a non-empty list of parse nodes, determined by\n * the parseFn. This list begins with a lex token of openKind\n * and ends with a lex token of closeKind. Advances the parser\n * to the next lex token after the closing token.\n */\n\n\nfunction many(lexer, openKind, parseFn, closeKind) {\n expect(lexer, openKind);\n var nodes = [parseFn(lexer)];\n\n while (!skip(lexer, closeKind)) {\n nodes.push(parseFn(lexer));\n }\n\n return nodes;\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { Kind } from '../language/kinds';\nimport { GraphQLList, GraphQLNonNull } from '../type/definition';\nexport function typeFromAST(schema, typeNode) {\n /* eslint-enable no-redeclare */\n var innerType;\n\n if (typeNode.kind === Kind.LIST_TYPE) {\n innerType = typeFromAST(schema, typeNode.type);\n return innerType && GraphQLList(innerType);\n }\n\n if (typeNode.kind === Kind.NON_NULL_TYPE) {\n innerType = typeFromAST(schema, typeNode.type);\n return innerType && GraphQLNonNull(innerType);\n }\n\n if (typeNode.kind === Kind.NAMED_TYPE) {\n return schema.getType(typeNode.name.value);\n }\n /* istanbul ignore next */\n\n\n throw new Error(\"Unexpected type kind: \".concat(typeNode.kind, \".\"));\n}","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { Kind } from '../language/kinds';\nimport { isObjectType, isInterfaceType, isEnumType, isInputObjectType, isListType, isCompositeType, isInputType, isOutputType, getNullableType, getNamedType } from '../type/definition';\nimport { SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef } from '../type/introspection';\nimport { typeFromAST } from './typeFromAST';\nimport find from '../jsutils/find';\n/**\n * TypeInfo is a utility class which, given a GraphQL schema, can keep track\n * of the current field and type definitions at any point in a GraphQL document\n * AST during a recursive descent by calling `enter(node)` and `leave(node)`.\n */\n\nexport var TypeInfo =\n/*#__PURE__*/\nfunction () {\n function TypeInfo(schema, // NOTE: this experimental optional second parameter is only needed in order\n // to support non-spec-compliant codebases. You should never need to use it.\n getFieldDefFn, // Initial type may be provided in rare cases to facilitate traversals\n initialType) {\n _defineProperty(this, \"_schema\", void 0);\n\n _defineProperty(this, \"_typeStack\", void 0);\n\n _defineProperty(this, \"_parentTypeStack\", void 0);\n\n _defineProperty(this, \"_inputTypeStack\", void 0);\n\n _defineProperty(this, \"_fieldDefStack\", void 0);\n\n _defineProperty(this, \"_defaultValueStack\", void 0);\n\n _defineProperty(this, \"_directive\", void 0);\n\n _defineProperty(this, \"_argument\", void 0);\n\n _defineProperty(this, \"_enumValue\", void 0);\n\n _defineProperty(this, \"_getFieldDef\", void 0);\n\n this._schema = schema;\n this._typeStack = [];\n this._parentTypeStack = [];\n this._inputTypeStack = [];\n this._fieldDefStack = [];\n this._defaultValueStack = [];\n this._directive = null;\n this._argument = null;\n this._enumValue = null;\n this._getFieldDef = getFieldDefFn || getFieldDef;\n\n if (initialType) {\n if (isInputType(initialType)) {\n this._inputTypeStack.push(initialType);\n }\n\n if (isCompositeType(initialType)) {\n this._parentTypeStack.push(initialType);\n }\n\n if (isOutputType(initialType)) {\n this._typeStack.push(initialType);\n }\n }\n }\n\n var _proto = TypeInfo.prototype;\n\n _proto.getType = function getType() {\n if (this._typeStack.length > 0) {\n return this._typeStack[this._typeStack.length - 1];\n }\n };\n\n _proto.getParentType = function getParentType() {\n if (this._parentTypeStack.length > 0) {\n return this._parentTypeStack[this._parentTypeStack.length - 1];\n }\n };\n\n _proto.getInputType = function getInputType() {\n if (this._inputTypeStack.length > 0) {\n return this._inputTypeStack[this._inputTypeStack.length - 1];\n }\n };\n\n _proto.getParentInputType = function getParentInputType() {\n if (this._inputTypeStack.length > 1) {\n return this._inputTypeStack[this._inputTypeStack.length - 2];\n }\n };\n\n _proto.getFieldDef = function getFieldDef() {\n if (this._fieldDefStack.length > 0) {\n return this._fieldDefStack[this._fieldDefStack.length - 1];\n }\n };\n\n _proto.getDefaultValue = function getDefaultValue() {\n if (this._defaultValueStack.length > 0) {\n return this._defaultValueStack[this._defaultValueStack.length - 1];\n }\n };\n\n _proto.getDirective = function getDirective() {\n return this._directive;\n };\n\n _proto.getArgument = function getArgument() {\n return this._argument;\n };\n\n _proto.getEnumValue = function getEnumValue() {\n return this._enumValue;\n };\n\n _proto.enter = function enter(node) {\n var schema = this._schema; // Note: many of the types below are explicitly typed as \"mixed\" to drop\n // any assumptions of a valid schema to ensure runtime types are properly\n // checked before continuing since TypeInfo is used as part of validation\n // which occurs before guarantees of schema and document validity.\n\n switch (node.kind) {\n case Kind.SELECTION_SET:\n var namedType = getNamedType(this.getType());\n\n this._parentTypeStack.push(isCompositeType(namedType) ? namedType : undefined);\n\n break;\n\n case Kind.FIELD:\n var parentType = this.getParentType();\n var fieldDef;\n var fieldType;\n\n if (parentType) {\n fieldDef = this._getFieldDef(schema, parentType, node);\n\n if (fieldDef) {\n fieldType = fieldDef.type;\n }\n }\n\n this._fieldDefStack.push(fieldDef);\n\n this._typeStack.push(isOutputType(fieldType) ? fieldType : undefined);\n\n break;\n\n case Kind.DIRECTIVE:\n this._directive = schema.getDirective(node.name.value);\n break;\n\n case Kind.OPERATION_DEFINITION:\n var type;\n\n if (node.operation === 'query') {\n type = schema.getQueryType();\n } else if (node.operation === 'mutation') {\n type = schema.getMutationType();\n } else if (node.operation === 'subscription') {\n type = schema.getSubscriptionType();\n }\n\n this._typeStack.push(isObjectType(type) ? type : undefined);\n\n break;\n\n case Kind.INLINE_FRAGMENT:\n case Kind.FRAGMENT_DEFINITION:\n var typeConditionAST = node.typeCondition;\n var outputType = typeConditionAST ? typeFromAST(schema, typeConditionAST) : getNamedType(this.getType());\n\n this._typeStack.push(isOutputType(outputType) ? outputType : undefined);\n\n break;\n\n case Kind.VARIABLE_DEFINITION:\n var inputType = typeFromAST(schema, node.type);\n\n this._inputTypeStack.push(isInputType(inputType) ? inputType : undefined);\n\n break;\n\n case Kind.ARGUMENT:\n var argDef;\n var argType;\n var fieldOrDirective = this.getDirective() || this.getFieldDef();\n\n if (fieldOrDirective) {\n argDef = find(fieldOrDirective.args, function (arg) {\n return arg.name === node.name.value;\n });\n\n if (argDef) {\n argType = argDef.type;\n }\n }\n\n this._argument = argDef;\n\n this._defaultValueStack.push(argDef ? argDef.defaultValue : undefined);\n\n this._inputTypeStack.push(isInputType(argType) ? argType : undefined);\n\n break;\n\n case Kind.LIST:\n var listType = getNullableType(this.getInputType());\n var itemType = isListType(listType) ? listType.ofType : listType; // List positions never have a default value.\n\n this._defaultValueStack.push(undefined);\n\n this._inputTypeStack.push(isInputType(itemType) ? itemType : undefined);\n\n break;\n\n case Kind.OBJECT_FIELD:\n var objectType = getNamedType(this.getInputType());\n var inputFieldType;\n var inputField;\n\n if (isInputObjectType(objectType)) {\n inputField = objectType.getFields()[node.name.value];\n\n if (inputField) {\n inputFieldType = inputField.type;\n }\n }\n\n this._defaultValueStack.push(inputField ? inputField.defaultValue : undefined);\n\n this._inputTypeStack.push(isInputType(inputFieldType) ? inputFieldType : undefined);\n\n break;\n\n case Kind.ENUM:\n var enumType = getNamedType(this.getInputType());\n var enumValue;\n\n if (isEnumType(enumType)) {\n enumValue = enumType.getValue(node.value);\n }\n\n this._enumValue = enumValue;\n break;\n }\n };\n\n _proto.leave = function leave(node) {\n switch (node.kind) {\n case Kind.SELECTION_SET:\n this._parentTypeStack.pop();\n\n break;\n\n case Kind.FIELD:\n this._fieldDefStack.pop();\n\n this._typeStack.pop();\n\n break;\n\n case Kind.DIRECTIVE:\n this._directive = null;\n break;\n\n case Kind.OPERATION_DEFINITION:\n case Kind.INLINE_FRAGMENT:\n case Kind.FRAGMENT_DEFINITION:\n this._typeStack.pop();\n\n break;\n\n case Kind.VARIABLE_DEFINITION:\n this._inputTypeStack.pop();\n\n break;\n\n case Kind.ARGUMENT:\n this._argument = null;\n\n this._defaultValueStack.pop();\n\n this._inputTypeStack.pop();\n\n break;\n\n case Kind.LIST:\n case Kind.OBJECT_FIELD:\n this._defaultValueStack.pop();\n\n this._inputTypeStack.pop();\n\n break;\n\n case Kind.ENUM:\n this._enumValue = null;\n break;\n }\n };\n\n return TypeInfo;\n}();\n/**\n * Not exactly the same as the executor's definition of getFieldDef, in this\n * statically evaluated environment we do not always have an Object type,\n * and need to handle Interface and Union types.\n */\n\nfunction getFieldDef(schema, parentType, fieldNode) {\n var name = fieldNode.name.value;\n\n if (name === SchemaMetaFieldDef.name && schema.getQueryType() === parentType) {\n return SchemaMetaFieldDef;\n }\n\n if (name === TypeMetaFieldDef.name && schema.getQueryType() === parentType) {\n return TypeMetaFieldDef;\n }\n\n if (name === TypeNameMetaFieldDef.name && isCompositeType(parentType)) {\n return TypeNameMetaFieldDef;\n }\n\n if (isObjectType(parentType) || isInterfaceType(parentType)) {\n return parentType.getFields()[name];\n }\n}","/**\n * Copyright (c) 2018-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { Kind } from './kinds';\nexport function isDefinitionNode(node) {\n return isExecutableDefinitionNode(node) || isTypeSystemDefinitionNode(node) || isTypeSystemExtensionNode(node);\n}\nexport function isExecutableDefinitionNode(node) {\n return node.kind === Kind.OPERATION_DEFINITION || node.kind === Kind.FRAGMENT_DEFINITION;\n}\nexport function isSelectionNode(node) {\n return node.kind === Kind.FIELD || node.kind === Kind.FRAGMENT_SPREAD || node.kind === Kind.INLINE_FRAGMENT;\n}\nexport function isValueNode(node) {\n return node.kind === Kind.VARIABLE || node.kind === Kind.INT || node.kind === Kind.FLOAT || node.kind === Kind.STRING || node.kind === Kind.BOOLEAN || node.kind === Kind.NULL || node.kind === Kind.ENUM || node.kind === Kind.LIST || node.kind === Kind.OBJECT;\n}\nexport function isTypeNode(node) {\n return node.kind === Kind.NAMED_TYPE || node.kind === Kind.LIST_TYPE || node.kind === Kind.NON_NULL_TYPE;\n}\nexport function isTypeSystemDefinitionNode(node) {\n return node.kind === Kind.SCHEMA_DEFINITION || isTypeDefinitionNode(node) || node.kind === Kind.DIRECTIVE_DEFINITION;\n}\nexport function isTypeDefinitionNode(node) {\n return node.kind === Kind.SCALAR_TYPE_DEFINITION || node.kind === Kind.OBJECT_TYPE_DEFINITION || node.kind === Kind.INTERFACE_TYPE_DEFINITION || node.kind === Kind.UNION_TYPE_DEFINITION || node.kind === Kind.ENUM_TYPE_DEFINITION || node.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION;\n}\nexport function isTypeSystemExtensionNode(node) {\n return node.kind === Kind.SCHEMA_EXTENSION || isTypeExtensionNode(node);\n}\nexport function isTypeExtensionNode(node) {\n return node.kind === Kind.SCALAR_TYPE_EXTENSION || node.kind === Kind.OBJECT_TYPE_EXTENSION || node.kind === Kind.INTERFACE_TYPE_EXTENSION || node.kind === Kind.UNION_TYPE_EXTENSION || node.kind === Kind.ENUM_TYPE_EXTENSION || node.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION;\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nimport { Kind } from '../../language/kinds';\nimport { isExecutableDefinitionNode } from '../../language/predicates';\nexport function nonExecutableDefinitionMessage(defName) {\n return \"The \".concat(defName, \" definition is not executable.\");\n}\n/**\n * Executable definitions\n *\n * A GraphQL document is only valid for execution if all definitions are either\n * operation or fragment definitions.\n */\n\nexport function ExecutableDefinitions(context) {\n return {\n Document: function Document(node) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = node.definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var definition = _step.value;\n\n if (!isExecutableDefinitionNode(definition)) {\n context.reportError(new GraphQLError(nonExecutableDefinitionMessage(definition.kind === Kind.SCHEMA_DEFINITION || definition.kind === Kind.SCHEMA_EXTENSION ? 'schema' : definition.name.value), [definition]));\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return false;\n }\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nexport function duplicateOperationNameMessage(operationName) {\n return \"There can be only one operation named \\\"\".concat(operationName, \"\\\".\");\n}\n/**\n * Unique operation names\n *\n * A GraphQL document is only valid if all defined operations have unique names.\n */\n\nexport function UniqueOperationNames(context) {\n var knownOperationNames = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition(node) {\n var operationName = node.name;\n\n if (operationName) {\n if (knownOperationNames[operationName.value]) {\n context.reportError(new GraphQLError(duplicateOperationNameMessage(operationName.value), [knownOperationNames[operationName.value], operationName]));\n } else {\n knownOperationNames[operationName.value] = operationName;\n }\n }\n\n return false;\n },\n FragmentDefinition: function FragmentDefinition() {\n return false;\n }\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nimport { Kind } from '../../language/kinds';\nexport function anonOperationNotAloneMessage() {\n return 'This anonymous operation must be the only defined operation.';\n}\n/**\n * Lone anonymous operation\n *\n * A GraphQL document is only valid if when it contains an anonymous operation\n * (the query short-hand) that it contains only that one operation definition.\n */\n\nexport function LoneAnonymousOperation(context) {\n var operationCount = 0;\n return {\n Document: function Document(node) {\n operationCount = node.definitions.filter(function (definition) {\n return definition.kind === Kind.OPERATION_DEFINITION;\n }).length;\n },\n OperationDefinition: function OperationDefinition(node) {\n if (!node.name && operationCount > 1) {\n context.reportError(new GraphQLError(anonOperationNotAloneMessage(), [node]));\n }\n }\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nexport function singleFieldOnlyMessage(name) {\n return (name ? \"Subscription \\\"\".concat(name, \"\\\" \") : 'Anonymous Subscription ') + 'must select only one top level field.';\n}\n/**\n * Subscriptions must only include one field.\n *\n * A GraphQL subscription is valid only if it contains a single root field.\n */\n\nexport function SingleFieldSubscriptions(context) {\n return {\n OperationDefinition: function OperationDefinition(node) {\n if (node.operation === 'subscription') {\n if (node.selectionSet.selections.length !== 1) {\n context.reportError(new GraphQLError(singleFieldOnlyMessage(node.name && node.name.value), node.selectionSet.selections.slice(1)));\n }\n }\n }\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/**\n * Given an invalid input string and a list of valid options, returns a filtered\n * list of valid options sorted based on their similarity with the input.\n */\nexport default function suggestionList(input, options) {\n var optionsByDistance = Object.create(null);\n var oLength = options.length;\n var inputThreshold = input.length / 2;\n\n for (var i = 0; i < oLength; i++) {\n var distance = lexicalDistance(input, options[i]);\n var threshold = Math.max(inputThreshold, options[i].length / 2, 1);\n\n if (distance <= threshold) {\n optionsByDistance[options[i]] = distance;\n }\n }\n\n return Object.keys(optionsByDistance).sort(function (a, b) {\n return optionsByDistance[a] - optionsByDistance[b];\n });\n}\n/**\n * Computes the lexical distance between strings A and B.\n *\n * The \"distance\" between two strings is given by counting the minimum number\n * of edits needed to transform string A into string B. An edit can be an\n * insertion, deletion, or substitution of a single character, or a swap of two\n * adjacent characters.\n *\n * Includes a custom alteration from Damerau-Levenshtein to treat case changes\n * as a single edit which helps identify mis-cased values with an edit distance\n * of 1.\n *\n * This distance can be useful for detecting typos in input or sorting\n *\n * @param {string} a\n * @param {string} b\n * @return {int} distance in number of edits\n */\n\nfunction lexicalDistance(aStr, bStr) {\n if (aStr === bStr) {\n return 0;\n }\n\n var i;\n var j;\n var d = [];\n var a = aStr.toLowerCase();\n var b = bStr.toLowerCase();\n var aLength = a.length;\n var bLength = b.length; // Any case change counts as a single edit\n\n if (a === b) {\n return 1;\n }\n\n for (i = 0; i <= aLength; i++) {\n d[i] = [i];\n }\n\n for (j = 1; j <= bLength; j++) {\n d[0][j] = j;\n }\n\n for (i = 1; i <= aLength; i++) {\n for (j = 1; j <= bLength; j++) {\n var cost = a[i - 1] === b[j - 1] ? 0 : 1;\n d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost);\n\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {\n d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + cost);\n }\n }\n }\n\n return d[aLength][bLength];\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nvar MAX_LENGTH = 5;\n/**\n * Given [ A, B, C ] return 'A, B, or C'.\n */\n\nexport default function orList(items) {\n var selected = items.slice(0, MAX_LENGTH);\n return selected.reduce(function (list, quoted, index) {\n return list + (selected.length > 2 ? ', ' : ' ') + (index === selected.length - 1 ? 'or ' : '') + quoted;\n });\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport orList from './orList';\n/**\n * Given [ A, B, C ] return '\"A\", \"B\", or \"C\"'.\n */\n\nexport default function quotedOrList(items) {\n return orList(items.map(function (item) {\n return \"\\\"\".concat(item, \"\\\"\");\n }));\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nimport suggestionList from '../../jsutils/suggestionList';\nimport quotedOrList from '../../jsutils/quotedOrList';\nexport function unknownTypeMessage(typeName, suggestedTypes) {\n var message = \"Unknown type \\\"\".concat(typeName, \"\\\".\");\n\n if (suggestedTypes.length) {\n message += \" Did you mean \".concat(quotedOrList(suggestedTypes), \"?\");\n }\n\n return message;\n}\n/**\n * Known type names\n *\n * A GraphQL document is only valid if referenced types (specifically\n * variable definitions and fragment conditions) are defined by the type schema.\n */\n\nexport function KnownTypeNames(context) {\n return {\n // TODO: when validating IDL, re-enable these. Experimental version does not\n // add unreferenced types, resulting in false-positive errors. Squelched\n // errors for now.\n ObjectTypeDefinition: function ObjectTypeDefinition() {\n return false;\n },\n InterfaceTypeDefinition: function InterfaceTypeDefinition() {\n return false;\n },\n UnionTypeDefinition: function UnionTypeDefinition() {\n return false;\n },\n InputObjectTypeDefinition: function InputObjectTypeDefinition() {\n return false;\n },\n NamedType: function NamedType(node) {\n var schema = context.getSchema();\n var typeName = node.name.value;\n var type = schema.getType(typeName);\n\n if (!type) {\n context.reportError(new GraphQLError(unknownTypeMessage(typeName, suggestionList(typeName, Object.keys(schema.getTypeMap()))), [node]));\n }\n }\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nimport { print } from '../../language/printer';\nimport { isCompositeType } from '../../type/definition';\nimport { typeFromAST } from '../../utilities/typeFromAST';\nexport function inlineFragmentOnNonCompositeErrorMessage(type) {\n return \"Fragment cannot condition on non composite type \\\"\".concat(type, \"\\\".\");\n}\nexport function fragmentOnNonCompositeErrorMessage(fragName, type) {\n return \"Fragment \\\"\".concat(fragName, \"\\\" cannot condition on non composite \") + \"type \\\"\".concat(type, \"\\\".\");\n}\n/**\n * Fragments on composite type\n *\n * Fragments use a type condition to determine if they apply, since fragments\n * can only be spread into a composite type (object, interface, or union), the\n * type condition must also be a composite type.\n */\n\nexport function FragmentsOnCompositeTypes(context) {\n return {\n InlineFragment: function InlineFragment(node) {\n var typeCondition = node.typeCondition;\n\n if (typeCondition) {\n var type = typeFromAST(context.getSchema(), typeCondition);\n\n if (type && !isCompositeType(type)) {\n context.reportError(new GraphQLError(inlineFragmentOnNonCompositeErrorMessage(print(typeCondition)), [typeCondition]));\n }\n }\n },\n FragmentDefinition: function FragmentDefinition(node) {\n var type = typeFromAST(context.getSchema(), node.typeCondition);\n\n if (type && !isCompositeType(type)) {\n context.reportError(new GraphQLError(fragmentOnNonCompositeErrorMessage(node.name.value, print(node.typeCondition)), [node.typeCondition]));\n }\n }\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nimport { print } from '../../language/printer';\nimport { isInputType } from '../../type/definition';\nimport { typeFromAST } from '../../utilities/typeFromAST';\nexport function nonInputTypeOnVarMessage(variableName, typeName) {\n return \"Variable \\\"$\".concat(variableName, \"\\\" cannot be non-input type \\\"\").concat(typeName, \"\\\".\");\n}\n/**\n * Variables are input types\n *\n * A GraphQL operation is only valid if all the variables it defines are of\n * input types (scalar, enum, or input object).\n */\n\nexport function VariablesAreInputTypes(context) {\n return {\n VariableDefinition: function VariableDefinition(node) {\n var type = typeFromAST(context.getSchema(), node.type); // If the variable type is not an input type, return an error.\n\n if (type && !isInputType(type)) {\n var variableName = node.variable.name.value;\n context.reportError(new GraphQLError(nonInputTypeOnVarMessage(variableName, print(node.type)), [node.type]));\n }\n }\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport inspect from '../../jsutils/inspect';\nimport { GraphQLError } from '../../error/GraphQLError';\nimport { getNamedType, isLeafType } from '../../type/definition';\nexport function noSubselectionAllowedMessage(fieldName, type) {\n return \"Field \\\"\".concat(fieldName, \"\\\" must not have a selection since \") + \"type \\\"\".concat(type, \"\\\" has no subfields.\");\n}\nexport function requiredSubselectionMessage(fieldName, type) {\n return \"Field \\\"\".concat(fieldName, \"\\\" of type \\\"\").concat(type, \"\\\" must have a \") + \"selection of subfields. Did you mean \\\"\".concat(fieldName, \" { ... }\\\"?\");\n}\n/**\n * Scalar leafs\n *\n * A GraphQL document is valid only if all leaf fields (fields without\n * sub selections) are of scalar or enum types.\n */\n\nexport function ScalarLeafs(context) {\n return {\n Field: function Field(node) {\n var type = context.getType();\n var selectionSet = node.selectionSet;\n\n if (type) {\n if (isLeafType(getNamedType(type))) {\n if (selectionSet) {\n context.reportError(new GraphQLError(noSubselectionAllowedMessage(node.name.value, inspect(type)), [selectionSet]));\n }\n } else if (!selectionSet) {\n context.reportError(new GraphQLError(requiredSubselectionMessage(node.name.value, inspect(type)), [node]));\n }\n }\n }\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nimport suggestionList from '../../jsutils/suggestionList';\nimport quotedOrList from '../../jsutils/quotedOrList';\nimport { isObjectType, isInterfaceType, isAbstractType } from '../../type/definition';\nexport function undefinedFieldMessage(fieldName, type, suggestedTypeNames, suggestedFieldNames) {\n var message = \"Cannot query field \\\"\".concat(fieldName, \"\\\" on type \\\"\").concat(type, \"\\\".\");\n\n if (suggestedTypeNames.length !== 0) {\n var suggestions = quotedOrList(suggestedTypeNames);\n message += \" Did you mean to use an inline fragment on \".concat(suggestions, \"?\");\n } else if (suggestedFieldNames.length !== 0) {\n message += \" Did you mean \".concat(quotedOrList(suggestedFieldNames), \"?\");\n }\n\n return message;\n}\n/**\n * Fields on correct type\n *\n * A GraphQL document is only valid if all fields selected are defined by the\n * parent type, or are an allowed meta field such as __typename.\n */\n\nexport function FieldsOnCorrectType(context) {\n return {\n Field: function Field(node) {\n var type = context.getParentType();\n\n if (type) {\n var fieldDef = context.getFieldDef();\n\n if (!fieldDef) {\n // This field doesn't exist, lets look for suggestions.\n var schema = context.getSchema();\n var fieldName = node.name.value; // First determine if there are any suggested types to condition on.\n\n var suggestedTypeNames = getSuggestedTypeNames(schema, type, fieldName); // If there are no suggested types, then perhaps this was a typo?\n\n var suggestedFieldNames = suggestedTypeNames.length !== 0 ? [] : getSuggestedFieldNames(schema, type, fieldName); // Report an error, including helpful suggestions.\n\n context.reportError(new GraphQLError(undefinedFieldMessage(fieldName, type.name, suggestedTypeNames, suggestedFieldNames), [node]));\n }\n }\n }\n };\n}\n/**\n * Go through all of the implementations of type, as well as the interfaces that\n * they implement. If any of those types include the provided field, suggest\n * them, sorted by how often the type is referenced, starting with Interfaces.\n */\n\nfunction getSuggestedTypeNames(schema, type, fieldName) {\n if (isAbstractType(type)) {\n var suggestedObjectTypes = [];\n var interfaceUsageCount = Object.create(null);\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = schema.getPossibleTypes(type)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var possibleType = _step.value;\n\n if (!possibleType.getFields()[fieldName]) {\n continue;\n } // This object type defines this field.\n\n\n suggestedObjectTypes.push(possibleType.name);\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = possibleType.getInterfaces()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var possibleInterface = _step2.value;\n\n if (!possibleInterface.getFields()[fieldName]) {\n continue;\n } // This interface type defines this field.\n\n\n interfaceUsageCount[possibleInterface.name] = (interfaceUsageCount[possibleInterface.name] || 0) + 1;\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n } // Suggest interface types based on how common they are.\n\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n var suggestedInterfaceTypes = Object.keys(interfaceUsageCount).sort(function (a, b) {\n return interfaceUsageCount[b] - interfaceUsageCount[a];\n }); // Suggest both interface and object types.\n\n return suggestedInterfaceTypes.concat(suggestedObjectTypes);\n } // Otherwise, must be an Object type, which does not have possible fields.\n\n\n return [];\n}\n/**\n * For the field name provided, determine if there are any similar field names\n * that may be the result of a typo.\n */\n\n\nfunction getSuggestedFieldNames(schema, type, fieldName) {\n if (isObjectType(type) || isInterfaceType(type)) {\n var possibleFieldNames = Object.keys(type.getFields());\n return suggestionList(fieldName, possibleFieldNames);\n } // Otherwise, must be a Union type, which does not define fields.\n\n\n return [];\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nexport function duplicateFragmentNameMessage(fragName) {\n return \"There can be only one fragment named \\\"\".concat(fragName, \"\\\".\");\n}\n/**\n * Unique fragment names\n *\n * A GraphQL document is only valid if all defined fragments have unique names.\n */\n\nexport function UniqueFragmentNames(context) {\n var knownFragmentNames = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n return false;\n },\n FragmentDefinition: function FragmentDefinition(node) {\n var fragmentName = node.name.value;\n\n if (knownFragmentNames[fragmentName]) {\n context.reportError(new GraphQLError(duplicateFragmentNameMessage(fragmentName), [knownFragmentNames[fragmentName], node.name]));\n } else {\n knownFragmentNames[fragmentName] = node.name;\n }\n\n return false;\n }\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nexport function unknownFragmentMessage(fragName) {\n return \"Unknown fragment \\\"\".concat(fragName, \"\\\".\");\n}\n/**\n * Known fragment names\n *\n * A GraphQL document is only valid if all `...Fragment` fragment spreads refer\n * to fragments defined in the same document.\n */\n\nexport function KnownFragmentNames(context) {\n return {\n FragmentSpread: function FragmentSpread(node) {\n var fragmentName = node.name.value;\n var fragment = context.getFragment(fragmentName);\n\n if (!fragment) {\n context.reportError(new GraphQLError(unknownFragmentMessage(fragmentName), [node.name]));\n }\n }\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nexport function unusedFragMessage(fragName) {\n return \"Fragment \\\"\".concat(fragName, \"\\\" is never used.\");\n}\n/**\n * No unused fragments\n *\n * A GraphQL document is only valid if all fragment definitions are spread\n * within operations, or spread within other fragments spread within operations.\n */\n\nexport function NoUnusedFragments(context) {\n var operationDefs = [];\n var fragmentDefs = [];\n return {\n OperationDefinition: function OperationDefinition(node) {\n operationDefs.push(node);\n return false;\n },\n FragmentDefinition: function FragmentDefinition(node) {\n fragmentDefs.push(node);\n return false;\n },\n Document: {\n leave: function leave() {\n var fragmentNameUsed = Object.create(null);\n\n for (var _i = 0; _i < operationDefs.length; _i++) {\n var operation = operationDefs[_i];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = context.getRecursivelyReferencedFragments(operation)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var fragment = _step.value;\n fragmentNameUsed[fragment.name.value] = true;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n\n for (var _i2 = 0; _i2 < fragmentDefs.length; _i2++) {\n var fragmentDef = fragmentDefs[_i2];\n var fragName = fragmentDef.name.value;\n\n if (fragmentNameUsed[fragName] !== true) {\n context.reportError(new GraphQLError(unusedFragMessage(fragName), [fragmentDef]));\n }\n }\n }\n }\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport inspect from '../../jsutils/inspect';\nimport { GraphQLError } from '../../error/GraphQLError';\nimport { doTypesOverlap } from '../../utilities/typeComparators';\nimport { typeFromAST } from '../../utilities/typeFromAST';\nimport { isCompositeType } from '../../type/definition';\nexport function typeIncompatibleSpreadMessage(fragName, parentType, fragType) {\n return \"Fragment \\\"\".concat(fragName, \"\\\" cannot be spread here as objects of \") + \"type \\\"\".concat(parentType, \"\\\" can never be of type \\\"\").concat(fragType, \"\\\".\");\n}\nexport function typeIncompatibleAnonSpreadMessage(parentType, fragType) {\n return 'Fragment cannot be spread here as objects of ' + \"type \\\"\".concat(parentType, \"\\\" can never be of type \\\"\").concat(fragType, \"\\\".\");\n}\n/**\n * Possible fragment spread\n *\n * A fragment spread is only valid if the type condition could ever possibly\n * be true: if there is a non-empty intersection of the possible parent types,\n * and possible types which pass the type condition.\n */\n\nexport function PossibleFragmentSpreads(context) {\n return {\n InlineFragment: function InlineFragment(node) {\n var fragType = context.getType();\n var parentType = context.getParentType();\n\n if (isCompositeType(fragType) && isCompositeType(parentType) && !doTypesOverlap(context.getSchema(), fragType, parentType)) {\n context.reportError(new GraphQLError(typeIncompatibleAnonSpreadMessage(inspect(parentType), inspect(fragType)), [node]));\n }\n },\n FragmentSpread: function FragmentSpread(node) {\n var fragName = node.name.value;\n var fragType = getFragmentType(context, fragName);\n var parentType = context.getParentType();\n\n if (fragType && parentType && !doTypesOverlap(context.getSchema(), fragType, parentType)) {\n context.reportError(new GraphQLError(typeIncompatibleSpreadMessage(fragName, inspect(parentType), inspect(fragType)), [node]));\n }\n }\n };\n}\n\nfunction getFragmentType(context, name) {\n var frag = context.getFragment(name);\n\n if (frag) {\n var type = typeFromAST(context.getSchema(), frag.typeCondition);\n\n if (isCompositeType(type)) {\n return type;\n }\n }\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nexport function cycleErrorMessage(fragName, spreadNames) {\n var via = spreadNames.length ? ' via ' + spreadNames.join(', ') : '';\n return \"Cannot spread fragment \\\"\".concat(fragName, \"\\\" within itself\").concat(via, \".\");\n}\nexport function NoFragmentCycles(context) {\n // Tracks already visited fragments to maintain O(N) and to ensure that cycles\n // are not redundantly reported.\n var visitedFrags = Object.create(null); // Array of AST nodes used to produce meaningful errors\n\n var spreadPath = []; // Position in the spread path\n\n var spreadPathIndexByName = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n return false;\n },\n FragmentDefinition: function FragmentDefinition(node) {\n detectCycleRecursive(node);\n return false;\n }\n }; // This does a straight-forward DFS to find cycles.\n // It does not terminate when a cycle was found but continues to explore\n // the graph to find all possible cycles.\n\n function detectCycleRecursive(fragment) {\n if (visitedFrags[fragment.name.value]) {\n return;\n }\n\n var fragmentName = fragment.name.value;\n visitedFrags[fragmentName] = true;\n var spreadNodes = context.getFragmentSpreads(fragment.selectionSet);\n\n if (spreadNodes.length === 0) {\n return;\n }\n\n spreadPathIndexByName[fragmentName] = spreadPath.length;\n\n for (var i = 0; i < spreadNodes.length; i++) {\n var spreadNode = spreadNodes[i];\n var spreadName = spreadNode.name.value;\n var cycleIndex = spreadPathIndexByName[spreadName];\n spreadPath.push(spreadNode);\n\n if (cycleIndex === undefined) {\n var spreadFragment = context.getFragment(spreadName);\n\n if (spreadFragment) {\n detectCycleRecursive(spreadFragment);\n }\n } else {\n var cyclePath = spreadPath.slice(cycleIndex);\n var fragmentNames = cyclePath.slice(0, -1).map(function (s) {\n return s.name.value;\n });\n context.reportError(new GraphQLError(cycleErrorMessage(spreadName, fragmentNames), cyclePath));\n }\n\n spreadPath.pop();\n }\n\n spreadPathIndexByName[fragmentName] = undefined;\n }\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nexport function duplicateVariableMessage(variableName) {\n return \"There can be only one variable named \\\"\".concat(variableName, \"\\\".\");\n}\n/**\n * Unique variable names\n *\n * A GraphQL operation is only valid if all its variables are uniquely named.\n */\n\nexport function UniqueVariableNames(context) {\n var knownVariableNames = Object.create(null);\n return {\n OperationDefinition: function OperationDefinition() {\n knownVariableNames = Object.create(null);\n },\n VariableDefinition: function VariableDefinition(node) {\n var variableName = node.variable.name.value;\n\n if (knownVariableNames[variableName]) {\n context.reportError(new GraphQLError(duplicateVariableMessage(variableName), [knownVariableNames[variableName], node.variable.name]));\n } else {\n knownVariableNames[variableName] = node.variable.name;\n }\n }\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nexport function undefinedVarMessage(varName, opName) {\n return opName ? \"Variable \\\"$\".concat(varName, \"\\\" is not defined by operation \\\"\").concat(opName, \"\\\".\") : \"Variable \\\"$\".concat(varName, \"\\\" is not defined.\");\n}\n/**\n * No undefined variables\n *\n * A GraphQL operation is only valid if all variables encountered, both directly\n * and via fragment spreads, are defined by that operation.\n */\n\nexport function NoUndefinedVariables(context) {\n var variableNameDefined = Object.create(null);\n return {\n OperationDefinition: {\n enter: function enter() {\n variableNameDefined = Object.create(null);\n },\n leave: function leave(operation) {\n var usages = context.getRecursiveVariableUsages(operation);\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = usages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _ref2 = _step.value;\n var node = _ref2.node;\n var varName = node.name.value;\n\n if (variableNameDefined[varName] !== true) {\n context.reportError(new GraphQLError(undefinedVarMessage(varName, operation.name && operation.name.value), [node, operation]));\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n },\n VariableDefinition: function VariableDefinition(node) {\n variableNameDefined[node.variable.name.value] = true;\n }\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nexport function unusedVariableMessage(varName, opName) {\n return opName ? \"Variable \\\"$\".concat(varName, \"\\\" is never used in operation \\\"\").concat(opName, \"\\\".\") : \"Variable \\\"$\".concat(varName, \"\\\" is never used.\");\n}\n/**\n * No unused variables\n *\n * A GraphQL operation is only valid if all variables defined by an operation\n * are used, either directly or within a spread fragment.\n */\n\nexport function NoUnusedVariables(context) {\n var variableDefs = [];\n return {\n OperationDefinition: {\n enter: function enter() {\n variableDefs = [];\n },\n leave: function leave(operation) {\n var variableNameUsed = Object.create(null);\n var usages = context.getRecursiveVariableUsages(operation);\n var opName = operation.name ? operation.name.value : null;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = usages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _ref2 = _step.value;\n var node = _ref2.node;\n variableNameUsed[node.name.value] = true;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n for (var _i = 0; _i < variableDefs.length; _i++) {\n var variableDef = variableDefs[_i];\n var variableName = variableDef.variable.name.value;\n\n if (variableNameUsed[variableName] !== true) {\n context.reportError(new GraphQLError(unusedVariableMessage(variableName, opName), [variableDef]));\n }\n }\n }\n },\n VariableDefinition: function VariableDefinition(def) {\n variableDefs.push(def);\n }\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nimport { Kind } from '../../language/kinds';\nimport { DirectiveLocation } from '../../language/directiveLocation';\nimport { specifiedDirectives } from '../../type/directives';\nexport function unknownDirectiveMessage(directiveName) {\n return \"Unknown directive \\\"\".concat(directiveName, \"\\\".\");\n}\nexport function misplacedDirectiveMessage(directiveName, location) {\n return \"Directive \\\"\".concat(directiveName, \"\\\" may not be used on \").concat(location, \".\");\n}\n/**\n * Known directives\n *\n * A GraphQL document is only valid if all `@directives` are known by the\n * schema and legally positioned.\n */\n\nexport function KnownDirectives(context) {\n var locationsMap = Object.create(null);\n var schema = context.getSchema();\n var definedDirectives = schema ? schema.getDirectives() : specifiedDirectives;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = definedDirectives[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var directive = _step.value;\n locationsMap[directive.name] = directive.locations;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n var astDefinitions = context.getDocument().definitions;\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = astDefinitions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var def = _step2.value;\n\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n locationsMap[def.name.value] = def.locations.map(function (name) {\n return name.value;\n });\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n return {\n Directive: function Directive(node, key, parent, path, ancestors) {\n var name = node.name.value;\n var locations = locationsMap[name];\n\n if (!locations) {\n context.reportError(new GraphQLError(unknownDirectiveMessage(name), [node]));\n return;\n }\n\n var candidateLocation = getDirectiveLocationForASTPath(ancestors);\n\n if (candidateLocation && locations.indexOf(candidateLocation) === -1) {\n context.reportError(new GraphQLError(misplacedDirectiveMessage(name, candidateLocation), [node]));\n }\n }\n };\n}\n\nfunction getDirectiveLocationForASTPath(ancestors) {\n var appliedTo = ancestors[ancestors.length - 1];\n\n if (!Array.isArray(appliedTo)) {\n switch (appliedTo.kind) {\n case Kind.OPERATION_DEFINITION:\n switch (appliedTo.operation) {\n case 'query':\n return DirectiveLocation.QUERY;\n\n case 'mutation':\n return DirectiveLocation.MUTATION;\n\n case 'subscription':\n return DirectiveLocation.SUBSCRIPTION;\n }\n\n break;\n\n case Kind.FIELD:\n return DirectiveLocation.FIELD;\n\n case Kind.FRAGMENT_SPREAD:\n return DirectiveLocation.FRAGMENT_SPREAD;\n\n case Kind.INLINE_FRAGMENT:\n return DirectiveLocation.INLINE_FRAGMENT;\n\n case Kind.FRAGMENT_DEFINITION:\n return DirectiveLocation.FRAGMENT_DEFINITION;\n\n case Kind.VARIABLE_DEFINITION:\n return DirectiveLocation.VARIABLE_DEFINITION;\n\n case Kind.SCHEMA_DEFINITION:\n case Kind.SCHEMA_EXTENSION:\n return DirectiveLocation.SCHEMA;\n\n case Kind.SCALAR_TYPE_DEFINITION:\n case Kind.SCALAR_TYPE_EXTENSION:\n return DirectiveLocation.SCALAR;\n\n case Kind.OBJECT_TYPE_DEFINITION:\n case Kind.OBJECT_TYPE_EXTENSION:\n return DirectiveLocation.OBJECT;\n\n case Kind.FIELD_DEFINITION:\n return DirectiveLocation.FIELD_DEFINITION;\n\n case Kind.INTERFACE_TYPE_DEFINITION:\n case Kind.INTERFACE_TYPE_EXTENSION:\n return DirectiveLocation.INTERFACE;\n\n case Kind.UNION_TYPE_DEFINITION:\n case Kind.UNION_TYPE_EXTENSION:\n return DirectiveLocation.UNION;\n\n case Kind.ENUM_TYPE_DEFINITION:\n case Kind.ENUM_TYPE_EXTENSION:\n return DirectiveLocation.ENUM;\n\n case Kind.ENUM_VALUE_DEFINITION:\n return DirectiveLocation.ENUM_VALUE;\n\n case Kind.INPUT_OBJECT_TYPE_DEFINITION:\n case Kind.INPUT_OBJECT_TYPE_EXTENSION:\n return DirectiveLocation.INPUT_OBJECT;\n\n case Kind.INPUT_VALUE_DEFINITION:\n var parentNode = ancestors[ancestors.length - 3];\n return parentNode.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION ? DirectiveLocation.INPUT_FIELD_DEFINITION : DirectiveLocation.ARGUMENT_DEFINITION;\n }\n }\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nexport function duplicateDirectiveMessage(directiveName) {\n return \"The directive \\\"\".concat(directiveName, \"\\\" can only be used once at \") + 'this location.';\n}\n/**\n * Unique directive names per location\n *\n * A GraphQL document is only valid if all directives at a given location\n * are uniquely named.\n */\n\nexport function UniqueDirectivesPerLocation(context) {\n return {\n // Many different AST nodes may contain directives. Rather than listing\n // them all, just listen for entering any node, and check to see if it\n // defines any directives.\n enter: function enter(node) {\n // Flow can't refine that node.directives will only contain directives,\n var directives = node.directives;\n\n if (directives) {\n var knownDirectives = Object.create(null);\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = directives[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var directive = _step.value;\n var directiveName = directive.name.value;\n\n if (knownDirectives[directiveName]) {\n context.reportError(new GraphQLError(duplicateDirectiveMessage(directiveName), [knownDirectives[directiveName], directive]));\n } else {\n knownDirectives[directiveName] = directive;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n }\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nexport function duplicateArgMessage(argName) {\n return \"There can be only one argument named \\\"\".concat(argName, \"\\\".\");\n}\n/**\n * Unique argument names\n *\n * A GraphQL field or directive is only valid if all supplied arguments are\n * uniquely named.\n */\n\nexport function UniqueArgumentNames(context) {\n var knownArgNames = Object.create(null);\n return {\n Field: function Field() {\n knownArgNames = Object.create(null);\n },\n Directive: function Directive() {\n knownArgNames = Object.create(null);\n },\n Argument: function Argument(node) {\n var argName = node.name.value;\n\n if (knownArgNames[argName]) {\n context.reportError(new GraphQLError(duplicateArgMessage(argName), [knownArgNames[argName], node.name]));\n } else {\n knownArgNames[argName] = node.name;\n }\n\n return false;\n }\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nimport { print } from '../../language/printer';\nimport { isScalarType, isEnumType, isInputObjectType, isListType, isNonNullType, isRequiredInputField, getNullableType, getNamedType } from '../../type/definition';\nimport inspect from '../../jsutils/inspect';\nimport isInvalid from '../../jsutils/isInvalid';\nimport keyMap from '../../jsutils/keyMap';\nimport orList from '../../jsutils/orList';\nimport suggestionList from '../../jsutils/suggestionList';\nexport function badValueMessage(typeName, valueName, message) {\n return \"Expected type \".concat(typeName, \", found \").concat(valueName) + (message ? \"; \".concat(message) : '.');\n}\nexport function requiredFieldMessage(typeName, fieldName, fieldTypeName) {\n return \"Field \".concat(typeName, \".\").concat(fieldName, \" of required type \") + \"\".concat(fieldTypeName, \" was not provided.\");\n}\nexport function unknownFieldMessage(typeName, fieldName, message) {\n return \"Field \\\"\".concat(fieldName, \"\\\" is not defined by type \").concat(typeName) + (message ? \"; \".concat(message) : '.');\n}\n/**\n * Value literals of correct type\n *\n * A GraphQL document is only valid if all value literals are of the type\n * expected at their position.\n */\n\nexport function ValuesOfCorrectType(context) {\n return {\n NullValue: function NullValue(node) {\n var type = context.getInputType();\n\n if (isNonNullType(type)) {\n context.reportError(new GraphQLError(badValueMessage(inspect(type), print(node)), node));\n }\n },\n ListValue: function ListValue(node) {\n // Note: TypeInfo will traverse into a list's item type, so look to the\n // parent input type to check if it is a list.\n var type = getNullableType(context.getParentInputType());\n\n if (!isListType(type)) {\n isValidScalar(context, node);\n return false; // Don't traverse further.\n }\n },\n ObjectValue: function ObjectValue(node) {\n var type = getNamedType(context.getInputType());\n\n if (!isInputObjectType(type)) {\n isValidScalar(context, node);\n return false; // Don't traverse further.\n } // Ensure every required field exists.\n\n\n var inputFields = type.getFields();\n var fieldNodeMap = keyMap(node.fields, function (field) {\n return field.name.value;\n });\n\n var _arr = Object.keys(inputFields);\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var fieldName = _arr[_i];\n var fieldDef = inputFields[fieldName];\n var fieldNode = fieldNodeMap[fieldName];\n\n if (!fieldNode && isRequiredInputField(fieldDef)) {\n var typeStr = inspect(fieldDef.type);\n context.reportError(new GraphQLError(requiredFieldMessage(type.name, fieldName, typeStr), node));\n }\n }\n },\n ObjectField: function ObjectField(node) {\n var parentType = getNamedType(context.getParentInputType());\n var fieldType = context.getInputType();\n\n if (!fieldType && isInputObjectType(parentType)) {\n var suggestions = suggestionList(node.name.value, Object.keys(parentType.getFields()));\n var didYouMean = suggestions.length !== 0 ? \"Did you mean \".concat(orList(suggestions), \"?\") : undefined;\n context.reportError(new GraphQLError(unknownFieldMessage(parentType.name, node.name.value, didYouMean), node));\n }\n },\n EnumValue: function EnumValue(node) {\n var type = getNamedType(context.getInputType());\n\n if (!isEnumType(type)) {\n isValidScalar(context, node);\n } else if (!type.getValue(node.value)) {\n context.reportError(new GraphQLError(badValueMessage(type.name, print(node), enumTypeSuggestion(type, node)), node));\n }\n },\n IntValue: function IntValue(node) {\n return isValidScalar(context, node);\n },\n FloatValue: function FloatValue(node) {\n return isValidScalar(context, node);\n },\n StringValue: function StringValue(node) {\n return isValidScalar(context, node);\n },\n BooleanValue: function BooleanValue(node) {\n return isValidScalar(context, node);\n }\n };\n}\n/**\n * Any value literal may be a valid representation of a Scalar, depending on\n * that scalar type.\n */\n\nfunction isValidScalar(context, node) {\n // Report any error at the full type expected by the location.\n var locationType = context.getInputType();\n\n if (!locationType) {\n return;\n }\n\n var type = getNamedType(locationType);\n\n if (!isScalarType(type)) {\n context.reportError(new GraphQLError(badValueMessage(inspect(locationType), print(node), enumTypeSuggestion(type, node)), node));\n return;\n } // Scalars determine if a literal value is valid via parseLiteral() which\n // may throw or return an invalid value to indicate failure.\n\n\n try {\n var parseResult = type.parseLiteral(node, undefined\n /* variables */\n );\n\n if (isInvalid(parseResult)) {\n context.reportError(new GraphQLError(badValueMessage(inspect(locationType), print(node)), node));\n }\n } catch (error) {\n // Ensure a reference to the original error is maintained.\n context.reportError(new GraphQLError(badValueMessage(inspect(locationType), print(node), error.message), node, undefined, undefined, undefined, error));\n }\n}\n\nfunction enumTypeSuggestion(type, node) {\n if (isEnumType(type)) {\n var suggestions = suggestionList(print(node), type.getValues().map(function (value) {\n return value.name;\n }));\n\n if (suggestions.length !== 0) {\n return \"Did you mean the enum value \".concat(orList(suggestions), \"?\");\n }\n }\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport inspect from '../../jsutils/inspect';\nimport { GraphQLError } from '../../error/GraphQLError';\nimport { Kind } from '../../language/kinds';\nimport { isNonNullType } from '../../type/definition';\nimport { isTypeSubTypeOf } from '../../utilities/typeComparators';\nimport { typeFromAST } from '../../utilities/typeFromAST';\nexport function badVarPosMessage(varName, varType, expectedType) {\n return \"Variable \\\"$\".concat(varName, \"\\\" of type \\\"\").concat(varType, \"\\\" used in \") + \"position expecting type \\\"\".concat(expectedType, \"\\\".\");\n}\n/**\n * Variables passed to field arguments conform to type\n */\n\nexport function VariablesInAllowedPosition(context) {\n var varDefMap = Object.create(null);\n return {\n OperationDefinition: {\n enter: function enter() {\n varDefMap = Object.create(null);\n },\n leave: function leave(operation) {\n var usages = context.getRecursiveVariableUsages(operation);\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = usages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _ref2 = _step.value;\n var node = _ref2.node,\n type = _ref2.type,\n defaultValue = _ref2.defaultValue;\n var varName = node.name.value;\n var varDef = varDefMap[varName];\n\n if (varDef && type) {\n // A var type is allowed if it is the same or more strict (e.g. is\n // a subtype of) than the expected type. It can be more strict if\n // the variable type is non-null when the expected type is nullable.\n // If both are list types, the variable item type can be more strict\n // than the expected item type (contravariant).\n var schema = context.getSchema();\n var varType = typeFromAST(schema, varDef.type);\n\n if (varType && !allowedVariableUsage(schema, varType, varDef.defaultValue, type, defaultValue)) {\n context.reportError(new GraphQLError(badVarPosMessage(varName, inspect(varType), inspect(type)), [varDef, node]));\n }\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n },\n VariableDefinition: function VariableDefinition(node) {\n varDefMap[node.variable.name.value] = node;\n }\n };\n}\n/**\n * Returns true if the variable is allowed in the location it was found,\n * which includes considering if default values exist for either the variable\n * or the location at which it is located.\n */\n\nfunction allowedVariableUsage(schema, varType, varDefaultValue, locationType, locationDefaultValue) {\n if (isNonNullType(locationType) && !isNonNullType(varType)) {\n var hasNonNullVariableDefaultValue = varDefaultValue && varDefaultValue.kind !== Kind.NULL;\n var hasLocationDefaultValue = locationDefaultValue !== undefined;\n\n if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) {\n return false;\n }\n\n var nullableLocationType = locationType.ofType;\n return isTypeSubTypeOf(schema, varType, nullableLocationType);\n }\n\n return isTypeSubTypeOf(schema, varType, locationType);\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nexport function duplicateInputFieldMessage(fieldName) {\n return \"There can be only one input field named \\\"\".concat(fieldName, \"\\\".\");\n}\n/**\n * Unique input field names\n *\n * A GraphQL input object value is only valid if all supplied fields are\n * uniquely named.\n */\n\nexport function UniqueInputFieldNames(context) {\n var knownNameStack = [];\n var knownNames = Object.create(null);\n return {\n ObjectValue: {\n enter: function enter() {\n knownNameStack.push(knownNames);\n knownNames = Object.create(null);\n },\n leave: function leave() {\n knownNames = knownNameStack.pop();\n }\n },\n ObjectField: function ObjectField(node) {\n var fieldName = node.name.value;\n\n if (knownNames[fieldName]) {\n context.reportError(new GraphQLError(duplicateInputFieldMessage(fieldName), [knownNames[fieldName], node.name]));\n } else {\n knownNames[fieldName] = node.name;\n }\n\n return false;\n }\n };\n}","/**\n * Copyright (c) 2018-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../../error/GraphQLError';\nexport function schemaDefinitionNotAloneMessage() {\n return 'Must provide only one schema definition.';\n}\nexport function canNotDefineSchemaWithinExtensionMessage() {\n return 'Cannot define a new schema within a schema extension.';\n}\n/**\n * Lone Schema definition\n *\n * A GraphQL document is only valid if it contains only one schema definition.\n */\n\nexport function LoneSchemaDefinition(context) {\n var oldSchema = context.getSchema();\n var alreadyDefined = oldSchema && (oldSchema.astNode || oldSchema.getQueryType() || oldSchema.getMutationType() || oldSchema.getSubscriptionType());\n var schemaDefinitionsCount = 0;\n return {\n SchemaDefinition: function SchemaDefinition(node) {\n if (alreadyDefined) {\n context.reportError(new GraphQLError(canNotDefineSchemaWithinExtensionMessage(), node));\n return;\n }\n\n if (schemaDefinitionsCount > 0) {\n context.reportError(new GraphQLError(schemaDefinitionNotAloneMessage(), node));\n }\n\n ++schemaDefinitionsCount;\n }\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n// Spec Section: \"Executable Definitions\"\nimport { ExecutableDefinitions } from './rules/ExecutableDefinitions'; // Spec Section: \"Operation Name Uniqueness\"\n\nimport { UniqueOperationNames } from './rules/UniqueOperationNames'; // Spec Section: \"Lone Anonymous Operation\"\n\nimport { LoneAnonymousOperation } from './rules/LoneAnonymousOperation'; // Spec Section: \"Subscriptions with Single Root Field\"\n\nimport { SingleFieldSubscriptions } from './rules/SingleFieldSubscriptions'; // Spec Section: \"Fragment Spread Type Existence\"\n\nimport { KnownTypeNames } from './rules/KnownTypeNames'; // Spec Section: \"Fragments on Composite Types\"\n\nimport { FragmentsOnCompositeTypes } from './rules/FragmentsOnCompositeTypes'; // Spec Section: \"Variables are Input Types\"\n\nimport { VariablesAreInputTypes } from './rules/VariablesAreInputTypes'; // Spec Section: \"Leaf Field Selections\"\n\nimport { ScalarLeafs } from './rules/ScalarLeafs'; // Spec Section: \"Field Selections on Objects, Interfaces, and Unions Types\"\n\nimport { FieldsOnCorrectType } from './rules/FieldsOnCorrectType'; // Spec Section: \"Fragment Name Uniqueness\"\n\nimport { UniqueFragmentNames } from './rules/UniqueFragmentNames'; // Spec Section: \"Fragment spread target defined\"\n\nimport { KnownFragmentNames } from './rules/KnownFragmentNames'; // Spec Section: \"Fragments must be used\"\n\nimport { NoUnusedFragments } from './rules/NoUnusedFragments'; // Spec Section: \"Fragment spread is possible\"\n\nimport { PossibleFragmentSpreads } from './rules/PossibleFragmentSpreads'; // Spec Section: \"Fragments must not form cycles\"\n\nimport { NoFragmentCycles } from './rules/NoFragmentCycles'; // Spec Section: \"Variable Uniqueness\"\n\nimport { UniqueVariableNames } from './rules/UniqueVariableNames'; // Spec Section: \"All Variable Used Defined\"\n\nimport { NoUndefinedVariables } from './rules/NoUndefinedVariables'; // Spec Section: \"All Variables Used\"\n\nimport { NoUnusedVariables } from './rules/NoUnusedVariables'; // Spec Section: \"Directives Are Defined\"\n\nimport { KnownDirectives } from './rules/KnownDirectives'; // Spec Section: \"Directives Are Unique Per Location\"\n\nimport { UniqueDirectivesPerLocation } from './rules/UniqueDirectivesPerLocation'; // Spec Section: \"Argument Names\"\n\nimport { KnownArgumentNames } from './rules/KnownArgumentNames'; // Spec Section: \"Argument Uniqueness\"\n\nimport { UniqueArgumentNames } from './rules/UniqueArgumentNames'; // Spec Section: \"Value Type Correctness\"\n\nimport { ValuesOfCorrectType } from './rules/ValuesOfCorrectType'; // Spec Section: \"Argument Optionality\"\n\nimport { ProvidedRequiredArguments } from './rules/ProvidedRequiredArguments'; // Spec Section: \"All Variable Usages Are Allowed\"\n\nimport { VariablesInAllowedPosition } from './rules/VariablesInAllowedPosition'; // Spec Section: \"Field Selection Merging\"\n\nimport { OverlappingFieldsCanBeMerged } from './rules/OverlappingFieldsCanBeMerged'; // Spec Section: \"Input Object Field Uniqueness\"\n\nimport { UniqueInputFieldNames } from './rules/UniqueInputFieldNames';\n/**\n * This set includes all validation rules defined by the GraphQL spec.\n *\n * The order of the rules in this list has been adjusted to lead to the\n * most clear output when encountering multiple validation errors.\n */\n\nexport var specifiedRules = [ExecutableDefinitions, UniqueOperationNames, LoneAnonymousOperation, SingleFieldSubscriptions, KnownTypeNames, FragmentsOnCompositeTypes, VariablesAreInputTypes, ScalarLeafs, FieldsOnCorrectType, UniqueFragmentNames, KnownFragmentNames, NoUnusedFragments, PossibleFragmentSpreads, NoFragmentCycles, UniqueVariableNames, NoUndefinedVariables, NoUnusedVariables, KnownDirectives, UniqueDirectivesPerLocation, KnownArgumentNames, UniqueArgumentNames, ValuesOfCorrectType, ProvidedRequiredArguments, VariablesInAllowedPosition, OverlappingFieldsCanBeMerged, UniqueInputFieldNames];\nimport { LoneSchemaDefinition } from './rules/LoneSchemaDefinition';\nimport { KnownArgumentNamesOnDirectives } from './rules/KnownArgumentNames';\nimport { ProvidedRequiredArgumentsOnDirectives } from './rules/ProvidedRequiredArguments'; // @internal\n\nexport var specifiedSDLRules = [LoneSchemaDefinition, KnownDirectives, UniqueDirectivesPerLocation, KnownArgumentNamesOnDirectives, UniqueArgumentNames, UniqueInputFieldNames, ProvidedRequiredArgumentsOnDirectives];","function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { visit, visitWithTypeInfo } from '../language/visitor';\nimport { Kind } from '../language/kinds';\nimport { TypeInfo } from '../utilities/TypeInfo';\n\n/**\n * An instance of this class is passed as the \"this\" context to all validators,\n * allowing access to commonly useful contextual information from within a\n * validation rule.\n */\nexport var ASTValidationContext =\n/*#__PURE__*/\nfunction () {\n function ASTValidationContext(ast) {\n _defineProperty(this, \"_ast\", void 0);\n\n _defineProperty(this, \"_errors\", void 0);\n\n this._ast = ast;\n this._errors = [];\n }\n\n var _proto = ASTValidationContext.prototype;\n\n _proto.reportError = function reportError(error) {\n this._errors.push(error);\n };\n\n _proto.getErrors = function getErrors() {\n return this._errors;\n };\n\n _proto.getDocument = function getDocument() {\n return this._ast;\n };\n\n return ASTValidationContext;\n}();\nexport var SDLValidationContext =\n/*#__PURE__*/\nfunction (_ASTValidationContext) {\n _inheritsLoose(SDLValidationContext, _ASTValidationContext);\n\n function SDLValidationContext(ast, schema) {\n var _this;\n\n _this = _ASTValidationContext.call(this, ast) || this;\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"_schema\", void 0);\n\n _this._schema = schema;\n return _this;\n }\n\n var _proto2 = SDLValidationContext.prototype;\n\n _proto2.getSchema = function getSchema() {\n return this._schema;\n };\n\n return SDLValidationContext;\n}(ASTValidationContext);\nexport var ValidationContext =\n/*#__PURE__*/\nfunction (_ASTValidationContext2) {\n _inheritsLoose(ValidationContext, _ASTValidationContext2);\n\n function ValidationContext(schema, ast, typeInfo) {\n var _this2;\n\n _this2 = _ASTValidationContext2.call(this, ast) || this;\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this2)), \"_schema\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this2)), \"_typeInfo\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this2)), \"_fragments\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this2)), \"_fragmentSpreads\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this2)), \"_recursivelyReferencedFragments\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this2)), \"_variableUsages\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this2)), \"_recursiveVariableUsages\", void 0);\n\n _this2._schema = schema;\n _this2._typeInfo = typeInfo;\n _this2._fragmentSpreads = new Map();\n _this2._recursivelyReferencedFragments = new Map();\n _this2._variableUsages = new Map();\n _this2._recursiveVariableUsages = new Map();\n return _this2;\n }\n\n var _proto3 = ValidationContext.prototype;\n\n _proto3.getSchema = function getSchema() {\n return this._schema;\n };\n\n _proto3.getFragment = function getFragment(name) {\n var fragments = this._fragments;\n\n if (!fragments) {\n this._fragments = fragments = this.getDocument().definitions.reduce(function (frags, statement) {\n if (statement.kind === Kind.FRAGMENT_DEFINITION) {\n frags[statement.name.value] = statement;\n }\n\n return frags;\n }, Object.create(null));\n }\n\n return fragments[name];\n };\n\n _proto3.getFragmentSpreads = function getFragmentSpreads(node) {\n var spreads = this._fragmentSpreads.get(node);\n\n if (!spreads) {\n spreads = [];\n var setsToVisit = [node];\n\n while (setsToVisit.length !== 0) {\n var set = setsToVisit.pop();\n\n for (var i = 0; i < set.selections.length; i++) {\n var selection = set.selections[i];\n\n if (selection.kind === Kind.FRAGMENT_SPREAD) {\n spreads.push(selection);\n } else if (selection.selectionSet) {\n setsToVisit.push(selection.selectionSet);\n }\n }\n }\n\n this._fragmentSpreads.set(node, spreads);\n }\n\n return spreads;\n };\n\n _proto3.getRecursivelyReferencedFragments = function getRecursivelyReferencedFragments(operation) {\n var fragments = this._recursivelyReferencedFragments.get(operation);\n\n if (!fragments) {\n fragments = [];\n var collectedNames = Object.create(null);\n var nodesToVisit = [operation.selectionSet];\n\n while (nodesToVisit.length !== 0) {\n var node = nodesToVisit.pop();\n var spreads = this.getFragmentSpreads(node);\n\n for (var i = 0; i < spreads.length; i++) {\n var fragName = spreads[i].name.value;\n\n if (collectedNames[fragName] !== true) {\n collectedNames[fragName] = true;\n var fragment = this.getFragment(fragName);\n\n if (fragment) {\n fragments.push(fragment);\n nodesToVisit.push(fragment.selectionSet);\n }\n }\n }\n }\n\n this._recursivelyReferencedFragments.set(operation, fragments);\n }\n\n return fragments;\n };\n\n _proto3.getVariableUsages = function getVariableUsages(node) {\n var usages = this._variableUsages.get(node);\n\n if (!usages) {\n var newUsages = [];\n var typeInfo = new TypeInfo(this._schema);\n visit(node, visitWithTypeInfo(typeInfo, {\n VariableDefinition: function VariableDefinition() {\n return false;\n },\n Variable: function Variable(variable) {\n newUsages.push({\n node: variable,\n type: typeInfo.getInputType(),\n defaultValue: typeInfo.getDefaultValue()\n });\n }\n }));\n usages = newUsages;\n\n this._variableUsages.set(node, usages);\n }\n\n return usages;\n };\n\n _proto3.getRecursiveVariableUsages = function getRecursiveVariableUsages(operation) {\n var usages = this._recursiveVariableUsages.get(operation);\n\n if (!usages) {\n usages = this.getVariableUsages(operation);\n var fragments = this.getRecursivelyReferencedFragments(operation);\n\n for (var i = 0; i < fragments.length; i++) {\n Array.prototype.push.apply(usages, this.getVariableUsages(fragments[i]));\n }\n\n this._recursiveVariableUsages.set(operation, usages);\n }\n\n return usages;\n };\n\n _proto3.getType = function getType() {\n return this._typeInfo.getType();\n };\n\n _proto3.getParentType = function getParentType() {\n return this._typeInfo.getParentType();\n };\n\n _proto3.getInputType = function getInputType() {\n return this._typeInfo.getInputType();\n };\n\n _proto3.getParentInputType = function getParentInputType() {\n return this._typeInfo.getParentInputType();\n };\n\n _proto3.getFieldDef = function getFieldDef() {\n return this._typeInfo.getFieldDef();\n };\n\n _proto3.getDirective = function getDirective() {\n return this._typeInfo.getDirective();\n };\n\n _proto3.getArgument = function getArgument() {\n return this._typeInfo.getArgument();\n };\n\n return ValidationContext;\n}(ASTValidationContext);","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport invariant from '../jsutils/invariant';\nimport { visit, visitInParallel, visitWithTypeInfo } from '../language/visitor';\nimport { assertValidSchema } from '../type/validate';\nimport { TypeInfo } from '../utilities/TypeInfo';\nimport { specifiedRules, specifiedSDLRules } from './specifiedRules';\nimport { SDLValidationContext, ValidationContext } from './ValidationContext';\n/**\n * Implements the \"Validation\" section of the spec.\n *\n * Validation runs synchronously, returning an array of encountered errors, or\n * an empty array if no errors were encountered and the document is valid.\n *\n * A list of specific validation rules may be provided. If not provided, the\n * default list of rules defined by the GraphQL specification will be used.\n *\n * Each validation rules is a function which returns a visitor\n * (see the language/visitor API). Visitor methods are expected to return\n * GraphQLErrors, or Arrays of GraphQLErrors when invalid.\n *\n * Optionally a custom TypeInfo instance may be provided. If not provided, one\n * will be created from the provided schema.\n */\n\nexport function validate(schema, documentAST) {\n var rules = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : specifiedRules;\n var typeInfo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new TypeInfo(schema);\n !documentAST ? invariant(0, 'Must provide document') : void 0; // If the schema used for validation is invalid, throw an error.\n\n assertValidSchema(schema);\n var context = new ValidationContext(schema, documentAST, typeInfo); // This uses a specialized visitor which runs multiple visitors in parallel,\n // while maintaining the visitor skip and break API.\n\n var visitor = visitInParallel(rules.map(function (rule) {\n return rule(context);\n })); // Visit the whole document with each instance of all provided rules.\n\n visit(documentAST, visitWithTypeInfo(typeInfo, visitor));\n return context.getErrors();\n} // @internal\n\nexport function validateSDL(documentAST, schemaToExtend) {\n var rules = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : specifiedSDLRules;\n var context = new SDLValidationContext(documentAST, schemaToExtend);\n var visitors = rules.map(function (rule) {\n return rule(context);\n });\n visit(documentAST, visitInParallel(visitors));\n return context.getErrors();\n}\n/**\n * Utility function which asserts a SDL document is valid by throwing an error\n * if it is invalid.\n *\n * @internal\n */\n\nexport function assertValidSDL(documentAST) {\n var errors = validateSDL(documentAST);\n\n if (errors.length !== 0) {\n throw new Error(errors.map(function (error) {\n return error.message;\n }).join('\\n\\n'));\n }\n}\n/**\n * Utility function which asserts a SDL document is valid by throwing an error\n * if it is invalid.\n *\n * @internal\n */\n\nexport function assertValidSDLExtension(documentAST, schema) {\n var errors = validateSDL(documentAST, schema);\n\n if (errors.length !== 0) {\n throw new Error(errors.map(function (error) {\n return error.message;\n }).join('\\n\\n'));\n }\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/**\n * Returns true if the value acts like a Promise, i.e. has a \"then\" function,\n * otherwise returns false.\n */\n// eslint-disable-next-line no-redeclare\nexport default function isPromise(value) {\n return Boolean(value && typeof value.then === 'function');\n}","/**\n * Copyright (c) 2017-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/**\n * Memoizes the provided three-argument function.\n */\nexport default function memoize3(fn) {\n var cache0;\n\n function memoized(a1, a2, a3) {\n if (!cache0) {\n cache0 = new WeakMap();\n }\n\n var cache1 = cache0.get(a1);\n var cache2;\n\n if (cache1) {\n cache2 = cache1.get(a2);\n\n if (cache2) {\n var cachedValue = cache2.get(a3);\n\n if (cachedValue !== undefined) {\n return cachedValue;\n }\n }\n } else {\n cache1 = new WeakMap();\n cache0.set(a1, cache1);\n }\n\n if (!cache2) {\n cache2 = new WeakMap();\n cache1.set(a2, cache2);\n }\n\n var newValue = fn.apply(this, arguments);\n cache2.set(a3, newValue);\n return newValue;\n }\n\n return memoized;\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/**\n * This function transforms a JS object `ObjMap<Promise<T>>` into\n * a `Promise<ObjMap<T>>`\n *\n * This is akin to bluebird's `Promise.props`, but implemented only using\n * `Promise.all` so it will work with any implementation of ES6 promises.\n */\nexport default function promiseForObject(object) {\n var keys = Object.keys(object);\n var valuesAndPromises = keys.map(function (name) {\n return object[name];\n });\n return Promise.all(valuesAndPromises).then(function (values) {\n return values.reduce(function (resolvedObject, value, i) {\n resolvedObject[keys[i]] = value;\n return resolvedObject;\n }, Object.create(null));\n });\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport isPromise from './isPromise';\n\n/**\n * Similar to Array.prototype.reduce(), however the reducing callback may return\n * a Promise, in which case reduction will continue after each promise resolves.\n *\n * If the callback does not return a Promise, then this function will also not\n * return a Promise.\n */\nexport default function promiseReduce(values, callback, initialValue) {\n return values.reduce(function (previous, value) {\n return isPromise(previous) ? previous.then(function (resolved) {\n return callback(resolved, value);\n }) : callback(previous, value);\n }, initialValue);\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../error/GraphQLError';\n\n/**\n * Extracts the root type of the operation from the schema.\n */\nexport function getOperationRootType(schema, operation) {\n switch (operation.operation) {\n case 'query':\n var queryType = schema.getQueryType();\n\n if (!queryType) {\n throw new GraphQLError('Schema does not define the required query root type.', [operation]);\n }\n\n return queryType;\n\n case 'mutation':\n var mutationType = schema.getMutationType();\n\n if (!mutationType) {\n throw new GraphQLError('Schema is not configured for mutations.', [operation]);\n }\n\n return mutationType;\n\n case 'subscription':\n var subscriptionType = schema.getSubscriptionType();\n\n if (!subscriptionType) {\n throw new GraphQLError('Schema is not configured for subscriptions.', [operation]);\n }\n\n return subscriptionType;\n\n default:\n throw new GraphQLError('Can only have query, mutation and subscription operations.', [operation]);\n }\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport keyMap from '../jsutils/keyMap';\nimport isInvalid from '../jsutils/isInvalid';\nimport objectValues from '../jsutils/objectValues';\nimport { Kind } from '../language/kinds';\nimport { isScalarType, isEnumType, isInputObjectType, isListType, isNonNullType } from '../type/definition';\n\n/**\n * Produces a JavaScript value given a GraphQL Value AST.\n *\n * A GraphQL type must be provided, which will be used to interpret different\n * GraphQL Value literals.\n *\n * Returns `undefined` when the value could not be validly coerced according to\n * the provided type.\n *\n * | GraphQL Value | JSON Value |\n * | -------------------- | ------------- |\n * | Input Object | Object |\n * | List | Array |\n * | Boolean | Boolean |\n * | String | String |\n * | Int / Float | Number |\n * | Enum Value | Mixed |\n * | NullValue | null |\n *\n */\nexport function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (isNonNullType(type)) {\n if (valueNode.kind === Kind.NULL) {\n return; // Invalid: intentionally return no value.\n }\n\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === Kind.NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (valueNode.kind === Kind.VARIABLE) {\n var variableName = valueNode.name.value;\n\n if (!variables || isInvalid(variables[variableName])) {\n // No valid return value.\n return;\n }\n\n var variableValue = variables[variableName];\n\n if (variableValue === null && isNonNullType(type)) {\n return; // Invalid: intentionally return no value.\n } // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n\n return variableValue;\n }\n\n if (isListType(type)) {\n var itemType = type.ofType;\n\n if (valueNode.kind === Kind.LIST) {\n var coercedValues = [];\n var itemNodes = valueNode.values;\n\n for (var i = 0; i < itemNodes.length; i++) {\n if (isMissingVariable(itemNodes[i], variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (isNonNullType(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(null);\n } else {\n var itemValue = valueFromAST(itemNodes[i], itemType, variables);\n\n if (isInvalid(itemValue)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(itemValue);\n }\n }\n\n return coercedValues;\n }\n\n var coercedValue = valueFromAST(valueNode, itemType, variables);\n\n if (isInvalid(coercedValue)) {\n return; // Invalid: intentionally return no value.\n }\n\n return [coercedValue];\n }\n\n if (isInputObjectType(type)) {\n if (valueNode.kind !== Kind.OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n\n var coercedObj = Object.create(null);\n var fieldNodes = keyMap(valueNode.fields, function (field) {\n return field.name.value;\n });\n var fields = objectValues(type.getFields());\n\n for (var _i = 0; _i < fields.length; _i++) {\n var field = fields[_i];\n var fieldNode = fieldNodes[field.name];\n\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (field.defaultValue !== undefined) {\n coercedObj[field.name] = field.defaultValue;\n } else if (isNonNullType(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n\n continue;\n }\n\n var fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n\n if (isInvalid(fieldValue)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedObj[field.name] = fieldValue;\n }\n\n return coercedObj;\n }\n\n if (isEnumType(type)) {\n if (valueNode.kind !== Kind.ENUM) {\n return; // Invalid: intentionally return no value.\n }\n\n var enumValue = type.getValue(valueNode.value);\n\n if (!enumValue) {\n return; // Invalid: intentionally return no value.\n }\n\n return enumValue.value;\n }\n\n if (isScalarType(type)) {\n // Scalars fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n var result;\n\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n\n if (isInvalid(result)) {\n return; // Invalid: intentionally return no value.\n }\n\n return result;\n }\n /* istanbul ignore next */\n\n\n throw new Error(\"Unknown type: \".concat(type, \".\"));\n} // Returns true if the provided valueNode is a variable which is not defined\n// in the set of variables.\n\nfunction isMissingVariable(valueNode, variables) {\n return valueNode.kind === Kind.VARIABLE && (!variables || isInvalid(variables[valueNode.name.value]));\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../error/GraphQLError';\nimport find from '../jsutils/find';\nimport inspect from '../jsutils/inspect';\nimport invariant from '../jsutils/invariant';\nimport keyMap from '../jsutils/keyMap';\nimport { coerceValue } from '../utilities/coerceValue';\nimport { typeFromAST } from '../utilities/typeFromAST';\nimport { valueFromAST } from '../utilities/valueFromAST';\nimport { Kind } from '../language/kinds';\nimport { print } from '../language/printer';\nimport { isInputType, isNonNullType } from '../type/definition';\n\n/**\n * Prepares an object map of variableValues of the correct type based on the\n * provided variable definitions and arbitrary input. If the input cannot be\n * parsed to match the variable definitions, a GraphQLError will be thrown.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n */\nexport function getVariableValues(schema, varDefNodes, inputs) {\n var errors = [];\n var coercedValues = {};\n\n for (var i = 0; i < varDefNodes.length; i++) {\n var varDefNode = varDefNodes[i];\n var varName = varDefNode.variable.name.value;\n var varType = typeFromAST(schema, varDefNode.type);\n\n if (!isInputType(varType)) {\n // Must use input types for variables. This should be caught during\n // validation, however is checked again here for safety.\n errors.push(new GraphQLError(\"Variable \\\"$\".concat(varName, \"\\\" expected value of type \") + \"\\\"\".concat(print(varDefNode.type), \"\\\" which cannot be used as an input type.\"), [varDefNode.type]));\n } else {\n var hasValue = hasOwnProperty(inputs, varName);\n var value = hasValue ? inputs[varName] : undefined;\n\n if (!hasValue && varDefNode.defaultValue) {\n // If no value was provided to a variable with a default value,\n // use the default value.\n coercedValues[varName] = valueFromAST(varDefNode.defaultValue, varType);\n } else if ((!hasValue || value === null) && isNonNullType(varType)) {\n // If no value or a nullish value was provided to a variable with a\n // non-null type (required), produce an error.\n errors.push(new GraphQLError(hasValue ? \"Variable \\\"$\".concat(varName, \"\\\" of non-null type \") + \"\\\"\".concat(inspect(varType), \"\\\" must not be null.\") : \"Variable \\\"$\".concat(varName, \"\\\" of required type \") + \"\\\"\".concat(inspect(varType), \"\\\" was not provided.\"), [varDefNode]));\n } else if (hasValue) {\n if (value === null) {\n // If the explicit value `null` was provided, an entry in the coerced\n // values must exist as the value `null`.\n coercedValues[varName] = null;\n } else {\n // Otherwise, a non-null value was provided, coerce it to the expected\n // type or report an error if coercion fails.\n var coerced = coerceValue(value, varType, varDefNode);\n var coercionErrors = coerced.errors;\n\n if (coercionErrors) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = coercionErrors[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var error = _step.value;\n error.message = \"Variable \\\"$\".concat(varName, \"\\\" got invalid value \").concat(inspect(value), \"; \") + error.message;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n errors.push.apply(errors, coercionErrors);\n } else {\n coercedValues[varName] = coerced.value;\n }\n }\n }\n }\n }\n\n return errors.length === 0 ? {\n errors: undefined,\n coerced: coercedValues\n } : {\n errors: errors,\n coerced: undefined\n };\n}\n/**\n * Prepares an object map of argument values given a list of argument\n * definitions and list of argument AST nodes.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n */\n\nexport function getArgumentValues(def, node, variableValues) {\n var coercedValues = {};\n var argDefs = def.args;\n var argNodes = node.arguments;\n\n if (!argDefs || !argNodes) {\n return coercedValues;\n }\n\n var argNodeMap = keyMap(argNodes, function (arg) {\n return arg.name.value;\n });\n\n for (var i = 0; i < argDefs.length; i++) {\n var argDef = argDefs[i];\n var name = argDef.name;\n var argType = argDef.type;\n var argumentNode = argNodeMap[name];\n var hasValue = void 0;\n var isNull = void 0;\n\n if (argumentNode && argumentNode.value.kind === Kind.VARIABLE) {\n var variableName = argumentNode.value.name.value;\n hasValue = variableValues && hasOwnProperty(variableValues, variableName);\n isNull = variableValues && variableValues[variableName] === null;\n } else {\n hasValue = argumentNode != null;\n isNull = argumentNode && argumentNode.value.kind === Kind.NULL;\n }\n\n if (!hasValue && argDef.defaultValue !== undefined) {\n // If no argument was provided where the definition has a default value,\n // use the default value.\n coercedValues[name] = argDef.defaultValue;\n } else if ((!hasValue || isNull) && isNonNullType(argType)) {\n // If no argument or a null value was provided to an argument with a\n // non-null type (required), produce a field error.\n if (isNull) {\n throw new GraphQLError(\"Argument \\\"\".concat(name, \"\\\" of non-null type \\\"\").concat(inspect(argType), \"\\\" \") + 'must not be null.', [argumentNode.value]);\n } else if (argumentNode && argumentNode.value.kind === Kind.VARIABLE) {\n var _variableName = argumentNode.value.name.value;\n throw new GraphQLError(\"Argument \\\"\".concat(name, \"\\\" of required type \\\"\").concat(inspect(argType), \"\\\" \") + \"was provided the variable \\\"$\".concat(_variableName, \"\\\" \") + 'which was not provided a runtime value.', [argumentNode.value]);\n } else {\n throw new GraphQLError(\"Argument \\\"\".concat(name, \"\\\" of required type \\\"\").concat(inspect(argType), \"\\\" \") + 'was not provided.', [node]);\n }\n } else if (hasValue) {\n if (argumentNode.value.kind === Kind.NULL) {\n // If the explicit value `null` was provided, an entry in the coerced\n // values must exist as the value `null`.\n coercedValues[name] = null;\n } else if (argumentNode.value.kind === Kind.VARIABLE) {\n var _variableName2 = argumentNode.value.name.value;\n !variableValues ? invariant(0, 'Must exist for hasValue to be true.') : void 0; // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n coercedValues[name] = variableValues[_variableName2];\n } else {\n var valueNode = argumentNode.value;\n var coercedValue = valueFromAST(valueNode, argType, variableValues);\n\n if (coercedValue === undefined) {\n // Note: ValuesOfCorrectType validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n throw new GraphQLError(\"Argument \\\"\".concat(name, \"\\\" has invalid value \").concat(print(valueNode), \".\"), [argumentNode.value]);\n }\n\n coercedValues[name] = coercedValue;\n }\n }\n }\n\n return coercedValues;\n}\n/**\n * Prepares an object map of argument values given a directive definition\n * and a AST node which may contain directives. Optionally also accepts a map\n * of variable values.\n *\n * If the directive does not exist on the node, returns undefined.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n */\n\nexport function getDirectiveValues(directiveDef, node, variableValues) {\n var directiveNode = node.directives && find(node.directives, function (directive) {\n return directive.name.value === directiveDef.name;\n });\n\n if (directiveNode) {\n return getArgumentValues(directiveDef, directiveNode, variableValues);\n }\n}\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { validateSchema } from './type/validate';\nimport { parse } from './language/parser';\nimport { validate } from './validation/validate';\nimport { execute } from './execution/execute';\nexport function graphql(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver) {\n var _arguments = arguments;\n\n /* eslint-enable no-redeclare */\n // Always return a Promise for a consistent API.\n return new Promise(function (resolve) {\n return resolve( // Extract arguments from object args if provided.\n _arguments.length === 1 ? graphqlImpl(argsOrSchema.schema, argsOrSchema.source, argsOrSchema.rootValue, argsOrSchema.contextValue, argsOrSchema.variableValues, argsOrSchema.operationName, argsOrSchema.fieldResolver) : graphqlImpl(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver));\n });\n}\n/**\n * The graphqlSync function also fulfills GraphQL operations by parsing,\n * validating, and executing a GraphQL document along side a GraphQL schema.\n * However, it guarantees to complete synchronously (or throw an error) assuming\n * that all field resolvers are also synchronous.\n */\n\nexport function graphqlSync(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver) {\n /* eslint-enable no-redeclare */\n // Extract arguments from object args if provided.\n var result = arguments.length === 1 ? graphqlImpl(argsOrSchema.schema, argsOrSchema.source, argsOrSchema.rootValue, argsOrSchema.contextValue, argsOrSchema.variableValues, argsOrSchema.operationName, argsOrSchema.fieldResolver) : graphqlImpl(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver); // Assert that the execution was synchronous.\n\n if (result.then) {\n throw new Error('GraphQL execution failed to complete synchronously.');\n }\n\n return result;\n}\n\nfunction graphqlImpl(schema, source, rootValue, contextValue, variableValues, operationName, fieldResolver) {\n // Validate Schema\n var schemaValidationErrors = validateSchema(schema);\n\n if (schemaValidationErrors.length > 0) {\n return {\n errors: schemaValidationErrors\n };\n } // Parse\n\n\n var document;\n\n try {\n document = parse(source);\n } catch (syntaxError) {\n return {\n errors: [syntaxError]\n };\n } // Validate\n\n\n var validationErrors = validate(schema, document);\n\n if (validationErrors.length > 0) {\n return {\n errors: validationErrors\n };\n } // Execute\n\n\n return execute(schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver);\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nexport { // Predicate\nisSchema, // GraphQL Schema definition\nGraphQLSchema } from './schema';\nexport { // Predicates\nisType, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isListType, isNonNullType, isInputType, isOutputType, isLeafType, isCompositeType, isAbstractType, isWrappingType, isNullableType, isNamedType, isRequiredArgument, isRequiredInputField, // Assertions\nassertType, assertScalarType, assertObjectType, assertInterfaceType, assertUnionType, assertEnumType, assertInputObjectType, assertListType, assertNonNullType, assertInputType, assertOutputType, assertLeafType, assertCompositeType, assertAbstractType, assertWrappingType, assertNullableType, assertNamedType, // Un-modifiers\ngetNullableType, getNamedType, // Definitions\nGraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, // Type Wrappers\nGraphQLList, GraphQLNonNull } from './definition';\nexport { // Predicate\nisDirective, // Directives Definition\nGraphQLDirective, // Built-in Directives defined by the Spec\nisSpecifiedDirective, specifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, // Constant Deprecation Reason\nDEFAULT_DEPRECATION_REASON } from './directives';\n// Common built-in scalar instances.\nexport { isSpecifiedScalarType, specifiedScalarTypes, GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID } from './scalars';\nexport { // \"Enum\" of Type Kinds\nTypeKind, // GraphQL Types for introspection.\nisIntrospectionType, introspectionTypes, __Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind, // Meta-field definitions.\nSchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef } from './introspection';\nexport { validateSchema, assertValidSchema } from './validate';","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nexport { getLocation } from './location';\nexport { Kind } from './kinds';\nexport { createLexer, TokenKind } from './lexer';\nexport { parse, parseValue, parseType } from './parser';\nexport { print } from './printer';\nexport { Source } from './source';\nexport { visit, visitInParallel, visitWithTypeInfo, getVisitFn, BREAK } from './visitor';\nexport { isDefinitionNode, isExecutableDefinitionNode, isSelectionNode, isValueNode, isTypeNode, isTypeSystemDefinitionNode, isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode } from './predicates';\nexport { DirectiveLocation } from './directiveLocation';","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nexport { execute, defaultFieldResolver, responsePathAsArray } from './execute';\nexport { getDirectiveValues } from './values';","/**\n * Copyright (c) 2017-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { isAsyncIterable } from 'iterall';\nimport inspect from '../jsutils/inspect';\nimport { GraphQLError } from '../error/GraphQLError';\nimport { locatedError } from '../error/locatedError';\nimport { addPath, assertValidExecutionArguments, buildExecutionContext, buildResolveInfo, collectFields, execute, getFieldDef, resolveFieldValueOrError, responsePathAsArray } from '../execution/execute';\nimport mapAsyncIterator from './mapAsyncIterator';\nimport { getOperationRootType } from '../utilities/getOperationRootType';\n/**\n * Implements the \"Subscribe\" algorithm described in the GraphQL specification.\n *\n * Returns a Promise which resolves to either an AsyncIterator (if successful)\n * or an ExecutionResult (client error). The promise will be rejected if a\n * server error occurs.\n *\n * If the client-provided arguments to this function do not result in a\n * compliant subscription, a GraphQL Response (ExecutionResult) with\n * descriptive errors and no data will be returned.\n *\n * If the source stream could not be created due to faulty subscription\n * resolver logic or underlying systems, the promise will resolve to a single\n * ExecutionResult containing `errors` and no `data`.\n *\n * If the operation succeeded, the promise resolves to an AsyncIterator, which\n * yields a stream of ExecutionResults representing the response stream.\n *\n * Accepts either an object with named arguments, or individual arguments.\n */\n\nexport function subscribe(argsOrSchema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, subscribeFieldResolver) {\n /* eslint-enable no-redeclare */\n // Extract arguments from object args if provided.\n return arguments.length === 1 ? subscribeImpl(argsOrSchema.schema, argsOrSchema.document, argsOrSchema.rootValue, argsOrSchema.contextValue, argsOrSchema.variableValues, argsOrSchema.operationName, argsOrSchema.fieldResolver, argsOrSchema.subscribeFieldResolver) : subscribeImpl(argsOrSchema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, subscribeFieldResolver);\n}\n/**\n * This function checks if the error is a GraphQLError. If it is, report it as\n * an ExecutionResult, containing only errors and no data. Otherwise treat the\n * error as a system-class error and re-throw it.\n */\n\nfunction reportGraphQLError(error) {\n if (error instanceof GraphQLError) {\n return {\n errors: [error]\n };\n }\n\n throw error;\n}\n\nfunction subscribeImpl(schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, subscribeFieldResolver) {\n var sourcePromise = createSourceEventStream(schema, document, rootValue, contextValue, variableValues, operationName, subscribeFieldResolver); // For each payload yielded from a subscription, map it over the normal\n // GraphQL `execute` function, with `payload` as the rootValue.\n // This implements the \"MapSourceToResponseEvent\" algorithm described in\n // the GraphQL specification. The `execute` function provides the\n // \"ExecuteSubscriptionEvent\" algorithm, as it is nearly identical to the\n // \"ExecuteQuery\" algorithm, for which `execute` is also used.\n\n var mapSourceToResponse = function mapSourceToResponse(payload) {\n return execute(schema, document, payload, contextValue, variableValues, operationName, fieldResolver);\n }; // Resolve the Source Stream, then map every source value to a\n // ExecutionResult value as described above.\n\n\n return sourcePromise.then(function (resultOrStream) {\n return (// Note: Flow can't refine isAsyncIterable, so explicit casts are used.\n isAsyncIterable(resultOrStream) ? mapAsyncIterator(resultOrStream, mapSourceToResponse, reportGraphQLError) : resultOrStream\n );\n }, reportGraphQLError);\n}\n/**\n * Implements the \"CreateSourceEventStream\" algorithm described in the\n * GraphQL specification, resolving the subscription source event stream.\n *\n * Returns a Promise<AsyncIterable>.\n *\n * If the client-provided invalid arguments, the source stream could not be\n * created, or the resolver did not return an AsyncIterable, this function will\n * will throw an error, which should be caught and handled by the caller.\n *\n * A Source Event Stream represents a sequence of events, each of which triggers\n * a GraphQL execution for that event.\n *\n * This may be useful when hosting the stateful subscription service in a\n * different process or machine than the stateless GraphQL execution engine,\n * or otherwise separating these two steps. For more on this, see the\n * \"Supporting Subscriptions at Scale\" information in the GraphQL specification.\n */\n\n\nexport function createSourceEventStream(schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver) {\n // If arguments are missing or incorrectly typed, this is an internal\n // developer mistake which should throw an early error.\n assertValidExecutionArguments(schema, document, variableValues);\n\n try {\n // If a valid context cannot be created due to incorrect arguments,\n // this will throw an error.\n var exeContext = buildExecutionContext(schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver); // Return early errors if execution context failed.\n\n if (Array.isArray(exeContext)) {\n return Promise.resolve({\n errors: exeContext\n });\n }\n\n var type = getOperationRootType(schema, exeContext.operation);\n var fields = collectFields(exeContext, type, exeContext.operation.selectionSet, Object.create(null), Object.create(null));\n var responseNames = Object.keys(fields);\n var responseName = responseNames[0];\n var fieldNodes = fields[responseName];\n var fieldNode = fieldNodes[0];\n var fieldName = fieldNode.name.value;\n var fieldDef = getFieldDef(schema, type, fieldName);\n\n if (!fieldDef) {\n throw new GraphQLError(\"The subscription field \\\"\".concat(fieldName, \"\\\" is not defined.\"), fieldNodes);\n } // Call the `subscribe()` resolver or the default resolver to produce an\n // AsyncIterable yielding raw payloads.\n\n\n var resolveFn = fieldDef.subscribe || exeContext.fieldResolver;\n var path = addPath(undefined, responseName);\n var info = buildResolveInfo(exeContext, fieldDef, fieldNodes, type, path); // resolveFieldValueOrError implements the \"ResolveFieldEventStream\"\n // algorithm from GraphQL specification. It differs from\n // \"ResolveFieldValue\" due to providing a different `resolveFn`.\n\n var result = resolveFieldValueOrError(exeContext, fieldDef, fieldNodes, resolveFn, rootValue, info); // Coerce to Promise for easier error handling and consistent return type.\n\n return Promise.resolve(result).then(function (eventStream) {\n // If eventStream is an Error, rethrow a located error.\n if (eventStream instanceof Error) {\n throw locatedError(eventStream, fieldNodes, responsePathAsArray(path));\n } // Assert field returned an event stream, otherwise yield an error.\n\n\n if (isAsyncIterable(eventStream)) {\n // Note: isAsyncIterable above ensures this will be correct.\n return eventStream;\n }\n\n throw new Error('Subscription field must return Async Iterable. Received: ' + inspect(eventStream));\n });\n } catch (error) {\n return Promise.reject(error);\n }\n}","/**\n * Copyright (c) 2017-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nexport { subscribe, createSourceEventStream } from './subscribe';","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nexport { validate } from './validate';\nexport { ValidationContext } from './ValidationContext';\nexport { specifiedRules } from './specifiedRules'; // Spec Section: \"Field Selections on Objects, Interfaces, and Unions Types\"\n\nexport { FieldsOnCorrectType as FieldsOnCorrectTypeRule } from './rules/FieldsOnCorrectType'; // Spec Section: \"Fragments on Composite Types\"\n\nexport { FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule } from './rules/FragmentsOnCompositeTypes'; // Spec Section: \"Argument Names\"\n\nexport { KnownArgumentNames as KnownArgumentNamesRule } from './rules/KnownArgumentNames'; // Spec Section: \"Directives Are Defined\"\n\nexport { KnownDirectives as KnownDirectivesRule } from './rules/KnownDirectives'; // Spec Section: \"Fragment spread target defined\"\n\nexport { KnownFragmentNames as KnownFragmentNamesRule } from './rules/KnownFragmentNames'; // Spec Section: \"Fragment Spread Type Existence\"\n\nexport { KnownTypeNames as KnownTypeNamesRule } from './rules/KnownTypeNames'; // Spec Section: \"Lone Anonymous Operation\"\n\nexport { LoneAnonymousOperation as LoneAnonymousOperationRule } from './rules/LoneAnonymousOperation'; // Spec Section: \"Fragments must not form cycles\"\n\nexport { NoFragmentCycles as NoFragmentCyclesRule } from './rules/NoFragmentCycles'; // Spec Section: \"All Variable Used Defined\"\n\nexport { NoUndefinedVariables as NoUndefinedVariablesRule } from './rules/NoUndefinedVariables'; // Spec Section: \"Fragments must be used\"\n\nexport { NoUnusedFragments as NoUnusedFragmentsRule } from './rules/NoUnusedFragments'; // Spec Section: \"All Variables Used\"\n\nexport { NoUnusedVariables as NoUnusedVariablesRule } from './rules/NoUnusedVariables'; // Spec Section: \"Field Selection Merging\"\n\nexport { OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule } from './rules/OverlappingFieldsCanBeMerged'; // Spec Section: \"Fragment spread is possible\"\n\nexport { PossibleFragmentSpreads as PossibleFragmentSpreadsRule } from './rules/PossibleFragmentSpreads'; // Spec Section: \"Argument Optionality\"\n\nexport { ProvidedRequiredArguments as ProvidedRequiredArgumentsRule } from './rules/ProvidedRequiredArguments'; // Spec Section: \"Leaf Field Selections\"\n\nexport { ScalarLeafs as ScalarLeafsRule } from './rules/ScalarLeafs'; // Spec Section: \"Subscriptions with Single Root Field\"\n\nexport { SingleFieldSubscriptions as SingleFieldSubscriptionsRule } from './rules/SingleFieldSubscriptions'; // Spec Section: \"Argument Uniqueness\"\n\nexport { UniqueArgumentNames as UniqueArgumentNamesRule } from './rules/UniqueArgumentNames'; // Spec Section: \"Directives Are Unique Per Location\"\n\nexport { UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule } from './rules/UniqueDirectivesPerLocation'; // Spec Section: \"Fragment Name Uniqueness\"\n\nexport { UniqueFragmentNames as UniqueFragmentNamesRule } from './rules/UniqueFragmentNames'; // Spec Section: \"Input Object Field Uniqueness\"\n\nexport { UniqueInputFieldNames as UniqueInputFieldNamesRule } from './rules/UniqueInputFieldNames'; // Spec Section: \"Operation Name Uniqueness\"\n\nexport { UniqueOperationNames as UniqueOperationNamesRule } from './rules/UniqueOperationNames'; // Spec Section: \"Variable Uniqueness\"\n\nexport { UniqueVariableNames as UniqueVariableNamesRule } from './rules/UniqueVariableNames'; // Spec Section: \"Values Type Correctness\"\n\nexport { ValuesOfCorrectType as ValuesOfCorrectTypeRule } from './rules/ValuesOfCorrectType'; // Spec Section: \"Variables are Input Types\"\n\nexport { VariablesAreInputTypes as VariablesAreInputTypesRule } from './rules/VariablesAreInputTypes'; // Spec Section: \"All Variable Usages Are Allowed\"\n\nexport { VariablesInAllowedPosition as VariablesInAllowedPositionRule } from './rules/VariablesInAllowedPosition';","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nexport function getIntrospectionQuery(options) {\n var descriptions = !(options && options.descriptions === false);\n return \"\\n query IntrospectionQuery {\\n __schema {\\n queryType { name }\\n mutationType { name }\\n subscriptionType { name }\\n types {\\n ...FullType\\n }\\n directives {\\n name\\n \".concat(descriptions ? 'description' : '', \"\\n locations\\n args {\\n ...InputValue\\n }\\n }\\n }\\n }\\n\\n fragment FullType on __Type {\\n kind\\n name\\n \").concat(descriptions ? 'description' : '', \"\\n fields(includeDeprecated: true) {\\n name\\n \").concat(descriptions ? 'description' : '', \"\\n args {\\n ...InputValue\\n }\\n type {\\n ...TypeRef\\n }\\n isDeprecated\\n deprecationReason\\n }\\n inputFields {\\n ...InputValue\\n }\\n interfaces {\\n ...TypeRef\\n }\\n enumValues(includeDeprecated: true) {\\n name\\n \").concat(descriptions ? 'description' : '', \"\\n isDeprecated\\n deprecationReason\\n }\\n possibleTypes {\\n ...TypeRef\\n }\\n }\\n\\n fragment InputValue on __InputValue {\\n name\\n \").concat(descriptions ? 'description' : '', \"\\n type { ...TypeRef }\\n defaultValue\\n }\\n\\n fragment TypeRef on __Type {\\n kind\\n name\\n ofType {\\n kind\\n name\\n ofType {\\n kind\\n name\\n ofType {\\n kind\\n name\\n ofType {\\n kind\\n name\\n ofType {\\n kind\\n name\\n ofType {\\n kind\\n name\\n ofType {\\n kind\\n name\\n }\\n }\\n }\\n }\\n }\\n }\\n }\\n }\\n \");\n}\n/**\n * Deprecated, call getIntrospectionQuery directly.\n *\n * This function will be removed in v15\n */\n\nexport var introspectionQuery = getIntrospectionQuery();","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { Kind } from '../language/kinds';\n\n/**\n * Returns an operation AST given a document AST and optionally an operation\n * name. If a name is not provided, an operation is only returned if only one is\n * provided in the document.\n */\nexport function getOperationAST(documentAST, operationName) {\n var operation = null;\n\n for (var i = 0; i < documentAST.definitions.length; i++) {\n var definition = documentAST.definitions[i];\n\n if (definition.kind === Kind.OPERATION_DEFINITION) {\n if (!operationName) {\n // If no operation name was provided, only return an Operation if there\n // is one defined in the document. Upon encountering the second, return\n // null.\n if (operation) {\n return null;\n }\n\n operation = definition;\n } else if (definition.name && definition.name.value === operationName) {\n return definition;\n }\n }\n }\n\n return operation;\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport invariant from '../jsutils/invariant';\nimport { getIntrospectionQuery } from './introspectionQuery';\nimport { execute } from '../execution/execute';\nimport { parse } from '../language/parser';\n\n/**\n * Build an IntrospectionQuery from a GraphQLSchema\n *\n * IntrospectionQuery is useful for utilities that care about type and field\n * relationships, but do not need to traverse through those relationships.\n *\n * This is the inverse of buildClientSchema. The primary use case is outside\n * of the server context, for instance when doing schema comparisons.\n */\nexport function introspectionFromSchema(schema, options) {\n var queryAST = parse(getIntrospectionQuery(options));\n var result = execute(schema, queryAST);\n !(!result.then && !result.errors && result.data) ? invariant(0) : void 0;\n return result.data;\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport inspect from '../jsutils/inspect';\nimport invariant from '../jsutils/invariant';\nimport keyMap from '../jsutils/keyMap';\nimport keyValMap from '../jsutils/keyValMap';\nimport { valueFromAST } from './valueFromAST';\nimport { parseValue } from '../language/parser';\nimport { GraphQLSchema } from '../type/schema';\nimport { isInputType, isOutputType, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, GraphQLList, GraphQLNonNull, assertNullableType, assertObjectType, assertInterfaceType } from '../type/definition';\nimport { GraphQLDirective } from '../type/directives';\nimport { introspectionTypes, TypeKind } from '../type/introspection';\nimport { specifiedScalarTypes } from '../type/scalars';\n\n/**\n * Build a GraphQLSchema for use by client tools.\n *\n * Given the result of a client running the introspection query, creates and\n * returns a GraphQLSchema instance which can be then used with all graphql-js\n * tools, but cannot be used to execute a query, as introspection does not\n * represent the \"resolver\", \"parse\" or \"serialize\" functions or any other\n * server-internal mechanisms.\n *\n * This function expects a complete introspection result. Don't forget to check\n * the \"errors\" field of a server response before calling this function.\n */\nexport function buildClientSchema(introspection, options) {\n // Get the schema from the introspection result.\n var schemaIntrospection = introspection.__schema; // Converts the list of types into a keyMap based on the type names.\n\n var typeIntrospectionMap = keyMap(schemaIntrospection.types, function (type) {\n return type.name;\n }); // A cache to use to store the actual GraphQLType definition objects by name.\n // Initialize to the GraphQL built in scalars. All functions below are inline\n // so that this type def cache is within the scope of the closure.\n\n var typeDefCache = keyMap(specifiedScalarTypes.concat(introspectionTypes), function (type) {\n return type.name;\n }); // Given a type reference in introspection, return the GraphQLType instance.\n // preferring cached instances before building new instances.\n\n function getType(typeRef) {\n if (typeRef.kind === TypeKind.LIST) {\n var itemRef = typeRef.ofType;\n\n if (!itemRef) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n\n return GraphQLList(getType(itemRef));\n }\n\n if (typeRef.kind === TypeKind.NON_NULL) {\n var nullableRef = typeRef.ofType;\n\n if (!nullableRef) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n\n var nullableType = getType(nullableRef);\n return GraphQLNonNull(assertNullableType(nullableType));\n }\n\n if (!typeRef.name) {\n throw new Error('Unknown type reference: ' + inspect(typeRef));\n }\n\n return getNamedType(typeRef.name);\n }\n\n function getNamedType(typeName) {\n if (typeDefCache[typeName]) {\n return typeDefCache[typeName];\n }\n\n var typeIntrospection = typeIntrospectionMap[typeName];\n\n if (!typeIntrospection) {\n throw new Error(\"Invalid or incomplete schema, unknown type: \".concat(typeName, \". Ensure \") + 'that a full introspection query is used in order to build a ' + 'client schema.');\n }\n\n var typeDef = buildType(typeIntrospection);\n typeDefCache[typeName] = typeDef;\n return typeDef;\n }\n\n function getInputType(typeRef) {\n var type = getType(typeRef);\n !isInputType(type) ? invariant(0, 'Introspection must provide input type for arguments.') : void 0;\n return type;\n }\n\n function getOutputType(typeRef) {\n var type = getType(typeRef);\n !isOutputType(type) ? invariant(0, 'Introspection must provide output type for fields.') : void 0;\n return type;\n }\n\n function getObjectType(typeRef) {\n var type = getType(typeRef);\n return assertObjectType(type);\n }\n\n function getInterfaceType(typeRef) {\n var type = getType(typeRef);\n return assertInterfaceType(type);\n } // Given a type's introspection result, construct the correct\n // GraphQLType instance.\n\n\n function buildType(type) {\n if (type && type.name && type.kind) {\n switch (type.kind) {\n case TypeKind.SCALAR:\n return buildScalarDef(type);\n\n case TypeKind.OBJECT:\n return buildObjectDef(type);\n\n case TypeKind.INTERFACE:\n return buildInterfaceDef(type);\n\n case TypeKind.UNION:\n return buildUnionDef(type);\n\n case TypeKind.ENUM:\n return buildEnumDef(type);\n\n case TypeKind.INPUT_OBJECT:\n return buildInputObjectDef(type);\n }\n }\n\n throw new Error('Invalid or incomplete introspection result. Ensure that a full ' + 'introspection query is used in order to build a client schema:' + inspect(type));\n }\n\n function buildScalarDef(scalarIntrospection) {\n return new GraphQLScalarType({\n name: scalarIntrospection.name,\n description: scalarIntrospection.description,\n serialize: function serialize(value) {\n return value;\n }\n });\n }\n\n function buildObjectDef(objectIntrospection) {\n if (!objectIntrospection.interfaces) {\n throw new Error('Introspection result missing interfaces: ' + inspect(objectIntrospection));\n }\n\n return new GraphQLObjectType({\n name: objectIntrospection.name,\n description: objectIntrospection.description,\n interfaces: function interfaces() {\n return objectIntrospection.interfaces.map(getInterfaceType);\n },\n fields: function fields() {\n return buildFieldDefMap(objectIntrospection);\n }\n });\n }\n\n function buildInterfaceDef(interfaceIntrospection) {\n return new GraphQLInterfaceType({\n name: interfaceIntrospection.name,\n description: interfaceIntrospection.description,\n fields: function fields() {\n return buildFieldDefMap(interfaceIntrospection);\n }\n });\n }\n\n function buildUnionDef(unionIntrospection) {\n if (!unionIntrospection.possibleTypes) {\n throw new Error('Introspection result missing possibleTypes: ' + inspect(unionIntrospection));\n }\n\n return new GraphQLUnionType({\n name: unionIntrospection.name,\n description: unionIntrospection.description,\n types: function types() {\n return unionIntrospection.possibleTypes.map(getObjectType);\n }\n });\n }\n\n function buildEnumDef(enumIntrospection) {\n if (!enumIntrospection.enumValues) {\n throw new Error('Introspection result missing enumValues: ' + inspect(enumIntrospection));\n }\n\n return new GraphQLEnumType({\n name: enumIntrospection.name,\n description: enumIntrospection.description,\n values: keyValMap(enumIntrospection.enumValues, function (valueIntrospection) {\n return valueIntrospection.name;\n }, function (valueIntrospection) {\n return {\n description: valueIntrospection.description,\n deprecationReason: valueIntrospection.deprecationReason\n };\n })\n });\n }\n\n function buildInputObjectDef(inputObjectIntrospection) {\n if (!inputObjectIntrospection.inputFields) {\n throw new Error('Introspection result missing inputFields: ' + inspect(inputObjectIntrospection));\n }\n\n return new GraphQLInputObjectType({\n name: inputObjectIntrospection.name,\n description: inputObjectIntrospection.description,\n fields: function fields() {\n return buildInputValueDefMap(inputObjectIntrospection.inputFields);\n }\n });\n }\n\n function buildFieldDefMap(typeIntrospection) {\n if (!typeIntrospection.fields) {\n throw new Error('Introspection result missing fields: ' + inspect(typeIntrospection));\n }\n\n return keyValMap(typeIntrospection.fields, function (fieldIntrospection) {\n return fieldIntrospection.name;\n }, function (fieldIntrospection) {\n if (!fieldIntrospection.args) {\n throw new Error('Introspection result missing field args: ' + inspect(fieldIntrospection));\n }\n\n return {\n description: fieldIntrospection.description,\n deprecationReason: fieldIntrospection.deprecationReason,\n type: getOutputType(fieldIntrospection.type),\n args: buildInputValueDefMap(fieldIntrospection.args)\n };\n });\n }\n\n function buildInputValueDefMap(inputValueIntrospections) {\n return keyValMap(inputValueIntrospections, function (inputValue) {\n return inputValue.name;\n }, buildInputValue);\n }\n\n function buildInputValue(inputValueIntrospection) {\n var type = getInputType(inputValueIntrospection.type);\n var defaultValue = inputValueIntrospection.defaultValue ? valueFromAST(parseValue(inputValueIntrospection.defaultValue), type) : undefined;\n return {\n description: inputValueIntrospection.description,\n type: type,\n defaultValue: defaultValue\n };\n }\n\n function buildDirective(directiveIntrospection) {\n if (!directiveIntrospection.args) {\n throw new Error('Introspection result missing directive args: ' + inspect(directiveIntrospection));\n }\n\n if (!directiveIntrospection.locations) {\n throw new Error('Introspection result missing directive locations: ' + inspect(directiveIntrospection));\n }\n\n return new GraphQLDirective({\n name: directiveIntrospection.name,\n description: directiveIntrospection.description,\n locations: directiveIntrospection.locations.slice(),\n args: buildInputValueDefMap(directiveIntrospection.args)\n });\n } // Iterate through all types, getting the type definition for each, ensuring\n // that any type not directly referenced by a field will get created.\n\n\n var types = schemaIntrospection.types.map(function (typeIntrospection) {\n return getNamedType(typeIntrospection.name);\n }); // Get the root Query, Mutation, and Subscription types.\n\n var queryType = schemaIntrospection.queryType ? getObjectType(schemaIntrospection.queryType) : null;\n var mutationType = schemaIntrospection.mutationType ? getObjectType(schemaIntrospection.mutationType) : null;\n var subscriptionType = schemaIntrospection.subscriptionType ? getObjectType(schemaIntrospection.subscriptionType) : null; // Get the directives supported by Introspection, assuming empty-set if\n // directives were not queried for.\n\n var directives = schemaIntrospection.directives ? schemaIntrospection.directives.map(buildDirective) : []; // Then produce and return a Schema with these types.\n\n return new GraphQLSchema({\n query: queryType,\n mutation: mutationType,\n subscription: subscriptionType,\n types: types,\n directives: directives,\n assumeValid: options && options.assumeValid,\n allowedLegacyNames: options && options.allowedLegacyNames\n });\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport isNullish from '../jsutils/isNullish';\nimport isInvalid from '../jsutils/isInvalid';\nimport objectValues from '../jsutils/objectValues';\nimport { astFromValue } from '../utilities/astFromValue';\nimport { print } from '../language/printer';\nimport { isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType } from '../type/definition';\nimport { GraphQLString, isSpecifiedScalarType } from '../type/scalars';\nimport { GraphQLDirective, DEFAULT_DEPRECATION_REASON, isSpecifiedDirective } from '../type/directives';\nimport { isIntrospectionType } from '../type/introspection';\n\n/**\n * Accepts options as a second argument:\n *\n * - commentDescriptions:\n * Provide true to use preceding comments as the description.\n *\n */\nexport function printSchema(schema, options) {\n return printFilteredSchema(schema, function (n) {\n return !isSpecifiedDirective(n);\n }, isDefinedType, options);\n}\nexport function printIntrospectionSchema(schema, options) {\n return printFilteredSchema(schema, isSpecifiedDirective, isIntrospectionType, options);\n}\n\nfunction isDefinedType(type) {\n return !isSpecifiedScalarType(type) && !isIntrospectionType(type);\n}\n\nfunction printFilteredSchema(schema, directiveFilter, typeFilter, options) {\n var directives = schema.getDirectives().filter(directiveFilter);\n var typeMap = schema.getTypeMap();\n var types = objectValues(typeMap).sort(function (type1, type2) {\n return type1.name.localeCompare(type2.name);\n }).filter(typeFilter);\n return [printSchemaDefinition(schema)].concat(directives.map(function (directive) {\n return printDirective(directive, options);\n }), types.map(function (type) {\n return printType(type, options);\n })).filter(Boolean).join('\\n\\n') + '\\n';\n}\n\nfunction printSchemaDefinition(schema) {\n if (isSchemaOfCommonNames(schema)) {\n return;\n }\n\n var operationTypes = [];\n var queryType = schema.getQueryType();\n\n if (queryType) {\n operationTypes.push(\" query: \".concat(queryType.name));\n }\n\n var mutationType = schema.getMutationType();\n\n if (mutationType) {\n operationTypes.push(\" mutation: \".concat(mutationType.name));\n }\n\n var subscriptionType = schema.getSubscriptionType();\n\n if (subscriptionType) {\n operationTypes.push(\" subscription: \".concat(subscriptionType.name));\n }\n\n return \"schema {\\n\".concat(operationTypes.join('\\n'), \"\\n}\");\n}\n/**\n * GraphQL schema define root types for each type of operation. These types are\n * the same as any other type and can be named in any manner, however there is\n * a common naming convention:\n *\n * schema {\n * query: Query\n * mutation: Mutation\n * }\n *\n * When using this naming convention, the schema description can be omitted.\n */\n\n\nfunction isSchemaOfCommonNames(schema) {\n var queryType = schema.getQueryType();\n\n if (queryType && queryType.name !== 'Query') {\n return false;\n }\n\n var mutationType = schema.getMutationType();\n\n if (mutationType && mutationType.name !== 'Mutation') {\n return false;\n }\n\n var subscriptionType = schema.getSubscriptionType();\n\n if (subscriptionType && subscriptionType.name !== 'Subscription') {\n return false;\n }\n\n return true;\n}\n\nexport function printType(type, options) {\n if (isScalarType(type)) {\n return printScalar(type, options);\n } else if (isObjectType(type)) {\n return printObject(type, options);\n } else if (isInterfaceType(type)) {\n return printInterface(type, options);\n } else if (isUnionType(type)) {\n return printUnion(type, options);\n } else if (isEnumType(type)) {\n return printEnum(type, options);\n } else if (isInputObjectType(type)) {\n return printInputObject(type, options);\n }\n /* istanbul ignore next */\n\n\n throw new Error(\"Unknown type: \".concat(type, \".\"));\n}\n\nfunction printScalar(type, options) {\n return printDescription(options, type) + \"scalar \".concat(type.name);\n}\n\nfunction printObject(type, options) {\n var interfaces = type.getInterfaces();\n var implementedInterfaces = interfaces.length ? ' implements ' + interfaces.map(function (i) {\n return i.name;\n }).join(' & ') : '';\n return printDescription(options, type) + \"type \".concat(type.name).concat(implementedInterfaces, \" {\\n\") + printFields(options, type) + '\\n' + '}';\n}\n\nfunction printInterface(type, options) {\n return printDescription(options, type) + \"interface \".concat(type.name, \" {\\n\") + printFields(options, type) + '\\n' + '}';\n}\n\nfunction printUnion(type, options) {\n return printDescription(options, type) + \"union \".concat(type.name, \" = \").concat(type.getTypes().join(' | '));\n}\n\nfunction printEnum(type, options) {\n return printDescription(options, type) + \"enum \".concat(type.name, \" {\\n\") + printEnumValues(type.getValues(), options) + '\\n' + '}';\n}\n\nfunction printEnumValues(values, options) {\n return values.map(function (value, i) {\n return printDescription(options, value, ' ', !i) + ' ' + value.name + printDeprecated(value);\n }).join('\\n');\n}\n\nfunction printInputObject(type, options) {\n var fields = objectValues(type.getFields());\n return printDescription(options, type) + \"input \".concat(type.name, \" {\\n\") + fields.map(function (f, i) {\n return printDescription(options, f, ' ', !i) + ' ' + printInputValue(f);\n }).join('\\n') + '\\n' + '}';\n}\n\nfunction printFields(options, type) {\n var fields = objectValues(type.getFields());\n return fields.map(function (f, i) {\n return printDescription(options, f, ' ', !i) + ' ' + f.name + printArgs(options, f.args, ' ') + ': ' + String(f.type) + printDeprecated(f);\n }).join('\\n');\n}\n\nfunction printArgs(options, args) {\n var indentation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n\n if (args.length === 0) {\n return '';\n } // If every arg does not have a description, print them on one line.\n\n\n if (args.every(function (arg) {\n return !arg.description;\n })) {\n return '(' + args.map(printInputValue).join(', ') + ')';\n }\n\n return '(\\n' + args.map(function (arg, i) {\n return printDescription(options, arg, ' ' + indentation, !i) + ' ' + indentation + printInputValue(arg);\n }).join('\\n') + '\\n' + indentation + ')';\n}\n\nfunction printInputValue(arg) {\n var argDecl = arg.name + ': ' + String(arg.type);\n\n if (!isInvalid(arg.defaultValue)) {\n argDecl += \" = \".concat(print(astFromValue(arg.defaultValue, arg.type)));\n }\n\n return argDecl;\n}\n\nfunction printDirective(directive, options) {\n return printDescription(options, directive) + 'directive @' + directive.name + printArgs(options, directive.args) + ' on ' + directive.locations.join(' | ');\n}\n\nfunction printDeprecated(fieldOrEnumVal) {\n if (!fieldOrEnumVal.isDeprecated) {\n return '';\n }\n\n var reason = fieldOrEnumVal.deprecationReason;\n\n if (isNullish(reason) || reason === '' || reason === DEFAULT_DEPRECATION_REASON) {\n return ' @deprecated';\n }\n\n return ' @deprecated(reason: ' + print(astFromValue(reason, GraphQLString)) + ')';\n}\n\nfunction printDescription(options, def) {\n var indentation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n var firstInBlock = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n\n if (!def.description) {\n return '';\n }\n\n var lines = descriptionLines(def.description, 120 - indentation.length);\n\n if (options && options.commentDescriptions) {\n return printDescriptionWithComments(lines, indentation, firstInBlock);\n }\n\n var description = indentation && !firstInBlock ? '\\n' + indentation + '\"\"\"' : indentation + '\"\"\"'; // In some circumstances, a single line can be used for the description.\n\n if (lines.length === 1 && lines[0].length < 70 && lines[0][lines[0].length - 1] !== '\"') {\n return description + escapeQuote(lines[0]) + '\"\"\"\\n';\n } // Format a multi-line block quote to account for leading space.\n\n\n var hasLeadingSpace = lines[0][0] === ' ' || lines[0][0] === '\\t';\n\n if (!hasLeadingSpace) {\n description += '\\n';\n }\n\n for (var i = 0; i < lines.length; i++) {\n if (i !== 0 || !hasLeadingSpace) {\n description += indentation;\n }\n\n description += escapeQuote(lines[i]) + '\\n';\n }\n\n description += indentation + '\"\"\"\\n';\n return description;\n}\n\nfunction escapeQuote(line) {\n return line.replace(/\"\"\"/g, '\\\\\"\"\"');\n}\n\nfunction printDescriptionWithComments(lines, indentation, firstInBlock) {\n var description = indentation && !firstInBlock ? '\\n' : '';\n\n for (var i = 0; i < lines.length; i++) {\n if (lines[i] === '') {\n description += indentation + '#\\n';\n } else {\n description += indentation + '# ' + lines[i] + '\\n';\n }\n }\n\n return description;\n}\n\nfunction descriptionLines(description, maxLen) {\n var lines = [];\n var rawLines = description.split('\\n');\n\n for (var i = 0; i < rawLines.length; i++) {\n if (rawLines[i] === '') {\n lines.push(rawLines[i]);\n } else {\n // For > 120 character long lines, cut at space boundaries into sublines\n // of ~80 chars.\n var sublines = breakLine(rawLines[i], maxLen);\n\n for (var j = 0; j < sublines.length; j++) {\n lines.push(sublines[j]);\n }\n }\n }\n\n return lines;\n}\n\nfunction breakLine(line, maxLen) {\n if (line.length < maxLen + 5) {\n return [line];\n }\n\n var parts = line.split(new RegExp(\"((?: |^).{15,\".concat(maxLen - 40, \"}(?= |$))\")));\n\n if (parts.length < 4) {\n return [line];\n }\n\n var sublines = [parts[0] + parts[1] + parts[2]];\n\n for (var i = 3; i < parts.length; i += 2) {\n sublines.push(parts[i].slice(1) + parts[i + 1]);\n }\n\n return sublines;\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { coerceValue } from './coerceValue';\n\n/**\n * Deprecated. Use coerceValue() directly for richer information.\n *\n * This function will be removed in v15\n */\nexport function isValidJSValue(value, type) {\n var errors = coerceValue(value, type).errors;\n return errors ? errors.map(function (error) {\n return error.message;\n }) : [];\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { TypeInfo } from './TypeInfo';\nimport { Kind } from '../language/kinds';\nimport { visit, visitWithTypeInfo } from '../language/visitor';\nimport { GraphQLSchema } from '../type/schema';\nimport { ValuesOfCorrectType } from '../validation/rules/ValuesOfCorrectType';\nimport { ValidationContext } from '../validation/ValidationContext';\n/**\n * Utility which determines if a value literal node is valid for an input type.\n *\n * Deprecated. Rely on validation for documents containing literal values.\n *\n * This function will be removed in v15\n */\n\nexport function isValidLiteralValue(type, valueNode) {\n var emptySchema = new GraphQLSchema({});\n var emptyDoc = {\n kind: Kind.DOCUMENT,\n definitions: []\n };\n var typeInfo = new TypeInfo(emptySchema, undefined, type);\n var context = new ValidationContext(emptySchema, emptyDoc, typeInfo);\n var visitor = ValuesOfCorrectType(context);\n visit(valueNode, visitWithTypeInfo(typeInfo, visitor));\n return context.getErrors();\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/**\n * Provided a collection of ASTs, presumably each from different files,\n * concatenate the ASTs together into batched AST, useful for validating many\n * GraphQL source files which together represent one conceptual application.\n */\nexport function concatAST(asts) {\n var batchDefinitions = [];\n\n for (var i = 0; i < asts.length; i++) {\n var definitions = asts[i].definitions;\n\n for (var j = 0; j < definitions.length; j++) {\n batchDefinitions.push(definitions[j]);\n }\n }\n\n return {\n kind: 'Document',\n definitions: batchDefinitions\n };\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { visit } from '../language/visitor';\n\n/**\n * separateOperations accepts a single AST document which may contain many\n * operations and fragments and returns a collection of AST documents each of\n * which contains a single operation as well the fragment definitions it\n * refers to.\n */\nexport function separateOperations(documentAST) {\n var operations = [];\n var fragments = Object.create(null);\n var positions = new Map();\n var depGraph = Object.create(null);\n var fromName;\n var idx = 0; // Populate metadata and build a dependency graph.\n\n visit(documentAST, {\n OperationDefinition: function OperationDefinition(node) {\n fromName = opName(node);\n operations.push(node);\n positions.set(node, idx++);\n },\n FragmentDefinition: function FragmentDefinition(node) {\n fromName = node.name.value;\n fragments[fromName] = node;\n positions.set(node, idx++);\n },\n FragmentSpread: function FragmentSpread(node) {\n var toName = node.name.value;\n (depGraph[fromName] || (depGraph[fromName] = Object.create(null)))[toName] = true;\n }\n }); // For each operation, produce a new synthesized AST which includes only what\n // is necessary for completing that operation.\n\n var separatedDocumentASTs = Object.create(null);\n\n for (var _i = 0; _i < operations.length; _i++) {\n var operation = operations[_i];\n var operationName = opName(operation);\n var dependencies = Object.create(null);\n collectTransitiveDependencies(dependencies, depGraph, operationName); // The list of definition nodes to be included for this operation, sorted\n // to retain the same order as the original document.\n\n var definitions = [operation];\n\n var _arr = Object.keys(dependencies);\n\n for (var _i2 = 0; _i2 < _arr.length; _i2++) {\n var name = _arr[_i2];\n definitions.push(fragments[name]);\n }\n\n definitions.sort(function (n1, n2) {\n return (positions.get(n1) || 0) - (positions.get(n2) || 0);\n });\n separatedDocumentASTs[operationName] = {\n kind: 'Document',\n definitions: definitions\n };\n }\n\n return separatedDocumentASTs;\n}\n\n// Provides the empty string for anonymous operations.\nfunction opName(operation) {\n return operation.name ? operation.name.value : '';\n} // From a dependency graph, collects a list of transitive dependencies by\n// recursing through a dependency graph.\n\n\nfunction collectTransitiveDependencies(collected, depGraph, fromName) {\n var immediateDeps = depGraph[fromName];\n\n if (immediateDeps) {\n var _arr2 = Object.keys(immediateDeps);\n\n for (var _i3 = 0; _i3 < _arr2.length; _i3++) {\n var toName = _arr2[_i3];\n\n if (!collected[toName]) {\n collected[toName] = true;\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n }\n }\n}","/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isNonNullType, isListType, isNamedType, isRequiredArgument, isRequiredInputField } from '../type/definition';\nimport keyMap from '../jsutils/keyMap';\nexport var BreakingChangeType = {\n FIELD_CHANGED_KIND: 'FIELD_CHANGED_KIND',\n FIELD_REMOVED: 'FIELD_REMOVED',\n TYPE_CHANGED_KIND: 'TYPE_CHANGED_KIND',\n TYPE_REMOVED: 'TYPE_REMOVED',\n TYPE_REMOVED_FROM_UNION: 'TYPE_REMOVED_FROM_UNION',\n VALUE_REMOVED_FROM_ENUM: 'VALUE_REMOVED_FROM_ENUM',\n ARG_REMOVED: 'ARG_REMOVED',\n ARG_CHANGED_KIND: 'ARG_CHANGED_KIND',\n REQUIRED_ARG_ADDED: 'REQUIRED_ARG_ADDED',\n REQUIRED_INPUT_FIELD_ADDED: 'REQUIRED_INPUT_FIELD_ADDED',\n INTERFACE_REMOVED_FROM_OBJECT: 'INTERFACE_REMOVED_FROM_OBJECT',\n DIRECTIVE_REMOVED: 'DIRECTIVE_REMOVED',\n DIRECTIVE_ARG_REMOVED: 'DIRECTIVE_ARG_REMOVED',\n DIRECTIVE_LOCATION_REMOVED: 'DIRECTIVE_LOCATION_REMOVED',\n REQUIRED_DIRECTIVE_ARG_ADDED: 'REQUIRED_DIRECTIVE_ARG_ADDED'\n};\nexport var DangerousChangeType = {\n ARG_DEFAULT_VALUE_CHANGE: 'ARG_DEFAULT_VALUE_CHANGE',\n VALUE_ADDED_TO_ENUM: 'VALUE_ADDED_TO_ENUM',\n INTERFACE_ADDED_TO_OBJECT: 'INTERFACE_ADDED_TO_OBJECT',\n TYPE_ADDED_TO_UNION: 'TYPE_ADDED_TO_UNION',\n OPTIONAL_INPUT_FIELD_ADDED: 'OPTIONAL_INPUT_FIELD_ADDED',\n OPTIONAL_ARG_ADDED: 'OPTIONAL_ARG_ADDED'\n};\n\n/**\n * Given two schemas, returns an Array containing descriptions of all the types\n * of breaking changes covered by the other functions down below.\n */\nexport function findBreakingChanges(oldSchema, newSchema) {\n return findRemovedTypes(oldSchema, newSchema).concat(findTypesThatChangedKind(oldSchema, newSchema), findFieldsThatChangedTypeOnObjectOrInterfaceTypes(oldSchema, newSchema), findFieldsThatChangedTypeOnInputObjectTypes(oldSchema, newSchema).breakingChanges, findTypesRemovedFromUnions(oldSchema, newSchema), findValuesRemovedFromEnums(oldSchema, newSchema), findArgChanges(oldSchema, newSchema).breakingChanges, findInterfacesRemovedFromObjectTypes(oldSchema, newSchema), findRemovedDirectives(oldSchema, newSchema), findRemovedDirectiveArgs(oldSchema, newSchema), findAddedNonNullDirectiveArgs(oldSchema, newSchema), findRemovedDirectiveLocations(oldSchema, newSchema));\n}\n/**\n * Given two schemas, returns an Array containing descriptions of all the types\n * of potentially dangerous changes covered by the other functions down below.\n */\n\nexport function findDangerousChanges(oldSchema, newSchema) {\n return findArgChanges(oldSchema, newSchema).dangerousChanges.concat(findValuesAddedToEnums(oldSchema, newSchema), findInterfacesAddedToObjectTypes(oldSchema, newSchema), findTypesAddedToUnions(oldSchema, newSchema), findFieldsThatChangedTypeOnInputObjectTypes(oldSchema, newSchema).dangerousChanges);\n}\n/**\n * Given two schemas, returns an Array containing descriptions of any breaking\n * changes in the newSchema related to removing an entire type.\n */\n\nexport function findRemovedTypes(oldSchema, newSchema) {\n var oldTypeMap = oldSchema.getTypeMap();\n var newTypeMap = newSchema.getTypeMap();\n var breakingChanges = [];\n\n var _arr = Object.keys(oldTypeMap);\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var typeName = _arr[_i];\n\n if (!newTypeMap[typeName]) {\n breakingChanges.push({\n type: BreakingChangeType.TYPE_REMOVED,\n description: \"\".concat(typeName, \" was removed.\")\n });\n }\n }\n\n return breakingChanges;\n}\n/**\n * Given two schemas, returns an Array containing descriptions of any breaking\n * changes in the newSchema related to changing the type of a type.\n */\n\nexport function findTypesThatChangedKind(oldSchema, newSchema) {\n var oldTypeMap = oldSchema.getTypeMap();\n var newTypeMap = newSchema.getTypeMap();\n var breakingChanges = [];\n\n var _arr2 = Object.keys(oldTypeMap);\n\n for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n var typeName = _arr2[_i2];\n\n if (!newTypeMap[typeName]) {\n continue;\n }\n\n var oldType = oldTypeMap[typeName];\n var newType = newTypeMap[typeName];\n\n if (oldType.constructor !== newType.constructor) {\n breakingChanges.push({\n type: BreakingChangeType.TYPE_CHANGED_KIND,\n description: \"\".concat(typeName, \" changed from \") + \"\".concat(typeKindName(oldType), \" to \").concat(typeKindName(newType), \".\")\n });\n }\n }\n\n return breakingChanges;\n}\n/**\n * Given two schemas, returns an Array containing descriptions of any\n * breaking or dangerous changes in the newSchema related to arguments\n * (such as removal or change of type of an argument, or a change in an\n * argument's default value).\n */\n\nexport function findArgChanges(oldSchema, newSchema) {\n var oldTypeMap = oldSchema.getTypeMap();\n var newTypeMap = newSchema.getTypeMap();\n var breakingChanges = [];\n var dangerousChanges = [];\n\n var _arr3 = Object.keys(oldTypeMap);\n\n for (var _i3 = 0; _i3 < _arr3.length; _i3++) {\n var typeName = _arr3[_i3];\n var oldType = oldTypeMap[typeName];\n var newType = newTypeMap[typeName];\n\n if (!(isObjectType(oldType) || isInterfaceType(oldType)) || !(isObjectType(newType) || isInterfaceType(newType)) || newType.constructor !== oldType.constructor) {\n continue;\n }\n\n var oldTypeFields = oldType.getFields();\n var newTypeFields = newType.getFields();\n\n var _arr4 = Object.keys(oldTypeFields);\n\n for (var _i4 = 0; _i4 < _arr4.length; _i4++) {\n var fieldName = _arr4[_i4];\n\n if (!newTypeFields[fieldName]) {\n continue;\n }\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n var _loop = function _loop() {\n var oldArgDef = _step.value;\n var newArgs = newTypeFields[fieldName].args;\n var newArgDef = newArgs.find(function (arg) {\n return arg.name === oldArgDef.name;\n }); // Arg not present\n\n if (!newArgDef) {\n breakingChanges.push({\n type: BreakingChangeType.ARG_REMOVED,\n description: \"\".concat(oldType.name, \".\").concat(fieldName, \" arg \") + \"\".concat(oldArgDef.name, \" was removed\")\n });\n } else {\n var isSafe = isChangeSafeForInputObjectFieldOrFieldArg(oldArgDef.type, newArgDef.type);\n\n if (!isSafe) {\n breakingChanges.push({\n type: BreakingChangeType.ARG_CHANGED_KIND,\n description: \"\".concat(oldType.name, \".\").concat(fieldName, \" arg \") + \"\".concat(oldArgDef.name, \" has changed type from \") + \"\".concat(oldArgDef.type.toString(), \" to \").concat(newArgDef.type.toString())\n });\n } else if (oldArgDef.defaultValue !== undefined && oldArgDef.defaultValue !== newArgDef.defaultValue) {\n dangerousChanges.push({\n type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,\n description: \"\".concat(oldType.name, \".\").concat(fieldName, \" arg \") + \"\".concat(oldArgDef.name, \" has changed defaultValue\")\n });\n }\n }\n };\n\n for (var _iterator = oldTypeFields[fieldName].args[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n _loop();\n } // Check if arg was added to the field\n\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n var _loop2 = function _loop2() {\n var newArgDef = _step2.value;\n var oldArgs = oldTypeFields[fieldName].args;\n var oldArgDef = oldArgs.find(function (arg) {\n return arg.name === newArgDef.name;\n });\n\n if (!oldArgDef) {\n var argName = newArgDef.name;\n\n if (isRequiredArgument(newArgDef)) {\n breakingChanges.push({\n type: BreakingChangeType.REQUIRED_ARG_ADDED,\n description: \"A required arg \".concat(argName, \" on \") + \"\".concat(typeName, \".\").concat(fieldName, \" was added\")\n });\n } else {\n dangerousChanges.push({\n type: DangerousChangeType.OPTIONAL_ARG_ADDED,\n description: \"An optional arg \".concat(argName, \" on \") + \"\".concat(typeName, \".\").concat(fieldName, \" was added\")\n });\n }\n }\n };\n\n for (var _iterator2 = newTypeFields[fieldName].args[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n _loop2();\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n }\n\n return {\n breakingChanges: breakingChanges,\n dangerousChanges: dangerousChanges\n };\n}\n\nfunction typeKindName(type) {\n if (isScalarType(type)) {\n return 'a Scalar type';\n }\n\n if (isObjectType(type)) {\n return 'an Object type';\n }\n\n if (isInterfaceType(type)) {\n return 'an Interface type';\n }\n\n if (isUnionType(type)) {\n return 'a Union type';\n }\n\n if (isEnumType(type)) {\n return 'an Enum type';\n }\n\n if (isInputObjectType(type)) {\n return 'an Input type';\n }\n\n throw new TypeError('Unknown type ' + type.constructor.name);\n}\n\nexport function findFieldsThatChangedTypeOnObjectOrInterfaceTypes(oldSchema, newSchema) {\n var oldTypeMap = oldSchema.getTypeMap();\n var newTypeMap = newSchema.getTypeMap();\n var breakingChanges = [];\n\n var _arr5 = Object.keys(oldTypeMap);\n\n for (var _i5 = 0; _i5 < _arr5.length; _i5++) {\n var typeName = _arr5[_i5];\n var oldType = oldTypeMap[typeName];\n var newType = newTypeMap[typeName];\n\n if (!(isObjectType(oldType) || isInterfaceType(oldType)) || !(isObjectType(newType) || isInterfaceType(newType)) || newType.constructor !== oldType.constructor) {\n continue;\n }\n\n var oldTypeFieldsDef = oldType.getFields();\n var newTypeFieldsDef = newType.getFields();\n\n var _arr6 = Object.keys(oldTypeFieldsDef);\n\n for (var _i6 = 0; _i6 < _arr6.length; _i6++) {\n var fieldName = _arr6[_i6];\n\n // Check if the field is missing on the type in the new schema.\n if (!(fieldName in newTypeFieldsDef)) {\n breakingChanges.push({\n type: BreakingChangeType.FIELD_REMOVED,\n description: \"\".concat(typeName, \".\").concat(fieldName, \" was removed.\")\n });\n } else {\n var oldFieldType = oldTypeFieldsDef[fieldName].type;\n var newFieldType = newTypeFieldsDef[fieldName].type;\n var isSafe = isChangeSafeForObjectOrInterfaceField(oldFieldType, newFieldType);\n\n if (!isSafe) {\n var oldFieldTypeString = isNamedType(oldFieldType) ? oldFieldType.name : oldFieldType.toString();\n var newFieldTypeString = isNamedType(newFieldType) ? newFieldType.name : newFieldType.toString();\n breakingChanges.push({\n type: BreakingChangeType.FIELD_CHANGED_KIND,\n description: \"\".concat(typeName, \".\").concat(fieldName, \" changed type from \") + \"\".concat(oldFieldTypeString, \" to \").concat(newFieldTypeString, \".\")\n });\n }\n }\n }\n }\n\n return breakingChanges;\n}\nexport function findFieldsThatChangedTypeOnInputObjectTypes(oldSchema, newSchema) {\n var oldTypeMap = oldSchema.getTypeMap();\n var newTypeMap = newSchema.getTypeMap();\n var breakingChanges = [];\n var dangerousChanges = [];\n\n var _arr7 = Object.keys(oldTypeMap);\n\n for (var _i7 = 0; _i7 < _arr7.length; _i7++) {\n var typeName = _arr7[_i7];\n var oldType = oldTypeMap[typeName];\n var newType = newTypeMap[typeName];\n\n if (!isInputObjectType(oldType) || !isInputObjectType(newType)) {\n continue;\n }\n\n var oldTypeFieldsDef = oldType.getFields();\n var newTypeFieldsDef = newType.getFields();\n\n var _arr8 = Object.keys(oldTypeFieldsDef);\n\n for (var _i8 = 0; _i8 < _arr8.length; _i8++) {\n var fieldName = _arr8[_i8];\n\n // Check if the field is missing on the type in the new schema.\n if (!(fieldName in newTypeFieldsDef)) {\n breakingChanges.push({\n type: BreakingChangeType.FIELD_REMOVED,\n description: \"\".concat(typeName, \".\").concat(fieldName, \" was removed.\")\n });\n } else {\n var oldFieldType = oldTypeFieldsDef[fieldName].type;\n var newFieldType = newTypeFieldsDef[fieldName].type;\n var isSafe = isChangeSafeForInputObjectFieldOrFieldArg(oldFieldType, newFieldType);\n\n if (!isSafe) {\n var oldFieldTypeString = isNamedType(oldFieldType) ? oldFieldType.name : oldFieldType.toString();\n var newFieldTypeString = isNamedType(newFieldType) ? newFieldType.name : newFieldType.toString();\n breakingChanges.push({\n type: BreakingChangeType.FIELD_CHANGED_KIND,\n description: \"\".concat(typeName, \".\").concat(fieldName, \" changed type from \") + \"\".concat(oldFieldTypeString, \" to \").concat(newFieldTypeString, \".\")\n });\n }\n }\n } // Check if a field was added to the input object type\n\n\n var _arr9 = Object.keys(newTypeFieldsDef);\n\n for (var _i9 = 0; _i9 < _arr9.length; _i9++) {\n var _fieldName = _arr9[_i9];\n\n if (!(_fieldName in oldTypeFieldsDef)) {\n if (isRequiredInputField(newTypeFieldsDef[_fieldName])) {\n breakingChanges.push({\n type: BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED,\n description: \"A required field \".concat(_fieldName, \" on \") + \"input type \".concat(typeName, \" was added.\")\n });\n } else {\n dangerousChanges.push({\n type: DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED,\n description: \"An optional field \".concat(_fieldName, \" on \") + \"input type \".concat(typeName, \" was added.\")\n });\n }\n }\n }\n }\n\n return {\n breakingChanges: breakingChanges,\n dangerousChanges: dangerousChanges\n };\n}\n\nfunction isChangeSafeForObjectOrInterfaceField(oldType, newType) {\n if (isNamedType(oldType)) {\n return (// if they're both named types, see if their names are equivalent\n isNamedType(newType) && oldType.name === newType.name || // moving from nullable to non-null of the same underlying type is safe\n isNonNullType(newType) && isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType)\n );\n } else if (isListType(oldType)) {\n return (// if they're both lists, make sure the underlying types are compatible\n isListType(newType) && isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType) || // moving from nullable to non-null of the same underlying type is safe\n isNonNullType(newType) && isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType)\n );\n } else if (isNonNullType(oldType)) {\n // if they're both non-null, make sure the underlying types are compatible\n return isNonNullType(newType) && isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType);\n }\n\n return false;\n}\n\nfunction isChangeSafeForInputObjectFieldOrFieldArg(oldType, newType) {\n if (isNamedType(oldType)) {\n // if they're both named types, see if their names are equivalent\n return isNamedType(newType) && oldType.name === newType.name;\n } else if (isListType(oldType)) {\n // if they're both lists, make sure the underlying types are compatible\n return isListType(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType);\n } else if (isNonNullType(oldType)) {\n return (// if they're both non-null, make sure the underlying types are\n // compatible\n isNonNullType(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType) || // moving from non-null to nullable of the same underlying type is safe\n !isNonNullType(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType)\n );\n }\n\n return false;\n}\n/**\n * Given two schemas, returns an Array containing descriptions of any breaking\n * changes in the newSchema related to removing types from a union type.\n */\n\n\nexport function findTypesRemovedFromUnions(oldSchema, newSchema) {\n var oldTypeMap = oldSchema.getTypeMap();\n var newTypeMap = newSchema.getTypeMap();\n var typesRemovedFromUnion = [];\n\n var _arr10 = Object.keys(oldTypeMap);\n\n for (var _i10 = 0; _i10 < _arr10.length; _i10++) {\n var typeName = _arr10[_i10];\n var oldType = oldTypeMap[typeName];\n var newType = newTypeMap[typeName];\n\n if (!isUnionType(oldType) || !isUnionType(newType)) {\n continue;\n }\n\n var typeNamesInNewUnion = Object.create(null);\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = newType.getTypes()[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var type = _step3.value;\n typeNamesInNewUnion[type.name] = true;\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return != null) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n\n var _iteratorNormalCompletion4 = true;\n var _didIteratorError4 = false;\n var _iteratorError4 = undefined;\n\n try {\n for (var _iterator4 = oldType.getTypes()[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {\n var _type = _step4.value;\n\n if (!typeNamesInNewUnion[_type.name]) {\n typesRemovedFromUnion.push({\n type: BreakingChangeType.TYPE_REMOVED_FROM_UNION,\n description: \"\".concat(_type.name, \" was removed from union type \").concat(typeName, \".\")\n });\n }\n }\n } catch (err) {\n _didIteratorError4 = true;\n _iteratorError4 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion4 && _iterator4.return != null) {\n _iterator4.return();\n }\n } finally {\n if (_didIteratorError4) {\n throw _iteratorError4;\n }\n }\n }\n }\n\n return typesRemovedFromUnion;\n}\n/**\n * Given two schemas, returns an Array containing descriptions of any dangerous\n * changes in the newSchema related to adding types to a union type.\n */\n\nexport function findTypesAddedToUnions(oldSchema, newSchema) {\n var oldTypeMap = oldSchema.getTypeMap();\n var newTypeMap = newSchema.getTypeMap();\n var typesAddedToUnion = [];\n\n var _arr11 = Object.keys(newTypeMap);\n\n for (var _i11 = 0; _i11 < _arr11.length; _i11++) {\n var typeName = _arr11[_i11];\n var oldType = oldTypeMap[typeName];\n var newType = newTypeMap[typeName];\n\n if (!isUnionType(oldType) || !isUnionType(newType)) {\n continue;\n }\n\n var typeNamesInOldUnion = Object.create(null);\n var _iteratorNormalCompletion5 = true;\n var _didIteratorError5 = false;\n var _iteratorError5 = undefined;\n\n try {\n for (var _iterator5 = oldType.getTypes()[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {\n var type = _step5.value;\n typeNamesInOldUnion[type.name] = true;\n }\n } catch (err) {\n _didIteratorError5 = true;\n _iteratorError5 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion5 && _iterator5.return != null) {\n _iterator5.return();\n }\n } finally {\n if (_didIteratorError5) {\n throw _iteratorError5;\n }\n }\n }\n\n var _iteratorNormalCompletion6 = true;\n var _didIteratorError6 = false;\n var _iteratorError6 = undefined;\n\n try {\n for (var _iterator6 = newType.getTypes()[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {\n var _type2 = _step6.value;\n\n if (!typeNamesInOldUnion[_type2.name]) {\n typesAddedToUnion.push({\n type: DangerousChangeType.TYPE_ADDED_TO_UNION,\n description: \"\".concat(_type2.name, \" was added to union type \").concat(typeName, \".\")\n });\n }\n }\n } catch (err) {\n _didIteratorError6 = true;\n _iteratorError6 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion6 && _iterator6.return != null) {\n _iterator6.return();\n }\n } finally {\n if (_didIteratorError6) {\n throw _iteratorError6;\n }\n }\n }\n }\n\n return typesAddedToUnion;\n}\n/**\n * Given two schemas, returns an Array containing descriptions of any breaking\n * changes in the newSchema related to removing values from an enum type.\n */\n\nexport function findValuesRemovedFromEnums(oldSchema, newSchema) {\n var oldTypeMap = oldSchema.getTypeMap();\n var newTypeMap = newSchema.getTypeMap();\n var valuesRemovedFromEnums = [];\n\n var _arr12 = Object.keys(oldTypeMap);\n\n for (var _i12 = 0; _i12 < _arr12.length; _i12++) {\n var typeName = _arr12[_i12];\n var oldType = oldTypeMap[typeName];\n var newType = newTypeMap[typeName];\n\n if (!isEnumType(oldType) || !isEnumType(newType)) {\n continue;\n }\n\n var valuesInNewEnum = Object.create(null);\n var _iteratorNormalCompletion7 = true;\n var _didIteratorError7 = false;\n var _iteratorError7 = undefined;\n\n try {\n for (var _iterator7 = newType.getValues()[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {\n var value = _step7.value;\n valuesInNewEnum[value.name] = true;\n }\n } catch (err) {\n _didIteratorError7 = true;\n _iteratorError7 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion7 && _iterator7.return != null) {\n _iterator7.return();\n }\n } finally {\n if (_didIteratorError7) {\n throw _iteratorError7;\n }\n }\n }\n\n var _iteratorNormalCompletion8 = true;\n var _didIteratorError8 = false;\n var _iteratorError8 = undefined;\n\n try {\n for (var _iterator8 = oldType.getValues()[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) {\n var _value = _step8.value;\n\n if (!valuesInNewEnum[_value.name]) {\n valuesRemovedFromEnums.push({\n type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM,\n description: \"\".concat(_value.name, \" was removed from enum type \").concat(typeName, \".\")\n });\n }\n }\n } catch (err) {\n _didIteratorError8 = true;\n _iteratorError8 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion8 && _iterator8.return != null) {\n _iterator8.return();\n }\n } finally {\n if (_didIteratorError8) {\n throw _iteratorError8;\n }\n }\n }\n }\n\n return valuesRemovedFromEnums;\n}\n/**\n * Given two schemas, returns an Array containing descriptions of any dangerous\n * changes in the newSchema related to adding values to an enum type.\n */\n\nexport function findValuesAddedToEnums(oldSchema, newSchema) {\n var oldTypeMap = oldSchema.getTypeMap();\n var newTypeMap = newSchema.getTypeMap();\n var valuesAddedToEnums = [];\n\n var _arr13 = Object.keys(oldTypeMap);\n\n for (var _i13 = 0; _i13 < _arr13.length; _i13++) {\n var typeName = _arr13[_i13];\n var oldType = oldTypeMap[typeName];\n var newType = newTypeMap[typeName];\n\n if (!isEnumType(oldType) || !isEnumType(newType)) {\n continue;\n }\n\n var valuesInOldEnum = Object.create(null);\n var _iteratorNormalCompletion9 = true;\n var _didIteratorError9 = false;\n var _iteratorError9 = undefined;\n\n try {\n for (var _iterator9 = oldType.getValues()[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {\n var value = _step9.value;\n valuesInOldEnum[value.name] = true;\n }\n } catch (err) {\n _didIteratorError9 = true;\n _iteratorError9 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion9 && _iterator9.return != null) {\n _iterator9.return();\n }\n } finally {\n if (_didIteratorError9) {\n throw _iteratorError9;\n }\n }\n }\n\n var _iteratorNormalCompletion10 = true;\n var _didIteratorError10 = false;\n var _iteratorError10 = undefined;\n\n try {\n for (var _iterator10 = newType.getValues()[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) {\n var _value2 = _step10.value;\n\n if (!valuesInOldEnum[_value2.name]) {\n valuesAddedToEnums.push({\n type: DangerousChangeType.VALUE_ADDED_TO_ENUM,\n description: \"\".concat(_value2.name, \" was added to enum type \").concat(typeName, \".\")\n });\n }\n }\n } catch (err) {\n _didIteratorError10 = true;\n _iteratorError10 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion10 && _iterator10.return != null) {\n _iterator10.return();\n }\n } finally {\n if (_didIteratorError10) {\n throw _iteratorError10;\n }\n }\n }\n }\n\n return valuesAddedToEnums;\n}\nexport function findInterfacesRemovedFromObjectTypes(oldSchema, newSchema) {\n var oldTypeMap = oldSchema.getTypeMap();\n var newTypeMap = newSchema.getTypeMap();\n var breakingChanges = [];\n\n var _arr14 = Object.keys(oldTypeMap);\n\n for (var _i14 = 0; _i14 < _arr14.length; _i14++) {\n var typeName = _arr14[_i14];\n var oldType = oldTypeMap[typeName];\n var newType = newTypeMap[typeName];\n\n if (!isObjectType(oldType) || !isObjectType(newType)) {\n continue;\n }\n\n var oldInterfaces = oldType.getInterfaces();\n var newInterfaces = newType.getInterfaces();\n var _iteratorNormalCompletion11 = true;\n var _didIteratorError11 = false;\n var _iteratorError11 = undefined;\n\n try {\n var _loop3 = function _loop3() {\n var oldInterface = _step11.value;\n\n if (!newInterfaces.some(function (int) {\n return int.name === oldInterface.name;\n })) {\n breakingChanges.push({\n type: BreakingChangeType.INTERFACE_REMOVED_FROM_OBJECT,\n description: \"\".concat(typeName, \" no longer implements interface \") + \"\".concat(oldInterface.name, \".\")\n });\n }\n };\n\n for (var _iterator11 = oldInterfaces[Symbol.iterator](), _step11; !(_iteratorNormalCompletion11 = (_step11 = _iterator11.next()).done); _iteratorNormalCompletion11 = true) {\n _loop3();\n }\n } catch (err) {\n _didIteratorError11 = true;\n _iteratorError11 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion11 && _iterator11.return != null) {\n _iterator11.return();\n }\n } finally {\n if (_didIteratorError11) {\n throw _iteratorError11;\n }\n }\n }\n }\n\n return breakingChanges;\n}\nexport function findInterfacesAddedToObjectTypes(oldSchema, newSchema) {\n var oldTypeMap = oldSchema.getTypeMap();\n var newTypeMap = newSchema.getTypeMap();\n var interfacesAddedToObjectTypes = [];\n\n var _arr15 = Object.keys(newTypeMap);\n\n for (var _i15 = 0; _i15 < _arr15.length; _i15++) {\n var typeName = _arr15[_i15];\n var oldType = oldTypeMap[typeName];\n var newType = newTypeMap[typeName];\n\n if (!isObjectType(oldType) || !isObjectType(newType)) {\n continue;\n }\n\n var oldInterfaces = oldType.getInterfaces();\n var newInterfaces = newType.getInterfaces();\n var _iteratorNormalCompletion12 = true;\n var _didIteratorError12 = false;\n var _iteratorError12 = undefined;\n\n try {\n var _loop4 = function _loop4() {\n var newInterface = _step12.value;\n\n if (!oldInterfaces.some(function (int) {\n return int.name === newInterface.name;\n })) {\n interfacesAddedToObjectTypes.push({\n type: DangerousChangeType.INTERFACE_ADDED_TO_OBJECT,\n description: \"\".concat(newInterface.name, \" added to interfaces implemented \") + \"by \".concat(typeName, \".\")\n });\n }\n };\n\n for (var _iterator12 = newInterfaces[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {\n _loop4();\n }\n } catch (err) {\n _didIteratorError12 = true;\n _iteratorError12 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion12 && _iterator12.return != null) {\n _iterator12.return();\n }\n } finally {\n if (_didIteratorError12) {\n throw _iteratorError12;\n }\n }\n }\n }\n\n return interfacesAddedToObjectTypes;\n}\nexport function findRemovedDirectives(oldSchema, newSchema) {\n var removedDirectives = [];\n var newSchemaDirectiveMap = getDirectiveMapForSchema(newSchema);\n var _iteratorNormalCompletion13 = true;\n var _didIteratorError13 = false;\n var _iteratorError13 = undefined;\n\n try {\n for (var _iterator13 = oldSchema.getDirectives()[Symbol.iterator](), _step13; !(_iteratorNormalCompletion13 = (_step13 = _iterator13.next()).done); _iteratorNormalCompletion13 = true) {\n var directive = _step13.value;\n\n if (!newSchemaDirectiveMap[directive.name]) {\n removedDirectives.push({\n type: BreakingChangeType.DIRECTIVE_REMOVED,\n description: \"\".concat(directive.name, \" was removed\")\n });\n }\n }\n } catch (err) {\n _didIteratorError13 = true;\n _iteratorError13 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion13 && _iterator13.return != null) {\n _iterator13.return();\n }\n } finally {\n if (_didIteratorError13) {\n throw _iteratorError13;\n }\n }\n }\n\n return removedDirectives;\n}\n\nfunction findRemovedArgsForDirective(oldDirective, newDirective) {\n var removedArgs = [];\n var newArgMap = getArgumentMapForDirective(newDirective);\n var _iteratorNormalCompletion14 = true;\n var _didIteratorError14 = false;\n var _iteratorError14 = undefined;\n\n try {\n for (var _iterator14 = oldDirective.args[Symbol.iterator](), _step14; !(_iteratorNormalCompletion14 = (_step14 = _iterator14.next()).done); _iteratorNormalCompletion14 = true) {\n var arg = _step14.value;\n\n if (!newArgMap[arg.name]) {\n removedArgs.push(arg);\n }\n }\n } catch (err) {\n _didIteratorError14 = true;\n _iteratorError14 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion14 && _iterator14.return != null) {\n _iterator14.return();\n }\n } finally {\n if (_didIteratorError14) {\n throw _iteratorError14;\n }\n }\n }\n\n return removedArgs;\n}\n\nexport function findRemovedDirectiveArgs(oldSchema, newSchema) {\n var removedDirectiveArgs = [];\n var oldSchemaDirectiveMap = getDirectiveMapForSchema(oldSchema);\n var _iteratorNormalCompletion15 = true;\n var _didIteratorError15 = false;\n var _iteratorError15 = undefined;\n\n try {\n for (var _iterator15 = newSchema.getDirectives()[Symbol.iterator](), _step15; !(_iteratorNormalCompletion15 = (_step15 = _iterator15.next()).done); _iteratorNormalCompletion15 = true) {\n var newDirective = _step15.value;\n var oldDirective = oldSchemaDirectiveMap[newDirective.name];\n\n if (!oldDirective) {\n continue;\n }\n\n var _iteratorNormalCompletion16 = true;\n var _didIteratorError16 = false;\n var _iteratorError16 = undefined;\n\n try {\n for (var _iterator16 = findRemovedArgsForDirective(oldDirective, newDirective)[Symbol.iterator](), _step16; !(_iteratorNormalCompletion16 = (_step16 = _iterator16.next()).done); _iteratorNormalCompletion16 = true) {\n var arg = _step16.value;\n removedDirectiveArgs.push({\n type: BreakingChangeType.DIRECTIVE_ARG_REMOVED,\n description: \"\".concat(arg.name, \" was removed from \").concat(newDirective.name)\n });\n }\n } catch (err) {\n _didIteratorError16 = true;\n _iteratorError16 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion16 && _iterator16.return != null) {\n _iterator16.return();\n }\n } finally {\n if (_didIteratorError16) {\n throw _iteratorError16;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError15 = true;\n _iteratorError15 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion15 && _iterator15.return != null) {\n _iterator15.return();\n }\n } finally {\n if (_didIteratorError15) {\n throw _iteratorError15;\n }\n }\n }\n\n return removedDirectiveArgs;\n}\n\nfunction findAddedArgsForDirective(oldDirective, newDirective) {\n var addedArgs = [];\n var oldArgMap = getArgumentMapForDirective(oldDirective);\n var _iteratorNormalCompletion17 = true;\n var _didIteratorError17 = false;\n var _iteratorError17 = undefined;\n\n try {\n for (var _iterator17 = newDirective.args[Symbol.iterator](), _step17; !(_iteratorNormalCompletion17 = (_step17 = _iterator17.next()).done); _iteratorNormalCompletion17 = true) {\n var arg = _step17.value;\n\n if (!oldArgMap[arg.name]) {\n addedArgs.push(arg);\n }\n }\n } catch (err) {\n _didIteratorError17 = true;\n _iteratorError17 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion17 && _iterator17.return != null) {\n _iterator17.return();\n }\n } finally {\n if (_didIteratorError17) {\n throw _iteratorError17;\n }\n }\n }\n\n return addedArgs;\n}\n\nexport function findAddedNonNullDirectiveArgs(oldSchema, newSchema) {\n var addedNonNullableArgs = [];\n var oldSchemaDirectiveMap = getDirectiveMapForSchema(oldSchema);\n var _iteratorNormalCompletion18 = true;\n var _didIteratorError18 = false;\n var _iteratorError18 = undefined;\n\n try {\n for (var _iterator18 = newSchema.getDirectives()[Symbol.iterator](), _step18; !(_iteratorNormalCompletion18 = (_step18 = _iterator18.next()).done); _iteratorNormalCompletion18 = true) {\n var newDirective = _step18.value;\n var oldDirective = oldSchemaDirectiveMap[newDirective.name];\n\n if (!oldDirective) {\n continue;\n }\n\n var _iteratorNormalCompletion19 = true;\n var _didIteratorError19 = false;\n var _iteratorError19 = undefined;\n\n try {\n for (var _iterator19 = findAddedArgsForDirective(oldDirective, newDirective)[Symbol.iterator](), _step19; !(_iteratorNormalCompletion19 = (_step19 = _iterator19.next()).done); _iteratorNormalCompletion19 = true) {\n var arg = _step19.value;\n\n if (isRequiredArgument(arg)) {\n addedNonNullableArgs.push({\n type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED,\n description: \"A required arg \".concat(arg.name, \" on directive \") + \"\".concat(newDirective.name, \" was added\")\n });\n }\n }\n } catch (err) {\n _didIteratorError19 = true;\n _iteratorError19 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion19 && _iterator19.return != null) {\n _iterator19.return();\n }\n } finally {\n if (_didIteratorError19) {\n throw _iteratorError19;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError18 = true;\n _iteratorError18 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion18 && _iterator18.return != null) {\n _iterator18.return();\n }\n } finally {\n if (_didIteratorError18) {\n throw _iteratorError18;\n }\n }\n }\n\n return addedNonNullableArgs;\n}\nexport function findRemovedLocationsForDirective(oldDirective, newDirective) {\n var removedLocations = [];\n var newLocationSet = new Set(newDirective.locations);\n var _iteratorNormalCompletion20 = true;\n var _didIteratorError20 = false;\n var _iteratorError20 = undefined;\n\n try {\n for (var _iterator20 = oldDirective.locations[Symbol.iterator](), _step20; !(_iteratorNormalCompletion20 = (_step20 = _iterator20.next()).done); _iteratorNormalCompletion20 = true) {\n var oldLocation = _step20.value;\n\n if (!newLocationSet.has(oldLocation)) {\n removedLocations.push(oldLocation);\n }\n }\n } catch (err) {\n _didIteratorError20 = true;\n _iteratorError20 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion20 && _iterator20.return != null) {\n _iterator20.return();\n }\n } finally {\n if (_didIteratorError20) {\n throw _iteratorError20;\n }\n }\n }\n\n return removedLocations;\n}\nexport function findRemovedDirectiveLocations(oldSchema, newSchema) {\n var removedLocations = [];\n var oldSchemaDirectiveMap = getDirectiveMapForSchema(oldSchema);\n var _iteratorNormalCompletion21 = true;\n var _didIteratorError21 = false;\n var _iteratorError21 = undefined;\n\n try {\n for (var _iterator21 = newSchema.getDirectives()[Symbol.iterator](), _step21; !(_iteratorNormalCompletion21 = (_step21 = _iterator21.next()).done); _iteratorNormalCompletion21 = true) {\n var newDirective = _step21.value;\n var oldDirective = oldSchemaDirectiveMap[newDirective.name];\n\n if (!oldDirective) {\n continue;\n }\n\n var _iteratorNormalCompletion22 = true;\n var _didIteratorError22 = false;\n var _iteratorError22 = undefined;\n\n try {\n for (var _iterator22 = findRemovedLocationsForDirective(oldDirective, newDirective)[Symbol.iterator](), _step22; !(_iteratorNormalCompletion22 = (_step22 = _iterator22.next()).done); _iteratorNormalCompletion22 = true) {\n var location = _step22.value;\n removedLocations.push({\n type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED,\n description: \"\".concat(location, \" was removed from \").concat(newDirective.name)\n });\n }\n } catch (err) {\n _didIteratorError22 = true;\n _iteratorError22 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion22 && _iterator22.return != null) {\n _iterator22.return();\n }\n } finally {\n if (_didIteratorError22) {\n throw _iteratorError22;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError21 = true;\n _iteratorError21 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion21 && _iterator21.return != null) {\n _iterator21.return();\n }\n } finally {\n if (_didIteratorError21) {\n throw _iteratorError21;\n }\n }\n }\n\n return removedLocations;\n}\n\nfunction getDirectiveMapForSchema(schema) {\n return keyMap(schema.getDirectives(), function (dir) {\n return dir.name;\n });\n}\n\nfunction getArgumentMapForDirective(directive) {\n return keyMap(directive.args, function (arg) {\n return arg.name;\n });\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\nimport { GraphQLError } from '../error/GraphQLError';\nimport { visit, visitWithTypeInfo } from '../language/visitor';\nimport { getNamedType } from '../type/definition';\nimport { TypeInfo } from './TypeInfo';\n/**\n * A validation rule which reports deprecated usages.\n *\n * Returns a list of GraphQLError instances describing each deprecated use.\n */\n\nexport function findDeprecatedUsages(schema, ast) {\n var errors = [];\n var typeInfo = new TypeInfo(schema);\n visit(ast, visitWithTypeInfo(typeInfo, {\n Field: function Field(node) {\n var fieldDef = typeInfo.getFieldDef();\n\n if (fieldDef && fieldDef.isDeprecated) {\n var parentType = typeInfo.getParentType();\n\n if (parentType) {\n var reason = fieldDef.deprecationReason;\n errors.push(new GraphQLError(\"The field \".concat(parentType.name, \".\").concat(fieldDef.name, \" is deprecated.\") + (reason ? ' ' + reason : ''), [node]));\n }\n }\n },\n EnumValue: function EnumValue(node) {\n var enumVal = typeInfo.getEnumValue();\n\n if (enumVal && enumVal.isDeprecated) {\n var type = getNamedType(typeInfo.getInputType());\n\n if (type) {\n var reason = enumVal.deprecationReason;\n errors.push(new GraphQLError(\"The enum value \".concat(type.name, \".\").concat(enumVal.name, \" is deprecated.\") + (reason ? ' ' + reason : ''), [node]));\n }\n }\n }\n }));\n return errors;\n}","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n// The GraphQL query recommended for a full schema introspection.\nexport { getIntrospectionQuery, // @deprecated, use getIntrospectionQuery() - will be removed in v15\nintrospectionQuery } from './introspectionQuery';\n// Gets the target Operation from a Document\nexport { getOperationAST } from './getOperationAST'; // Gets the Type for the target Operation AST.\n\nexport { getOperationRootType } from './getOperationRootType'; // Convert a GraphQLSchema to an IntrospectionQuery\n\nexport { introspectionFromSchema } from './introspectionFromSchema'; // Build a GraphQLSchema from an introspection result.\n\nexport { buildClientSchema } from './buildClientSchema'; // Build a GraphQLSchema from GraphQL Schema language.\n\nexport { buildASTSchema, buildSchema, // @deprecated: Get the description from a schema AST node and supports legacy\n// syntax for specifying descriptions - will be removed in v16\ngetDescription } from './buildASTSchema';\n// Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST.\nexport { extendSchema } from './extendSchema'; // Sort a GraphQLSchema.\n\nexport { lexicographicSortSchema } from './lexicographicSortSchema'; // Print a GraphQLSchema to GraphQL Schema language.\n\nexport { printSchema, printType, printIntrospectionSchema } from './schemaPrinter'; // Create a GraphQLType from a GraphQL language AST.\n\nexport { typeFromAST } from './typeFromAST'; // Create a JavaScript value from a GraphQL language AST with a type.\n\nexport { valueFromAST } from './valueFromAST'; // Create a JavaScript value from a GraphQL language AST without a type.\n\nexport { valueFromASTUntyped } from './valueFromASTUntyped'; // Create a GraphQL language AST from a JavaScript value.\n\nexport { astFromValue } from './astFromValue'; // A helper to use within recursive-descent visitors which need to be aware of\n// the GraphQL type system.\n\nexport { TypeInfo } from './TypeInfo'; // Coerces a JavaScript value to a GraphQL type, or produces errors.\n\nexport { coerceValue } from './coerceValue'; // @deprecated use coerceValue - will be removed in v15\n\nexport { isValidJSValue } from './isValidJSValue'; // @deprecated use validation - will be removed in v15\n\nexport { isValidLiteralValue } from './isValidLiteralValue'; // Concatenates multiple AST together.\n\nexport { concatAST } from './concatAST'; // Separates an AST into an AST per Operation.\n\nexport { separateOperations } from './separateOperations'; // Comparators for types\n\nexport { isEqualType, isTypeSubTypeOf, doTypesOverlap } from './typeComparators'; // Asserts that a string is a valid GraphQL name\n\nexport { assertValidName, isValidNameError } from './assertValidName'; // Compares two GraphQLSchemas and detects breaking changes.\n\nexport { BreakingChangeType, DangerousChangeType, findBreakingChanges, findDangerousChanges } from './findBreakingChanges';\n// Report all deprecated usage within a GraphQL document.\nexport { findDeprecatedUsages } from './findDeprecatedUsages';","/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * strict\n */\n\n/**\n * GraphQL.js provides a reference implementation for the GraphQL specification\n * but is also a useful utility for operating on GraphQL files and building\n * sophisticated tools.\n *\n * This primary module exports a general purpose function for fulfilling all\n * steps of the GraphQL specification in a single operation, but also includes\n * utilities for every part of the GraphQL specification:\n *\n * - Parsing the GraphQL language.\n * - Building a GraphQL type schema.\n * - Validating a GraphQL request against a type schema.\n * - Executing a GraphQL request against a type schema.\n *\n * This also includes utility functions for operating on GraphQL types and\n * GraphQL documents to facilitate building tools.\n *\n * You may also import from each sub-directory directly. For example, the\n * following two import statements are equivalent:\n *\n * import { parse } from 'graphql';\n * import { parse } from 'graphql/language';\n */\n// The primary entry point into fulfilling a GraphQL request.\nexport { graphql, graphqlSync } from './graphql'; // Create and operate on GraphQL type definitions and schema.\n\nexport { GraphQLSchema, // Definitions\nGraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, GraphQLList, GraphQLNonNull, GraphQLDirective, // \"Enum\" of Type Kinds\nTypeKind, // Scalars\nspecifiedScalarTypes, GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID, // Built-in Directives defined by the Spec\nspecifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, // Constant Deprecation Reason\nDEFAULT_DEPRECATION_REASON, // Meta-field definitions.\nSchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, // GraphQL Types for introspection.\nintrospectionTypes, __Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind, // Predicates\nisSchema, isDirective, isType, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isListType, isNonNullType, isInputType, isOutputType, isLeafType, isCompositeType, isAbstractType, isWrappingType, isNullableType, isNamedType, isRequiredArgument, isRequiredInputField, isSpecifiedScalarType, isIntrospectionType, isSpecifiedDirective, // Assertions\nassertType, assertScalarType, assertObjectType, assertInterfaceType, assertUnionType, assertEnumType, assertInputObjectType, assertListType, assertNonNullType, assertInputType, assertOutputType, assertLeafType, assertCompositeType, assertAbstractType, assertWrappingType, assertNullableType, assertNamedType, // Un-modifiers\ngetNullableType, getNamedType, // Validate GraphQL schema.\nvalidateSchema, assertValidSchema } from './type';\n// Parse and operate on GraphQL language source files.\nexport { Source, getLocation, // Parse\nparse, parseValue, parseType, // Print\nprint, // Visit\nvisit, visitInParallel, visitWithTypeInfo, getVisitFn, Kind, TokenKind, DirectiveLocation, BREAK, // Predicates\nisDefinitionNode, isExecutableDefinitionNode, isSelectionNode, isValueNode, isTypeNode, isTypeSystemDefinitionNode, isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode } from './language';\n// Execute GraphQL queries.\nexport { execute, defaultFieldResolver, responsePathAsArray, getDirectiveValues } from './execution';\nexport { subscribe, createSourceEventStream } from './subscription'; // Validate GraphQL queries.\n\nexport { validate, ValidationContext, // All validation rules in the GraphQL Specification.\nspecifiedRules, // Individual validation rules.\nFieldsOnCorrectTypeRule, FragmentsOnCompositeTypesRule, KnownArgumentNamesRule, KnownDirectivesRule, KnownFragmentNamesRule, KnownTypeNamesRule, LoneAnonymousOperationRule, NoFragmentCyclesRule, NoUndefinedVariablesRule, NoUnusedFragmentsRule, NoUnusedVariablesRule, OverlappingFieldsCanBeMergedRule, PossibleFragmentSpreadsRule, ProvidedRequiredArgumentsRule, ScalarLeafsRule, SingleFieldSubscriptionsRule, UniqueArgumentNamesRule, UniqueDirectivesPerLocationRule, UniqueFragmentNamesRule, UniqueInputFieldNamesRule, UniqueOperationNamesRule, UniqueVariableNamesRule, ValuesOfCorrectTypeRule, VariablesAreInputTypesRule, VariablesInAllowedPositionRule } from './validation';\n// Create, format, and print GraphQL errors.\nexport { GraphQLError, formatError, printError } from './error';\n// Utilities for operating on GraphQL type schema and parsed sources.\nexport { // Produce the GraphQL query recommended for a full schema introspection.\n// Accepts optional IntrospectionOptions.\ngetIntrospectionQuery, // @deprecated: use getIntrospectionQuery - will be removed in v15\nintrospectionQuery, // Gets the target Operation from a Document\ngetOperationAST, // Gets the Type for the target Operation AST.\ngetOperationRootType, // Convert a GraphQLSchema to an IntrospectionQuery\nintrospectionFromSchema, // Build a GraphQLSchema from an introspection result.\nbuildClientSchema, // Build a GraphQLSchema from a parsed GraphQL Schema language AST.\nbuildASTSchema, // Build a GraphQLSchema from a GraphQL schema language document.\nbuildSchema, // @deprecated: Get the description from a schema AST node and supports legacy\n// syntax for specifying descriptions - will be removed in v16\ngetDescription, // Extends an existing GraphQLSchema from a parsed GraphQL Schema\n// language AST.\nextendSchema, // Sort a GraphQLSchema.\nlexicographicSortSchema, // Print a GraphQLSchema to GraphQL Schema language.\nprintSchema, // Prints the built-in introspection schema in the Schema Language\n// format.\nprintIntrospectionSchema, // Print a GraphQLType to GraphQL Schema language.\nprintType, // Create a GraphQLType from a GraphQL language AST.\ntypeFromAST, // Create a JavaScript value from a GraphQL language AST with a Type.\nvalueFromAST, // Create a JavaScript value from a GraphQL language AST without a Type.\nvalueFromASTUntyped, // Create a GraphQL language AST from a JavaScript value.\nastFromValue, // A helper to use within recursive-descent visitors which need to be aware of\n// the GraphQL type system.\nTypeInfo, // Coerces a JavaScript value to a GraphQL type, or produces errors.\ncoerceValue, // @deprecated use coerceValue - will be removed in v15\nisValidJSValue, // @deprecated use validation - will be removed in v15\nisValidLiteralValue, // Concatenates multiple AST together.\nconcatAST, // Separates an AST into an AST per Operation.\nseparateOperations, // Comparators for types\nisEqualType, isTypeSubTypeOf, doTypesOverlap, // Asserts a string is a valid GraphQL name.\nassertValidName, // Determine if a string is a valid GraphQL name.\nisValidNameError, // Compares two GraphQLSchemas and detects breaking changes.\nfindBreakingChanges, findDangerousChanges, BreakingChangeType, DangerousChangeType, // Report all deprecated usage within a GraphQL document.\nfindDeprecatedUsages } from './utilities';","// importing print is a reasonable thing to do, since Apollo Link Http requires\n// it to be present\nimport { DocumentNode, DirectiveNode, print } from 'graphql';\n\nimport { checkDocument, removeDirectivesFromDocument } from 'apollo-utilities';\n\nconst connectionRemoveConfig = {\n test: (directive: DirectiveNode) => directive.name.value === 'client',\n remove: true,\n};\n\nconst removed = new Map();\nexport function removeClientSetsFromDocument(\n query: DocumentNode,\n): DocumentNode {\n // caching\n const cached = removed.get(query);\n if (cached) return cached;\n\n checkDocument(query);\n\n const docClone = removeDirectivesFromDocument(\n [connectionRemoveConfig],\n query,\n );\n\n // caching\n removed.set(query, docClone);\n return docClone;\n}\n\nexport function normalizeTypeDefs(\n typeDefs: string | string[] | DocumentNode | DocumentNode[],\n) {\n const defs = Array.isArray(typeDefs) ? typeDefs : [typeDefs];\n\n return defs\n .map(typeDef => (typeof typeDef === 'string' ? typeDef : print(typeDef)))\n .map(str => str.trim())\n .join('\\n');\n}\n","import {\n ApolloLink,\n Observable,\n Operation,\n NextLink,\n FetchResult,\n} from 'apollo-link';\nimport { ApolloCache } from 'apollo-cache';\nimport { DocumentNode } from 'graphql';\n\nimport { hasDirectives, getMainDefinition } from 'apollo-utilities';\n\nimport * as Async from 'graphql-anywhere/lib/async';\nconst { graphql } = Async;\n\nimport { FragmentMatcher } from 'graphql-anywhere';\n\nimport { removeClientSetsFromDocument, normalizeTypeDefs } from './utils';\n\nconst capitalizeFirstLetter = str => str.charAt(0).toUpperCase() + str.slice(1);\n\nexport type ClientStateConfig = {\n cache?: ApolloCache<any>;\n resolvers: any | (() => any);\n defaults?: any;\n typeDefs?: string | string[] | DocumentNode | DocumentNode[];\n fragmentMatcher?: FragmentMatcher;\n};\n\nexport const withClientState = (\n clientStateConfig: ClientStateConfig = { resolvers: {}, defaults: {} },\n) => {\n const { defaults, cache, typeDefs, fragmentMatcher } = clientStateConfig;\n if (cache && defaults) {\n cache.writeData({ data: defaults });\n }\n\n return new class StateLink extends ApolloLink {\n public writeDefaults() {\n if (cache && defaults) {\n cache.writeData({ data: defaults });\n }\n }\n\n public request(\n operation: Operation,\n forward: NextLink = () => Observable.of({ data: {} }),\n ): Observable<FetchResult> {\n if (typeDefs) {\n const directives = 'directive @client on FIELD';\n\n const definition = normalizeTypeDefs(typeDefs);\n\n operation.setContext(({ schemas = [] }) => ({\n schemas: schemas.concat([{ definition, directives }]),\n }));\n }\n\n const isClient = hasDirectives(['client'], operation.query);\n\n if (!isClient) return forward(operation);\n\n const resolvers =\n typeof clientStateConfig.resolvers === 'function'\n ? clientStateConfig.resolvers()\n : clientStateConfig.resolvers;\n const server = removeClientSetsFromDocument(operation.query);\n const { query } = operation;\n const type =\n capitalizeFirstLetter(\n (getMainDefinition(query) || ({} as any)).operation,\n ) || 'Query';\n\n const resolver = (fieldName, rootValue = {}, args, context, info) => {\n const { resultKey } = info;\n\n // rootValue[fieldName] is where the data is stored in the \"canonical model\"\n // rootValue[info.resultKey] is where the user wants the data to be.\n // If fieldName != info.resultKey -- then GraphQL Aliases are in play\n // See also:\n // - https://github.com/apollographql/apollo-client/tree/master/packages/graphql-anywhere#resolver-info\n // - https://github.com/apollographql/apollo-link-rest/pull/113\n\n // Support GraphQL Aliases!\n const aliasedNode = rootValue[resultKey];\n const preAliasingNode = rootValue[fieldName];\n const aliasNeeded = resultKey !== fieldName;\n\n // If aliasedValue is defined, some other link or server already returned a value\n if (aliasedNode !== undefined || preAliasingNode !== undefined) {\n return aliasedNode || preAliasingNode;\n }\n\n // Look for the field in the custom resolver map\n const resolverMap = resolvers[(rootValue as any).__typename || type];\n if (resolverMap) {\n const resolve = resolverMap[fieldName];\n if (resolve) return resolve(rootValue, args, context, info);\n }\n\n // TODO: the proper thing to do here is throw an error saying to\n // add `client.onResetStore(link.writeDefaults);`\n // waiting on https://github.com/apollographql/apollo-client/pull/3010\n\n return (\n // Support nested fields\n (aliasNeeded ? aliasedNode : preAliasingNode) ||\n (defaults || {})[fieldName]\n );\n };\n\n if (server) operation.query = server;\n const obs =\n server && forward\n ? forward(operation)\n : Observable.of({\n data: {},\n });\n\n return new Observable(observer => {\n // Works around race condition between completion and graphql execution\n // finishing. If complete is called during the graphql call, we will\n // miss out on the result, since the observer will have completed\n let complete = false;\n let handlingNext = false;\n obs.subscribe({\n next: ({ data, errors }) => {\n const observerErrorHandler = observer.error.bind(observer);\n const context = operation.getContext();\n\n handlingNext = true;\n //data is from the server and provides the root value to this GraphQL resolution\n //when there is no resolver, the data is taken from the context\n graphql(resolver, query, data, context, operation.variables, {\n fragmentMatcher,\n })\n .then(nextData => {\n observer.next({\n data: nextData,\n errors,\n });\n if (complete) {\n observer.complete();\n }\n handlingNext = false;\n })\n .catch(observerErrorHandler);\n },\n error: observer.error.bind(observer),\n complete: () => {\n if (!handlingNext) {\n observer.complete();\n }\n complete = true;\n },\n });\n });\n }\n }();\n};\n","/* tslint:disable */\n\nimport {\n ApolloLink,\n Observable,\n Operation,\n NextLink,\n FetchResult,\n} from 'apollo-link';\nimport { GraphQLError, ExecutionResult } from 'graphql';\n\nexport interface ErrorResponse {\n graphQLErrors?: ReadonlyArray<GraphQLError>;\n networkError?: Error;\n response?: ExecutionResult;\n operation: Operation;\n forward: NextLink;\n}\n\nexport namespace ErrorLink {\n /**\n * Callback to be triggered when an error occurs within the link stack.\n */\n export interface ErrorHandler {\n (error: ErrorResponse): Observable<FetchResult> | void;\n }\n}\n\n// For backwards compatibility.\nexport import ErrorHandler = ErrorLink.ErrorHandler;\n\nexport const onError = (errorHandler: ErrorHandler): ApolloLink => {\n return new ApolloLink((operation, forward) => {\n return new Observable(observer => {\n let sub;\n let retriedSub;\n let retriedResult;\n\n try {\n sub = forward(operation).subscribe({\n next: result => {\n if (result.errors) {\n retriedResult = errorHandler({\n graphQLErrors: result.errors,\n response: result,\n operation,\n forward,\n });\n\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n }\n observer.next(result);\n },\n error: networkError => {\n retriedResult = errorHandler({\n operation,\n networkError,\n //Network errors can return GraphQL errors on for example a 403\n graphQLErrors: networkError.result && networkError.result.errors,\n forward,\n });\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n observer.error(networkError);\n },\n complete: () => {\n // disable the previous sub from calling complete on observable\n // if retry is in flight.\n if (!retriedResult) {\n observer.complete.bind(observer)();\n }\n },\n });\n } catch (e) {\n errorHandler({ networkError: e, operation, forward });\n observer.error(e);\n }\n\n return () => {\n if (sub) sub.unsubscribe();\n if (retriedSub) sub.unsubscribe();\n };\n });\n });\n};\n\nexport class ErrorLink extends ApolloLink {\n private link: ApolloLink;\n constructor(errorHandler: ErrorLink.ErrorHandler) {\n super();\n this.link = onError(errorHandler);\n }\n\n public request(\n operation: Operation,\n forward: NextLink,\n ): Observable<FetchResult> | null {\n return this.link.request(operation, forward);\n }\n}\n","/* necessary for backward compat */\nexport * from 'apollo-client';\nexport * from 'apollo-link';\nexport * from 'apollo-cache-inmemory';\n\nimport { Operation, ApolloLink, Observable } from 'apollo-link';\nimport { HttpLink } from 'apollo-link-http';\nimport { withClientState, ClientStateConfig } from 'apollo-link-state';\nimport { onError, ErrorLink } from 'apollo-link-error';\n\nimport { ApolloCache } from 'apollo-cache';\nimport { InMemoryCache, CacheResolverMap } from 'apollo-cache-inmemory';\nimport gql from 'graphql-tag';\nimport ApolloClient from 'apollo-client';\n\nexport { gql, HttpLink };\n\nexport interface PresetConfig {\n request?: (operation: Operation) => Promise<void>;\n uri?: string;\n credentials?: string;\n headers?: any;\n fetch?: GlobalFetch['fetch'];\n fetchOptions?: HttpLink.Options;\n clientState?: ClientStateConfig;\n onError?: ErrorLink.ErrorHandler;\n cacheRedirects?: CacheResolverMap;\n cache?: ApolloCache<any>;\n}\n\n// Yes, these are the exact same as the `PresetConfig` interface. We're\n// defining these again so they can be used to verify that valid config\n// options are being used in the `DefaultClient` constructor, for clients\n// that aren't using Typescript. This duplication is unfortunate, and at\n// some point can likely be adjusted so these items are inferred from\n// the `PresetConfig` interface using a Typescript transform at compilation\n// time. Unfortunately, TS transforms with rollup don't appear to be quite\n// working properly, so this will have to be re-visited at some point.\n// For now, when updating the properties of the `PresetConfig` interface,\n// please also update this constant.\nconst PRESET_CONFIG_KEYS = [\n 'request',\n 'uri',\n 'credentials',\n 'headers',\n 'fetch',\n 'fetchOptions',\n 'clientState',\n 'onError',\n 'cacheRedirects',\n 'cache',\n];\n\nexport default class DefaultClient<TCache> extends ApolloClient<TCache> {\n constructor(config: PresetConfig = {}) {\n if (config) {\n const diff = Object.keys(config).filter(\n key => PRESET_CONFIG_KEYS.indexOf(key) === -1,\n );\n\n if (diff.length > 0) {\n console.warn(\n 'ApolloBoost was initialized with unsupported options: ' +\n `${diff.join(' ')}`,\n );\n }\n }\n\n const {\n request,\n uri,\n credentials,\n headers,\n fetch,\n fetchOptions,\n clientState,\n cacheRedirects,\n onError: errorCallback,\n } = config;\n\n let { cache } = config;\n\n if (cache && cacheRedirects) {\n throw new Error(\n 'Incompatible cache configuration. If providing `cache` then ' +\n 'configure the provided instance with `cacheRedirects` instead.',\n );\n }\n\n if (!cache) {\n cache = cacheRedirects\n ? new InMemoryCache({ cacheRedirects })\n : new InMemoryCache();\n }\n\n const stateLink = clientState\n ? withClientState({ ...clientState, cache })\n : false;\n\n const errorLink = errorCallback\n ? onError(errorCallback)\n : onError(({ graphQLErrors, networkError }) => {\n if (graphQLErrors) {\n graphQLErrors.map(({ message, locations, path }) =>\n // tslint:disable-next-line\n console.log(\n `[GraphQL error]: Message: ${message}, Location: ` +\n `${locations}, Path: ${path}`,\n ),\n );\n }\n if (networkError) {\n // tslint:disable-next-line\n console.log(`[Network error]: ${networkError}`);\n }\n });\n\n const requestHandler = request\n ? new ApolloLink(\n (operation, forward) =>\n new Observable(observer => {\n let handle: any;\n Promise.resolve(operation)\n .then(oper => request(oper))\n .then(() => {\n handle = forward(operation).subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n })\n .catch(observer.error.bind(observer));\n\n return () => {\n if (handle) {\n handle.unsubscribe();\n }\n };\n }),\n )\n : false;\n\n const httpLink = new HttpLink({\n uri: uri || '/graphql',\n fetch,\n fetchOptions: fetchOptions || {},\n credentials: credentials || 'same-origin',\n headers: headers || {},\n });\n\n const link = ApolloLink.from([\n errorLink,\n requestHandler,\n stateLink,\n httpLink,\n ].filter(x => !!x) as ApolloLink[]);\n\n // super hacky, we will fix the types eventually\n super({ cache, link } as any);\n }\n}\n"],"names":["NetworkStatus","__extends","getOperationName","print","tslib_1.__extends","Observable","LinkObservable","FetchType","cloneDeep","tslib_1.__assign","isEqual","tryFunctionOrLogError","Deduplicator","assign","getDefaultValues","getMutationDefinition","graphQLResultHasError","hasDirectives","isProduction","getQueryDefinition","getOperationDefinition","removeConnectionDirectiveFromDocument","validateOperation","isTerminating","toPromise","makePromise","fromPromise","fromError","transformOperation","createOperation","getKey","passthrough","toLink","ApolloLink","empty","from","split","concat","LinkError","execute","getFragmentQueryDocument","isTest","warnOnceInDevelopment","wrap","getMainDefinition","getFragmentDefinitions","createFragmentMap","shouldInclude","isField","resultKeyNameFromField","isInlineFragment","argumentsObjectFromField","getDirectiveInfoFromField","isIdValue","getStoreKeyName","toIdValue","isJsonValue","hasOwn","defaultNormalizedCacheFactory","storeKeyNameFromField","addTypenameToDocument","_typeof","defineToJSON","defineToStringTag","isFinite","_defineProperty","checkDocument","removeDirectivesFromDocument","graphql"],"mappings":";;;;;;;;;;IAAA;IACA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;IACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;IACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACnF,IAAI,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;;AAEF,IAAO,SAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE;IAChC,IAAI,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxB,IAAI,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;IAC3C,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACzF,CAAC;;AAED,IAAO,IAAI,QAAQ,GAAG,WAAW;IACjC,IAAI,QAAQ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;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA,IAAO,SAAS,UAAU,CAAC,GAAG,EAAE;IAChC,EAAE,OAAO,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC;IACjC,CAAC;;IAED;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA,IAAO,SAAS,WAAW,CAAC,GAAG,EAAE;IACjC,EAAE,IAAI,MAAM,GAAG,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC,OAAM;IACxC,EAAE,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC,KAAK,CAAC;IACtE,CAAC;;IAED;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA,IAAO,SAAS,YAAY,CAAC,GAAG,EAAE;IAClC,EAAE,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,WAAW,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;IACrE,CAAC;;IAED;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA,IAAO,SAAS,WAAW,CAAC,QAAQ,EAAE;IACtC,EAAE,IAAI,MAAM,GAAG,iBAAiB,CAAC,QAAQ,EAAC;IAC1C,EAAE,IAAI,MAAM,EAAE;IACd,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;IAChC,GAAG;IACH,CAAC;;IAED;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;I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;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH,SAAS,cAAc,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,QAAQ,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,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;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GAAG;;ICPH;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA,IAAO,SAAS,qBAAqB,CAAC,OAAO,EAAE;IAC/C,EAAE,IAAI,YAAY,GAAG,EAAE,OAAO,IAAI,OAAO,CAAC,YAAY,KAAK,KAAK,CAAC,CAAC;IAClE,EAAE,OAAO,uPAAuP,CAAC,MAAM,CAAC,YAAY,GAAG,aAAa,GAAG,EAAE,EAAE,iLAAiL,CAAC,CAAC,MAAM,CAAC,YAAY,GAAG,aAAa,GAAG,EAAE,EAAE,mEAAmE,CAAC,CAAC,MAAM,CAAC,YAAY,GAAG,aAAa,GAAG,EAAE,EAAE,4UAA4U,CAAC,CAAC,MAAM,CAAC,YAAY,GAAG,aAAa,GAAG,EAAE,EAAE,wLAAwL,CAAC,CAAC,MAAM,CAAC,YAAY,GAAG,aAAa,GAAG,EAAE,EAAE,0pBAA0pB,CAAC,CAAC;IAC/2D,CAAC;IACD;IACA;IACA;IACA;IACA;;AAEA,IAAO,IAAI,kBAAkB,GAAG,qBAAqB,EAAE;;IClBvD;IACA;IACA;IACA;IACA;IACA;IACA;IACA,GA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