MessagesForMacintosh/JS/node_modules/apollo-utilities/lib/bundle.umd.js.map

1 line
77 KiB
Plaintext

{"version":3,"sources":["../src/storeUtils.ts","../src/directives.ts","../src/fragments.ts","../src/util/assign.ts","../src/getFromAST.ts","../src/util/filterInPlace.ts","../src/transform.ts","../src/util/canUse.ts","../src/util/cloneDeep.ts","../src/util/environment.ts","../src/util/errorHandling.ts","../src/util/maybeDeepFreeze.ts","../src/util/mergeDeep.ts","../src/util/warnOnce.ts","../src/util/stripSymbols.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAiDgB,a,CAAc,K,EAAgB;AAC5C,WAAO,CAAC,aAAD,EAAgB,cAAhB,EAAgC,WAAhC,EAA6C,OAA7C,CAAqD,KAAK,CAAC,IAA3D,IAAmE,CAAC,CAA3E;AACD;;AAID,WAAgB,aAAhB,CAA8B,KAA9B,EAA8C;AAC5C,WAAO,CAAC,UAAD,EAAa,YAAb,EAA2B,OAA3B,CAAmC,KAAK,CAAC,IAAzC,IAAiD,CAAC,CAAzD;AACD;;AAED,WAAS,aAAT,CAAuB,KAAvB,EAAuC;AACrC,WAAO,KAAK,CAAC,IAAN,KAAe,aAAtB;AACD;;AAED,WAAS,cAAT,CAAwB,KAAxB,EAAwC;AACtC,WAAO,KAAK,CAAC,IAAN,KAAe,cAAtB;AACD;;AAED,WAAS,UAAT,CAAoB,KAApB,EAAoC;AAClC,WAAO,KAAK,CAAC,IAAN,KAAe,UAAtB;AACD;;AAED,WAAS,YAAT,CAAsB,KAAtB,EAAsC;AACpC,WAAO,KAAK,CAAC,IAAN,KAAe,YAAtB;AACD;;AAED,WAAS,UAAT,CAAoB,KAApB,EAAoC;AAClC,WAAO,KAAK,CAAC,IAAN,KAAe,UAAtB;AACD;;AAED,WAAS,aAAT,CAAuB,KAAvB,EAAuC;AACrC,WAAO,KAAK,CAAC,IAAN,KAAe,aAAtB;A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AC,MAAP,CAAc,EAAd,CAAnB;;AAUA,WAAgB,qBAAhB,CAAsC,GAAtC,EAAmD,IAAnD,EAAgE;AAAb,QAAA,IAAA,KAAA,KAAA,CAAA,EAAA;AAAA,MAAA,IAAA,GAAA,MAAA;AAAa;;AAC9D,QAAI,CAAC,YAAY,EAAb,IAAmB,CAAC,UAAU,CAAC,GAAD,CAAlC,EAAyC;AACvC,UAAI,CAAC,MAAM,EAAX,EAAe;AACb,QAAA,UAAU,CAAC,GAAD,CAAV,GAAkB,IAAlB;AACD;;AACD,UAAI,IAAI,KAAK,OAAb,EAAsB;AACpB,QAAA,OAAO,CAAC,KAAR,CAAc,GAAd;AACD,OAFD,MAEO;AACL,QAAA,OAAO,CAAC,IAAR,CAAa,GAAb;AACD;AACF;AACF;;WCZe,Y,CAAgB,I,EAAO;AACrC,WAAO,IAAI,CAAC,KAAL,CAAW,IAAI,CAAC,SAAL,CAAe,IAAf,CAAX,CAAP;AACD,G","sourcesContent":["import {\n DirectiveNode,\n FieldNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n ObjectValueNode,\n ListValueNode,\n EnumValueNode,\n NullValueNode,\n VariableNode,\n InlineFragmentNode,\n ValueNode,\n SelectionNode,\n NameNode,\n} from 'graphql';\n\nimport stringify from 'fast-json-stable-stringify';\nimport { InvariantError } from 'ts-invariant';\n\nexport interface IdValue {\n type: 'id';\n id: string;\n generated: boolean;\n typename: string | undefined;\n}\n\nexport interface JsonValue {\n type: 'json';\n json: any;\n}\n\nexport type ListValue = Array<null | IdValue>;\n\nexport type StoreValue =\n | number\n | string\n | string[]\n | IdValue\n | ListValue\n | JsonValue\n | null\n | undefined\n | void\n | Object;\n\nexport type ScalarValue = StringValueNode | BooleanValueNode | EnumValueNode;\n\nexport function isScalarValue(value: ValueNode): value is ScalarValue {\n return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1;\n}\n\nexport type NumberValue = IntValueNode | FloatValueNode;\n\nexport function isNumberValue(value: ValueNode): value is NumberValue {\n return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1;\n}\n\nfunction isStringValue(value: ValueNode): value is StringValueNode {\n return value.kind === 'StringValue';\n}\n\nfunction isBooleanValue(value: ValueNode): value is BooleanValueNode {\n return value.kind === 'BooleanValue';\n}\n\nfunction isIntValue(value: ValueNode): value is IntValueNode {\n return value.kind === 'IntValue';\n}\n\nfunction isFloatValue(value: ValueNode): value is FloatValueNode {\n return value.kind === 'FloatValue';\n}\n\nfunction isVariable(value: ValueNode): value is VariableNode {\n return value.kind === 'Variable';\n}\n\nfunction isObjectValue(value: ValueNode): value is ObjectValueNode {\n return value.kind === 'ObjectValue';\n}\n\nfunction isListValue(value: ValueNode): value is ListValueNode {\n return value.kind === 'ListValue';\n}\n\nfunction isEnumValue(value: ValueNode): value is EnumValueNode {\n return value.kind === 'EnumValue';\n}\n\nfunction isNullValue(value: ValueNode): value is NullValueNode {\n return value.kind === 'NullValue';\n}\n\nexport function valueToObjectRepresentation(\n argObj: any,\n name: NameNode,\n value: ValueNode,\n variables?: Object,\n) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n } else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n } else if (isObjectValue(value)) {\n const nestedArgObj = {};\n value.fields.map(obj =>\n valueToObjectRepresentation(nestedArgObj, obj.name, obj.value, variables),\n );\n argObj[name.value] = nestedArgObj;\n } else if (isVariable(value)) {\n const variableValue = (variables || ({} as any))[value.name.value];\n argObj[name.value] = variableValue;\n } else if (isListValue(value)) {\n argObj[name.value] = value.values.map(listValue => {\n const nestedArgArrayObj = {};\n valueToObjectRepresentation(\n nestedArgArrayObj,\n name,\n listValue,\n variables,\n );\n return (nestedArgArrayObj as any)[name.value];\n });\n } else if (isEnumValue(value)) {\n argObj[name.value] = (value as EnumValueNode).value;\n } else if (isNullValue(value)) {\n argObj[name.value] = null;\n } else {\n throw new InvariantError(\n `The inline argument \"${name.value}\" of kind \"${(value as any).kind}\"` +\n 'is not supported. Use variables instead of inline arguments to ' +\n 'overcome this limitation.',\n );\n }\n}\n\nexport function storeKeyNameFromField(\n field: FieldNode,\n variables?: Object,\n): string {\n let directivesObj: any = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach(directive => {\n directivesObj[directive.name.value] = {};\n\n if (directive.arguments) {\n directive.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(\n directivesObj[directive.name.value],\n name,\n value,\n variables,\n ),\n );\n }\n });\n }\n\n let argObj: any = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n }\n\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\n\nexport type Directives = {\n [directiveName: string]: {\n [argName: string]: any;\n };\n};\n\nconst KNOWN_DIRECTIVES: string[] = [\n 'connection',\n 'include',\n 'skip',\n 'client',\n 'rest',\n 'export',\n];\n\nexport function getStoreKeyName(\n fieldName: string,\n args?: Object,\n directives?: Directives,\n): string {\n if (\n directives &&\n directives['connection'] &&\n directives['connection']['key']\n ) {\n if (\n directives['connection']['filter'] &&\n (directives['connection']['filter'] as string[]).length > 0\n ) {\n const filterKeys = directives['connection']['filter']\n ? (directives['connection']['filter'] as string[])\n : [];\n filterKeys.sort();\n\n const queryArgs = args as { [key: string]: any };\n const filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach(key => {\n filteredArgs[key] = queryArgs[key];\n });\n\n return `${directives['connection']['key']}(${JSON.stringify(\n filteredArgs,\n )})`;\n } else {\n return directives['connection']['key'];\n }\n }\n\n let completeFieldName: string = fieldName;\n\n if (args) {\n // We can't use `JSON.stringify` here since it's non-deterministic,\n // and can lead to different store key names being created even though\n // the `args` object used during creation has the same properties/values.\n const stringifiedArgs: string = stringify(args);\n completeFieldName += `(${stringifiedArgs})`;\n }\n\n if (directives) {\n Object.keys(directives).forEach(key => {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += `@${key}(${JSON.stringify(directives[key])})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n}\n\nexport function argumentsObjectFromField(\n field: FieldNode | DirectiveNode,\n variables: Object,\n): Object {\n if (field.arguments && field.arguments.length) {\n const argObj: Object = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n return argObj;\n }\n\n return null;\n}\n\nexport function resultKeyNameFromField(field: FieldNode): string {\n return field.alias ? field.alias.value : field.name.value;\n}\n\nexport function isField(selection: SelectionNode): selection is FieldNode {\n return selection.kind === 'Field';\n}\n\nexport function isInlineFragment(\n selection: SelectionNode,\n): selection is InlineFragmentNode {\n return selection.kind === 'InlineFragment';\n}\n\nexport function isIdValue(idObject: StoreValue): idObject is IdValue {\n return idObject &&\n (idObject as IdValue | JsonValue).type === 'id' &&\n typeof (idObject as IdValue).generated === 'boolean';\n}\n\nexport type IdConfig = {\n id: string;\n typename: string | undefined;\n};\n\nexport function toIdValue(\n idConfig: string | IdConfig,\n generated = false,\n): IdValue {\n return {\n type: 'id',\n generated,\n ...(typeof idConfig === 'string'\n ? { id: idConfig, typename: undefined }\n : idConfig),\n };\n}\n\nexport function isJsonValue(jsonObject: StoreValue): jsonObject is JsonValue {\n return (\n jsonObject != null &&\n typeof jsonObject === 'object' &&\n (jsonObject as IdValue | JsonValue).type === 'json'\n );\n}\n\nfunction defaultValueFromVariable(node: VariableNode) {\n throw new InvariantError(`Variable nodes are not supported by valueFromNode`);\n}\n\nexport type VariableValue = (node: VariableNode) => any;\n\n/**\n * Evaluate a ValueNode and yield its value in its natural JS form.\n */\nexport function valueFromNode(\n node: ValueNode,\n onVariable: VariableValue = defaultValueFromVariable,\n): any {\n switch (node.kind) {\n case 'Variable':\n return onVariable(node);\n case 'NullValue':\n return null;\n case 'IntValue':\n return parseInt(node.value, 10);\n case 'FloatValue':\n return parseFloat(node.value);\n case 'ListValue':\n return node.values.map(v => valueFromNode(v, onVariable));\n case 'ObjectValue': {\n const value: { [key: string]: any } = {};\n for (const field of node.fields) {\n value[field.name.value] = valueFromNode(field.value, onVariable);\n }\n return value;\n }\n default:\n return node.value;\n }\n}\n","// Provides the methods that allow QueryManager to handle the `skip` and\n// `include` directives within GraphQL.\nimport {\n FieldNode,\n SelectionNode,\n VariableNode,\n BooleanValueNode,\n DirectiveNode,\n DocumentNode,\n ArgumentNode,\n ValueNode,\n} from 'graphql';\n\nimport { visit } from 'graphql/language/visitor';\n\nimport { invariant } from 'ts-invariant';\n\nimport { argumentsObjectFromField } from './storeUtils';\n\nexport type DirectiveInfo = {\n [fieldName: string]: { [argName: string]: any };\n};\n\nexport function getDirectiveInfoFromField(\n field: FieldNode,\n variables: Object,\n): DirectiveInfo {\n if (field.directives && field.directives.length) {\n const directiveObj: DirectiveInfo = {};\n field.directives.forEach((directive: DirectiveNode) => {\n directiveObj[directive.name.value] = argumentsObjectFromField(\n directive,\n variables,\n );\n });\n return directiveObj;\n }\n return null;\n}\n\nexport function shouldInclude(\n selection: SelectionNode,\n variables: { [name: string]: any } = {},\n): boolean {\n return getInclusionDirectives(\n selection.directives,\n ).every(({ directive, ifArgument }) => {\n let evaledValue: boolean = false;\n if (ifArgument.value.kind === 'Variable') {\n evaledValue = variables[(ifArgument.value as VariableNode).name.value];\n invariant(\n evaledValue !== void 0,\n `Invalid variable referenced in @${directive.name.value} directive.`,\n );\n } else {\n evaledValue = (ifArgument.value as BooleanValueNode).value;\n }\n return directive.name.value === 'skip' ? !evaledValue : evaledValue;\n });\n}\n\nexport function getDirectiveNames(doc: DocumentNode) {\n const names: string[] = [];\n\n visit(doc, {\n Directive(node) {\n names.push(node.name.value);\n },\n });\n\n return names;\n}\n\nexport function hasDirectives(names: string[], doc: DocumentNode) {\n return getDirectiveNames(doc).some(\n (name: string) => names.indexOf(name) > -1,\n );\n}\n\nexport function hasClientExports(document: DocumentNode) {\n return (\n document &&\n hasDirectives(['client'], document) &&\n hasDirectives(['export'], document)\n );\n}\n\nexport type InclusionDirectives = Array<{\n directive: DirectiveNode;\n ifArgument: ArgumentNode;\n}>;\n\nfunction isInclusionDirective({ name: { value } }: DirectiveNode): boolean {\n return value === 'skip' || value === 'include';\n}\n\nexport function getInclusionDirectives(\n directives: ReadonlyArray<DirectiveNode>,\n): InclusionDirectives {\n return directives ? directives.filter(isInclusionDirective).map(directive => {\n const directiveArguments = directive.arguments;\n const directiveName = directive.name.value;\n\n invariant(\n directiveArguments && directiveArguments.length === 1,\n `Incorrect number of arguments for the @${directiveName} directive.`,\n );\n\n const ifArgument = directiveArguments[0];\n invariant(\n ifArgument.name && ifArgument.name.value === 'if',\n `Invalid argument for the @${directiveName} directive.`,\n );\n\n const ifValue: ValueNode = ifArgument.value;\n\n // means it has to be a variable value if this is a valid @skip or @include directive\n invariant(\n ifValue &&\n (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'),\n `Argument for the @${directiveName} directive must be a variable or a boolean value.`,\n );\n\n return { directive, ifArgument };\n }) : [];\n}\n\n","import { DocumentNode, FragmentDefinitionNode } from 'graphql';\nimport { invariant, InvariantError } from 'ts-invariant';\n\n/**\n * Returns a query document which adds a single query operation that only\n * spreads the target fragment inside of it.\n *\n * So for example a document of:\n *\n * ```graphql\n * fragment foo on Foo { a b c }\n * ```\n *\n * Turns into:\n *\n * ```graphql\n * { ...foo }\n *\n * fragment foo on Foo { a b c }\n * ```\n *\n * The target fragment will either be the only fragment in the document, or a\n * fragment specified by the provided `fragmentName`. If there is more than one\n * fragment, but a `fragmentName` was not defined then an error will be thrown.\n */\nexport function getFragmentQueryDocument(\n document: DocumentNode,\n fragmentName?: string,\n): DocumentNode {\n let actualFragmentName = fragmentName;\n\n // Build an array of all our fragment definitions that will be used for\n // validations. We also do some validations on the other definitions in the\n // document while building this list.\n const fragments: Array<FragmentDefinitionNode> = [];\n document.definitions.forEach(definition => {\n // Throw an error if we encounter an operation definition because we will\n // define our own operation definition later on.\n if (definition.kind === 'OperationDefinition') {\n throw new InvariantError(\n `Found a ${definition.operation} operation${\n definition.name ? ` named '${definition.name.value}'` : ''\n }. ` +\n 'No operations are allowed when using a fragment as a query. Only fragments are allowed.',\n );\n }\n // Add our definition to the fragments array if it is a fragment\n // definition.\n if (definition.kind === 'FragmentDefinition') {\n fragments.push(definition);\n }\n });\n\n // If the user did not give us a fragment name then let us try to get a\n // name from a single fragment in the definition.\n if (typeof actualFragmentName === 'undefined') {\n invariant(\n fragments.length === 1,\n `Found ${\n fragments.length\n } fragments. \\`fragmentName\\` must be provided when there is not exactly 1 fragment.`,\n );\n actualFragmentName = fragments[0].name.value;\n }\n\n // Generate a query document with an operation that simply spreads the\n // fragment inside of it.\n const query: DocumentNode = {\n ...document,\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'FragmentSpread',\n name: {\n kind: 'Name',\n value: actualFragmentName,\n },\n },\n ],\n },\n },\n ...document.definitions,\n ],\n };\n\n return query;\n}\n","/**\n * Adds the properties of one or more source objects to a target object. Works exactly like\n * `Object.assign`, but as a utility to maintain support for IE 11.\n *\n * @see https://github.com/apollostack/apollo-client/pull/1009\n */\nexport function assign<A, B>(a: A, b: B): A & B;\nexport function assign<A, B, C>(a: A, b: B, c: C): A & B & C;\nexport function assign<A, B, C, D>(a: A, b: B, c: C, d: D): A & B & C & D;\nexport function assign<A, B, C, D, E>(\n a: A,\n b: B,\n c: C,\n d: D,\n e: E,\n): A & B & C & D & E;\nexport function assign(target: any, ...sources: Array<any>): any;\nexport function assign(\n target: { [key: string]: any },\n ...sources: Array<{ [key: string]: any }>\n): { [key: string]: any } {\n sources.forEach(source => {\n if (typeof source === 'undefined' || source === null) {\n return;\n }\n Object.keys(source).forEach(key => {\n target[key] = source[key];\n });\n });\n return target;\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { assign } from './util/assign';\n\nimport { valueToObjectRepresentation, JsonValue } from './storeUtils';\n\nexport function getMutationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode {\n checkDocument(doc);\n\n let mutationDef: OperationDefinitionNode | null = doc.definitions.filter(\n definition =>\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation',\n )[0] as OperationDefinitionNode;\n\n invariant(mutationDef, 'Must contain a mutation definition.');\n\n return mutationDef;\n}\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n invariant(\n doc && doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new InvariantError(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n invariant(\n operations.length <= 1,\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n\n return doc;\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationDefinitionOrDie(\n document: DocumentNode,\n): OperationDefinitionNode {\n const def = getOperationDefinition(document);\n invariant(def, `GraphQL document is missing an operation`);\n return def;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n invariant(\n queryDef && queryDef.operation === 'query',\n 'Must contain a query definition.',\n );\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n invariant(\n doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n invariant(\n doc.definitions.length <= 1,\n 'Fragment must have exactly one definition.',\n );\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n invariant(\n fragmentDef.kind === 'FragmentDefinition',\n 'Must be a fragment definition.',\n );\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new InvariantError(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n\n return symTable;\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): { [key: string]: JsonValue } {\n if (\n definition &&\n definition.variableDefinitions &&\n definition.variableDefinitions.length\n ) {\n const defaultValues = definition.variableDefinitions\n .filter(({ defaultValue }) => defaultValue)\n .map(\n ({ variable, defaultValue }): { [key: string]: JsonValue } => {\n const defaultValueObj: { [key: string]: JsonValue } = {};\n valueToObjectRepresentation(\n defaultValueObj,\n variable.name,\n defaultValue as ValueNode,\n );\n\n return defaultValueObj;\n },\n );\n\n return assign({}, ...defaultValues);\n }\n\n return {};\n}\n\n/**\n * Returns the names of all variables declared by the operation.\n */\nexport function variablesInOperation(\n operation: OperationDefinitionNode,\n): Set<string> {\n const names = new Set<string>();\n if (operation.variableDefinitions) {\n for (const definition of operation.variableDefinitions) {\n names.add(definition.variable.name.value);\n }\n }\n\n return names;\n}\n","export function filterInPlace<T>(\n array: T[],\n test: (elem: T) => boolean,\n context?: any,\n): T[] {\n let target = 0;\n array.forEach(function (elem, i) {\n if (test.call(this, elem, i, array)) {\n array[target++] = elem;\n }\n }, context);\n array.length = target;\n return array;\n}\n","import {\n DocumentNode,\n SelectionNode,\n SelectionSetNode,\n OperationDefinitionNode,\n FieldNode,\n DirectiveNode,\n FragmentDefinitionNode,\n ArgumentNode,\n FragmentSpreadNode,\n VariableDefinitionNode,\n VariableNode,\n} from 'graphql';\nimport { visit } from 'graphql/language/visitor';\n\nimport {\n checkDocument,\n getOperationDefinition,\n getFragmentDefinition,\n getFragmentDefinitions,\n createFragmentMap,\n FragmentMap,\n getMainDefinition,\n} from './getFromAST';\nimport { filterInPlace } from './util/filterInPlace';\nimport { invariant } from 'ts-invariant';\nimport { isField, isInlineFragment } from './storeUtils';\n\nexport type RemoveNodeConfig<N> = {\n name?: string;\n test?: (node: N) => boolean;\n remove?: boolean;\n};\n\nexport type GetNodeConfig<N> = {\n name?: string;\n test?: (node: N) => boolean;\n};\n\nexport type RemoveDirectiveConfig = RemoveNodeConfig<DirectiveNode>;\nexport type GetDirectiveConfig = GetNodeConfig<DirectiveNode>;\nexport type RemoveArgumentsConfig = RemoveNodeConfig<ArgumentNode>;\nexport type GetFragmentSpreadConfig = GetNodeConfig<FragmentSpreadNode>;\nexport type RemoveFragmentSpreadConfig = RemoveNodeConfig<FragmentSpreadNode>;\nexport type RemoveFragmentDefinitionConfig = RemoveNodeConfig<\n FragmentDefinitionNode\n>;\nexport type RemoveVariableDefinitionConfig = RemoveNodeConfig<\n VariableDefinitionNode\n>;\n\nconst TYPENAME_FIELD: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: '__typename',\n },\n};\n\nfunction isEmpty(\n op: OperationDefinitionNode | FragmentDefinitionNode,\n fragments: FragmentMap,\n): boolean {\n return op.selectionSet.selections.every(\n selection =>\n selection.kind === 'FragmentSpread' &&\n isEmpty(fragments[selection.name.value], fragments),\n );\n}\n\nfunction nullIfDocIsEmpty(doc: DocumentNode) {\n return isEmpty(\n getOperationDefinition(doc) || getFragmentDefinition(doc),\n createFragmentMap(getFragmentDefinitions(doc)),\n )\n ? null\n : doc;\n}\n\nfunction getDirectiveMatcher(\n directives: (RemoveDirectiveConfig | GetDirectiveConfig)[],\n) {\n return function directiveMatcher(directive: DirectiveNode) {\n return directives.some(\n dir =>\n (dir.name && dir.name === directive.name.value) ||\n (dir.test && dir.test(directive)),\n );\n };\n}\n\nexport function removeDirectivesFromDocument(\n directives: RemoveDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode | null {\n const variablesInUse: Record<string, boolean> = Object.create(null);\n let variablesToRemove: RemoveArgumentsConfig[] = [];\n\n const fragmentSpreadsInUse: Record<string, boolean> = Object.create(null);\n let fragmentSpreadsToRemove: RemoveFragmentSpreadConfig[] = [];\n\n let modifiedDoc = nullIfDocIsEmpty(\n visit(doc, {\n Variable: {\n enter(node, _key, parent) {\n // Store each variable that's referenced as part of an argument\n // (excluding operation definition variables), so we know which\n // variables are being used. If we later want to remove a variable\n // we'll fist check to see if it's being used, before continuing with\n // the removal.\n if (\n (parent as VariableDefinitionNode).kind !== 'VariableDefinition'\n ) {\n variablesInUse[node.name.value] = true;\n }\n },\n },\n\n Field: {\n enter(node) {\n if (directives && node.directives) {\n // If `remove` is set to true for a directive, and a directive match\n // is found for a field, remove the field as well.\n const shouldRemoveField = directives.some(\n directive => directive.remove,\n );\n\n if (\n shouldRemoveField &&\n node.directives &&\n node.directives.some(getDirectiveMatcher(directives))\n ) {\n if (node.arguments) {\n // Store field argument variables so they can be removed\n // from the operation definition.\n node.arguments.forEach(arg => {\n if (arg.value.kind === 'Variable') {\n variablesToRemove.push({\n name: (arg.value as VariableNode).name.value,\n });\n }\n });\n }\n\n if (node.selectionSet) {\n // Store fragment spread names so they can be removed from the\n // docuemnt.\n getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(\n frag => {\n fragmentSpreadsToRemove.push({\n name: frag.name.value,\n });\n },\n );\n }\n\n // Remove the field.\n return null;\n }\n }\n },\n },\n\n FragmentSpread: {\n enter(node) {\n // Keep track of referenced fragment spreads. This is used to\n // determine if top level fragment definitions should be removed.\n fragmentSpreadsInUse[node.name.value] = true;\n },\n },\n\n Directive: {\n enter(node) {\n // If a matching directive is found, remove it.\n if (getDirectiveMatcher(directives)(node)) {\n return null;\n }\n },\n },\n }),\n );\n\n // If we've removed fields with arguments, make sure the associated\n // variables are also removed from the rest of the document, as long as they\n // aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(variablesToRemove, v => !variablesInUse[v.name]).length\n ) {\n modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc);\n }\n\n // If we've removed selection sets with fragment spreads, make sure the\n // associated fragment definitions are also removed from the rest of the\n // document, as long as they aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(fragmentSpreadsToRemove, fs => !fragmentSpreadsInUse[fs.name])\n .length\n ) {\n modifiedDoc = removeFragmentSpreadFromDocument(\n fragmentSpreadsToRemove,\n modifiedDoc,\n );\n }\n\n return modifiedDoc;\n}\n\nexport function addTypenameToDocument(doc: DocumentNode): DocumentNode {\n return visit(checkDocument(doc), {\n SelectionSet: {\n enter(node, _key, parent) {\n // Don't add __typename to OperationDefinitions.\n if (\n parent &&\n (parent as OperationDefinitionNode).kind === 'OperationDefinition'\n ) {\n return;\n }\n\n // No changes if no selections.\n const { selections } = node;\n if (!selections) {\n return;\n }\n\n // If selections already have a __typename, or are part of an\n // introspection query, do nothing.\n const skip = selections.some(selection => {\n return (\n isField(selection) &&\n (selection.name.value === '__typename' ||\n selection.name.value.lastIndexOf('__', 0) === 0)\n );\n });\n if (skip) {\n return;\n }\n\n // If this SelectionSet is @export-ed as an input variable, it should\n // not have a __typename field (see issue #4691).\n const field = parent as FieldNode;\n if (\n isField(field) &&\n field.directives &&\n field.directives.some(d => d.name.value === 'export')\n ) {\n return;\n }\n\n // Create and return a new SelectionSet with a __typename Field.\n return {\n ...node,\n selections: [...selections, TYPENAME_FIELD],\n };\n },\n },\n });\n}\n\nconst connectionRemoveConfig = {\n test: (directive: DirectiveNode) => {\n const willRemove = directive.name.value === 'connection';\n if (willRemove) {\n if (\n !directive.arguments ||\n !directive.arguments.some(arg => arg.name.value === 'key')\n ) {\n invariant.warn(\n 'Removing an @connection directive even though it does not have a key. ' +\n 'You may want to use the key parameter to specify a store key.',\n );\n }\n }\n\n return willRemove;\n },\n};\n\nexport function removeConnectionDirectiveFromDocument(doc: DocumentNode) {\n return removeDirectivesFromDocument(\n [connectionRemoveConfig],\n checkDocument(doc),\n );\n}\n\nfunction hasDirectivesInSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode,\n nestedCheck = true,\n): boolean {\n return (\n selectionSet &&\n selectionSet.selections &&\n selectionSet.selections.some(selection =>\n hasDirectivesInSelection(directives, selection, nestedCheck),\n )\n );\n}\n\nfunction hasDirectivesInSelection(\n directives: GetDirectiveConfig[],\n selection: SelectionNode,\n nestedCheck = true,\n): boolean {\n if (!isField(selection)) {\n return true;\n }\n\n if (!selection.directives) {\n return false;\n }\n\n return (\n selection.directives.some(getDirectiveMatcher(directives)) ||\n (nestedCheck &&\n hasDirectivesInSelectionSet(\n directives,\n selection.selectionSet,\n nestedCheck,\n ))\n );\n}\n\nexport function getDirectivesFromDocument(\n directives: GetDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode {\n checkDocument(doc);\n\n let parentPath: string;\n\n return nullIfDocIsEmpty(\n visit(doc, {\n SelectionSet: {\n enter(node, _key, _parent, path) {\n const currentPath = path.join('-');\n\n if (\n !parentPath ||\n currentPath === parentPath ||\n !currentPath.startsWith(parentPath)\n ) {\n if (node.selections) {\n const selectionsWithDirectives = node.selections.filter(\n selection => hasDirectivesInSelection(directives, selection),\n );\n\n if (hasDirectivesInSelectionSet(directives, node, false)) {\n parentPath = currentPath;\n }\n\n return {\n ...node,\n selections: selectionsWithDirectives,\n };\n } else {\n return null;\n }\n }\n },\n },\n }),\n );\n}\n\nfunction getArgumentMatcher(config: RemoveArgumentsConfig[]) {\n return function argumentMatcher(argument: ArgumentNode) {\n return config.some(\n (aConfig: RemoveArgumentsConfig) =>\n argument.value &&\n argument.value.kind === 'Variable' &&\n argument.value.name &&\n (aConfig.name === argument.value.name.value ||\n (aConfig.test && aConfig.test(argument))),\n );\n };\n}\n\nexport function removeArgumentsFromDocument(\n config: RemoveArgumentsConfig[],\n doc: DocumentNode,\n): DocumentNode {\n const argMatcher = getArgumentMatcher(config);\n\n return nullIfDocIsEmpty(\n visit(doc, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n // Remove matching top level variables definitions.\n variableDefinitions: node.variableDefinitions.filter(\n varDef =>\n !config.some(arg => arg.name === varDef.variable.name.value),\n ),\n };\n },\n },\n\n Field: {\n enter(node) {\n // If `remove` is set to true for an argument, and an argument match\n // is found for a field, remove the field as well.\n const shouldRemoveField = config.some(argConfig => argConfig.remove);\n\n if (shouldRemoveField) {\n let argMatchCount = 0;\n node.arguments.forEach(arg => {\n if (argMatcher(arg)) {\n argMatchCount += 1;\n }\n });\n if (argMatchCount === 1) {\n return null;\n }\n }\n },\n },\n\n Argument: {\n enter(node) {\n // Remove all matching arguments.\n if (argMatcher(node)) {\n return null;\n }\n },\n },\n }),\n );\n}\n\nexport function removeFragmentSpreadFromDocument(\n config: RemoveFragmentSpreadConfig[],\n doc: DocumentNode,\n): DocumentNode {\n function enter(\n node: FragmentSpreadNode | FragmentDefinitionNode,\n ): null | void {\n if (config.some(def => def.name === node.name.value)) {\n return null;\n }\n }\n\n return nullIfDocIsEmpty(\n visit(doc, {\n FragmentSpread: { enter },\n FragmentDefinition: { enter },\n }),\n );\n}\n\nfunction getAllFragmentSpreadsFromSelectionSet(\n selectionSet: SelectionSetNode,\n): FragmentSpreadNode[] {\n const allFragments: FragmentSpreadNode[] = [];\n\n selectionSet.selections.forEach(selection => {\n if (\n (isField(selection) || isInlineFragment(selection)) &&\n selection.selectionSet\n ) {\n getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(\n frag => allFragments.push(frag),\n );\n } else if (selection.kind === 'FragmentSpread') {\n allFragments.push(selection);\n }\n });\n\n return allFragments;\n}\n\n// If the incoming document is a query, return it as is. Otherwise, build a\n// new document containing a query operation based on the selection set\n// of the previous main operation.\nexport function buildQueryFromSelectionSet(\n document: DocumentNode,\n): DocumentNode {\n const definition = getMainDefinition(document);\n const definitionOperation = (<OperationDefinitionNode>definition).operation;\n\n if (definitionOperation === 'query') {\n // Already a query, so return the existing document.\n return document;\n }\n\n // Build a new query using the selection set of the main operation.\n const modifiedDoc = visit(document, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n operation: 'query',\n };\n },\n },\n });\n return modifiedDoc;\n}\n\n// Remove fields / selection sets that include an @client directive.\nexport function removeClientSetsFromDocument(\n document: DocumentNode,\n): DocumentNode | null {\n checkDocument(document);\n\n let modifiedDoc = removeDirectivesFromDocument(\n [\n {\n test: (directive: DirectiveNode) => directive.name.value === 'client',\n remove: true,\n },\n ],\n document,\n );\n\n // After a fragment definition has had its @client related document\n // sets removed, if the only field it has left is a __typename field,\n // remove the entire fragment operation to prevent it from being fired\n // on the server.\n if (modifiedDoc) {\n modifiedDoc = visit(modifiedDoc, {\n FragmentDefinition: {\n enter(node) {\n if (node.selectionSet) {\n const isTypenameOnly = node.selectionSet.selections.every(\n selection =>\n isField(selection) && selection.name.value === '__typename',\n );\n if (isTypenameOnly) {\n return null;\n }\n }\n },\n },\n });\n }\n\n return modifiedDoc;\n}\n","export const canUseWeakMap = typeof WeakMap === 'function' && !(\n typeof navigator === 'object' &&\n navigator.product === 'ReactNative'\n);\n","const { toString } = Object.prototype;\n\n/**\n * Deeply clones a value to create a new instance.\n */\nexport function cloneDeep<T>(value: T): T {\n return cloneDeepHelper(value, new Map());\n}\n\nfunction cloneDeepHelper<T>(val: T, seen: Map<any, any>): T {\n switch (toString.call(val)) {\n case \"[object Array]\": {\n if (seen.has(val)) return seen.get(val);\n const copy: T & any[] = (val as any).slice(0);\n seen.set(val, copy);\n copy.forEach(function (child, i) {\n copy[i] = cloneDeepHelper(child, seen);\n });\n return copy;\n }\n\n case \"[object Object]\": {\n if (seen.has(val)) return seen.get(val);\n // High fidelity polyfills of Object.create and Object.getPrototypeOf are\n // possible in all JS environments, so we will assume they exist/work.\n const copy = Object.create(Object.getPrototypeOf(val));\n seen.set(val, copy);\n Object.keys(val).forEach(key => {\n copy[key] = cloneDeepHelper((val as any)[key], seen);\n });\n return copy;\n }\n\n default:\n return val;\n }\n}\n","export function getEnv(): string | undefined {\n if (typeof process !== 'undefined' && process.env.NODE_ENV) {\n return process.env.NODE_ENV;\n }\n\n // default environment\n return 'development';\n}\n\nexport function isEnv(env: string): boolean {\n return getEnv() === env;\n}\n\nexport function isProduction(): boolean {\n return isEnv('production') === true;\n}\n\nexport function isDevelopment(): boolean {\n return isEnv('development') === true;\n}\n\nexport function isTest(): boolean {\n return isEnv('test') === true;\n}\n","import { ExecutionResult } from 'graphql';\n\nexport function tryFunctionOrLogError(f: Function) {\n try {\n return f();\n } catch (e) {\n if (console.error) {\n console.error(e);\n }\n }\n}\n\nexport function graphQLResultHasError(result: ExecutionResult) {\n return result.errors && result.errors.length;\n}\n","import { isDevelopment, isTest } from './environment';\n\n// Taken (mostly) from https://github.com/substack/deep-freeze to avoid\n// import hassles with rollup.\nfunction deepFreeze(o: any) {\n Object.freeze(o);\n\n Object.getOwnPropertyNames(o).forEach(function(prop) {\n if (\n o[prop] !== null &&\n (typeof o[prop] === 'object' || typeof o[prop] === 'function') &&\n !Object.isFrozen(o[prop])\n ) {\n deepFreeze(o[prop]);\n }\n });\n\n return o;\n}\n\nexport function maybeDeepFreeze(obj: any) {\n if (isDevelopment() || isTest()) {\n // Polyfilled Symbols potentially cause infinite / very deep recursion while deep freezing\n // which is known to crash IE11 (https://github.com/apollographql/apollo-client/issues/3043).\n const symbolIsPolyfilled =\n typeof Symbol === 'function' && typeof Symbol('') === 'string';\n\n if (!symbolIsPolyfilled) {\n return deepFreeze(obj);\n }\n }\n return obj;\n}\n","const { hasOwnProperty } = Object.prototype;\n\n// These mergeDeep and mergeDeepArray utilities merge any number of objects\n// together, sharing as much memory as possible with the source objects, while\n// remaining careful to avoid modifying any source objects.\n\n// Logically, the return type of mergeDeep should be the intersection of\n// all the argument types. The binary call signature is by far the most\n// common, but we support 0- through 5-ary as well. After that, the\n// resulting type is just the inferred array element type. Note to nerds:\n// there is a more clever way of doing this that converts the tuple type\n// first to a union type (easy enough: T[number]) and then converts the\n// union to an intersection type using distributive conditional type\n// inference, but that approach has several fatal flaws (boolean becomes\n// true & false, and the inferred type ends up as unknown in many cases),\n// in addition to being nearly impossible to explain/understand.\nexport type TupleToIntersection<T extends any[]> =\n T extends [infer A] ? A :\n T extends [infer A, infer B] ? A & B :\n T extends [infer A, infer B, infer C] ? A & B & C :\n T extends [infer A, infer B, infer C, infer D] ? A & B & C & D :\n T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E :\n T extends (infer U)[] ? U : any;\n\nexport function mergeDeep<T extends any[]>(\n ...sources: T\n): TupleToIntersection<T> {\n return mergeDeepArray(sources);\n}\n\n// In almost any situation where you could succeed in getting the\n// TypeScript compiler to infer a tuple type for the sources array, you\n// could just use mergeDeep instead of mergeDeepArray, so instead of\n// trying to convert T[] to an intersection type we just infer the array\n// element type, which works perfectly when the sources array has a\n// consistent element type.\nexport function mergeDeepArray<T>(sources: T[]): T {\n let target = sources[0] || {} as T;\n const count = sources.length;\n if (count > 1) {\n const pastCopies: any[] = [];\n target = shallowCopyForMerge(target, pastCopies);\n for (let i = 1; i < count; ++i) {\n target = mergeHelper(target, sources[i], pastCopies);\n }\n }\n return target;\n}\n\nfunction isObject(obj: any): obj is Record<string | number, any> {\n return obj !== null && typeof obj === 'object';\n}\n\nfunction mergeHelper(\n target: any,\n source: any,\n pastCopies: any[],\n) {\n if (isObject(source) && isObject(target)) {\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 (hasOwnProperty.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, since it's safe to modify copies created earlier in\n // the merge. We use an array for pastCopies instead of a Map or Set,\n // since the number of copies should be relatively small, and some\n // Map/Set 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 return target;\n }\n\n // If source (or target) is not an object, let source replace target.\n return source;\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 = {\n __proto__: Object.getPrototypeOf(value),\n ...value,\n };\n }\n pastCopies.push(value);\n }\n return value;\n}\n","import { isProduction, isTest } from './environment';\n\nconst haveWarned = Object.create({});\n\n/**\n * Print a warning only once in development.\n * In production no warnings are printed.\n * In test all warnings are printed.\n *\n * @param msg The warning message\n * @param type warn or error (will call console.warn or console.error)\n */\nexport function warnOnceInDevelopment(msg: string, type = 'warn') {\n if (!isProduction() && !haveWarned[msg]) {\n if (!isTest()) {\n haveWarned[msg] = true;\n }\n if (type === 'error') {\n console.error(msg);\n } else {\n console.warn(msg);\n }\n }\n}\n","/**\n * In order to make assertions easier, this function strips `symbol`'s from\n * the incoming data.\n *\n * This can be handy when running tests against `apollo-client` for example,\n * since it adds `symbol`'s to the data in the store. Jest's `toEqual`\n * function now covers `symbol`'s (https://github.com/facebook/jest/pull/3437),\n * which means all test data used in a `toEqual` comparison would also have to\n * include `symbol`'s, to pass. By stripping `symbol`'s from the cache data\n * we can compare against more simplified test data.\n */\nexport function stripSymbols<T>(data: T): T {\n return JSON.parse(JSON.stringify(data));\n}\n"]}