@apollo/client 3.8.5 → 3.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/apollo-client.cjs +114 -74
  2. package/apollo-client.cjs.map +1 -1
  3. package/apollo-client.min.cjs +1 -1
  4. package/cache/cache.cjs +46 -11
  5. package/cache/cache.cjs.map +1 -1
  6. package/cache/cache.cjs.native.js +46 -11
  7. package/cache/core/types/common.d.ts +2 -2
  8. package/cache/core/types/common.d.ts.map +1 -1
  9. package/cache/core/types/common.js.map +1 -1
  10. package/cache/inmemory/entityStore.d.ts.map +1 -1
  11. package/cache/inmemory/entityStore.js +35 -0
  12. package/cache/inmemory/entityStore.js.map +1 -1
  13. package/cache/inmemory/key-extractor.js +1 -1
  14. package/cache/inmemory/policies.js +4 -4
  15. package/cache/inmemory/readFromStore.js +2 -2
  16. package/cache/inmemory/writeToStore.js +4 -4
  17. package/core/ApolloClient.js +3 -3
  18. package/core/LocalState.js +2 -2
  19. package/core/ObservableQuery.js +5 -5
  20. package/core/QueryManager.js +9 -9
  21. package/core/core.cjs +20 -20
  22. package/core/core.cjs.map +1 -1
  23. package/core/core.cjs.native.js +20 -20
  24. package/dev/dev.cjs +97 -82
  25. package/dev/dev.cjs.map +1 -1
  26. package/dev/dev.cjs.native.js +97 -82
  27. package/dev/loadErrorMessageHandler.js +1 -1
  28. package/dev/loadErrorMessageHandler.js.map +1 -1
  29. package/invariantErrorCodes.js +95 -80
  30. package/link/core/ApolloLink.js +2 -2
  31. package/link/core/core.cjs +2 -2
  32. package/link/core/core.cjs.map +1 -1
  33. package/link/core/core.cjs.native.js +2 -2
  34. package/link/http/checkFetcher.js +1 -1
  35. package/link/http/createHttpLink.js +1 -1
  36. package/link/http/http.cjs +3 -3
  37. package/link/http/http.cjs.map +1 -1
  38. package/link/http/http.cjs.native.js +3 -3
  39. package/link/http/serializeFetchParameter.js +1 -1
  40. package/link/persisted-queries/index.js +2 -2
  41. package/link/persisted-queries/persisted-queries.cjs +2 -2
  42. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  43. package/link/persisted-queries/persisted-queries.cjs.native.js +2 -2
  44. package/link/utils/toPromise.js +1 -1
  45. package/link/utils/utils.cjs +2 -2
  46. package/link/utils/utils.cjs.map +1 -1
  47. package/link/utils/utils.cjs.native.js +2 -2
  48. package/link/utils/validateOperation.js +1 -1
  49. package/package.json +21 -21
  50. package/react/cache/QueryReference.d.ts.map +1 -1
  51. package/react/cache/QueryReference.js +7 -2
  52. package/react/cache/QueryReference.js.map +1 -1
  53. package/react/context/ApolloConsumer.js +1 -1
  54. package/react/context/ApolloContext.js +1 -1
  55. package/react/context/ApolloProvider.js +1 -1
  56. package/react/context/context.cjs +3 -3
  57. package/react/context/context.cjs.map +1 -1
  58. package/react/context/context.cjs.native.js +3 -3
  59. package/react/hoc/hoc-utils.js +1 -1
  60. package/react/hoc/hoc.cjs +2 -2
  61. package/react/hoc/hoc.cjs.map +1 -1
  62. package/react/hoc/hoc.cjs.native.js +2 -2
  63. package/react/hoc/withApollo.js +1 -1
  64. package/react/hooks/hooks.cjs +15 -10
  65. package/react/hooks/hooks.cjs.map +1 -1
  66. package/react/hooks/hooks.cjs.native.js +15 -10
  67. package/react/hooks/useApolloClient.js +1 -1
  68. package/react/hooks/useQuery.js +1 -1
  69. package/react/hooks/useReadQuery.js +1 -1
  70. package/react/hooks/useSubscription.js +2 -2
  71. package/react/hooks/useSuspenseQuery.js +2 -2
  72. package/react/hooks/useSyncExternalStore.js +1 -1
  73. package/react/parser/index.js +5 -5
  74. package/react/parser/parser.cjs +5 -5
  75. package/react/parser/parser.cjs.map +1 -1
  76. package/react/parser/parser.cjs.native.js +5 -5
  77. package/testing/core/core.cjs +1 -1
  78. package/testing/core/core.cjs.map +1 -1
  79. package/testing/core/core.cjs.native.js +1 -1
  80. package/testing/core/mocking/mockLink.js +1 -1
  81. package/testing/react/MockedProvider.d.ts +1 -0
  82. package/testing/react/MockedProvider.d.ts.map +1 -1
  83. package/testing/react/MockedProvider.js +2 -1
  84. package/testing/react/MockedProvider.js.map +1 -1
  85. package/testing/testing.cjs +2 -1
  86. package/testing/testing.cjs.map +1 -1
  87. package/testing/testing.cjs.native.js +2 -1
  88. package/utilities/globals/globals.cjs +1 -1
  89. package/utilities/globals/globals.cjs.map +1 -1
  90. package/utilities/globals/globals.cjs.native.js +1 -1
  91. package/utilities/graphql/DocumentTransform.js +1 -1
  92. package/utilities/graphql/directives.js +4 -4
  93. package/utilities/graphql/fragments.js +3 -3
  94. package/utilities/graphql/getFromAST.js +8 -8
  95. package/utilities/graphql/storeUtils.d.ts +5 -0
  96. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  97. package/utilities/graphql/storeUtils.js +1 -1
  98. package/utilities/graphql/storeUtils.js.map +1 -1
  99. package/utilities/graphql/transform.js +2 -2
  100. package/utilities/index.d.ts +1 -1
  101. package/utilities/index.d.ts.map +1 -1
  102. package/utilities/index.js.map +1 -1
  103. package/utilities/utilities.cjs +19 -19
  104. package/utilities/utilities.cjs.map +1 -1
  105. package/utilities/utilities.cjs.native.js +19 -19
  106. package/version.js +1 -1
@@ -1,16 +1,16 @@
1
1
  import { invariant, newInvariantError } from "../globals/index.js";
2
2
  import { valueToObjectRepresentation } from "./storeUtils.js";
3
3
  export function checkDocument(doc) {
4
- invariant(doc && doc.kind === "Document", 71);
4
+ invariant(doc && doc.kind === "Document", 73);
5
5
  var operations = doc.definitions
6
6
  .filter(function (d) { return d.kind !== "FragmentDefinition"; })
7
7
  .map(function (definition) {
8
8
  if (definition.kind !== "OperationDefinition") {
9
- throw newInvariantError(72, definition.kind);
9
+ throw newInvariantError(74, definition.kind);
10
10
  }
11
11
  return definition;
12
12
  });
13
- invariant(operations.length <= 1, 73, operations.length);
13
+ invariant(operations.length <= 1, 75, operations.length);
14
14
  return doc;
15
15
  }
16
16
  export function getOperationDefinition(doc) {
@@ -33,14 +33,14 @@ export function getFragmentDefinitions(doc) {
33
33
  }
34
34
  export function getQueryDefinition(doc) {
35
35
  var queryDef = getOperationDefinition(doc);
36
- invariant(queryDef && queryDef.operation === "query", 74);
36
+ invariant(queryDef && queryDef.operation === "query", 76);
37
37
  return queryDef;
38
38
  }
39
39
  export function getFragmentDefinition(doc) {
40
- invariant(doc.kind === "Document", 75);
41
- invariant(doc.definitions.length <= 1, 76);
40
+ invariant(doc.kind === "Document", 77);
41
+ invariant(doc.definitions.length <= 1, 78);
42
42
  var fragmentDef = doc.definitions[0];
43
- invariant(fragmentDef.kind === "FragmentDefinition", 77);
43
+ invariant(fragmentDef.kind === "FragmentDefinition", 79);
44
44
  return fragmentDef;
45
45
  }
46
46
  export function getMainDefinition(queryDoc) {
@@ -63,7 +63,7 @@ export function getMainDefinition(queryDoc) {
63
63
  if (fragmentDefinition) {
64
64
  return fragmentDefinition;
65
65
  }
66
- throw newInvariantError(78);
66
+ throw newInvariantError(80);
67
67
  }
68
68
  export function getDefaultValues(definition) {
69
69
  var defaultValues = Object.create(null);
@@ -10,6 +10,11 @@ export interface StoreObject {
10
10
  __typename?: string;
11
11
  [storeFieldName: string]: StoreValue;
12
12
  }
13
+ export type AsStoreObject<T extends {
14
+ __typename?: string;
15
+ }> = {
16
+ [K in keyof T]: T[K];
17
+ };
13
18
  export declare function isDocumentNode(value: any): value is DocumentNode;
14
19
  export declare function valueToObjectRepresentation(argObj: any, name: NameNode, value: ValueNode, variables?: Object): void;
15
20
  export declare function storeKeyNameFromField(field: FieldNode, variables?: Object): string;
@@ -1 +1 @@
1
- {"version":3,"file":"storeUtils.d.ts","sourceRoot":"","sources":["../../../src/utilities/graphql/storeUtils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EAST,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,YAAY,EAEb,MAAM,SAAS,CAAC;AAGjB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,C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AAS,CA4BpB;AAED,wBAAgB,OAAO,CAAC,SAAS,EAAE,aAAa,GAAG,SAAS,IAAI,SAAS,CAExE;AAED,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,aAAa,GACvB,SAAS,IAAI,kBAAkB,CAEjC;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,YAAY,KAAK,GAAG,CAAC"}
@@ -71,7 +71,7 @@ export function valueToObjectRepresentation(argObj, name, value, variables) {
71
71
  argObj[name.value] = null;
72
72
  }
73
73
  else {
74
- throw newInvariantError(79, name.value, value.kind);
74
+ throw newInvariantError(81, name.value, value.kind);
75
75
  }
76
76
  }
77
77
  export function storeKeyNameFromField(field, variables) {
@@ -1 +1 @@
1
- {"version":3,"file":"storeUtils.js","sourceRoot":"","sources":["../../../src/utilities/graphql/storeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAuBxD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAM1D,MAAM,UAAU,aAAa,CAAC,EAAU;IACtC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,GAAQ;IAClC,OAAO,OAAO,CACZ,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,KAAK,KAAK,QAAQ,CAChE,CAAC;AACJ,CAAC;AAkBD,MAAM,UAAU,cAAc,CAAC,KAAU;IACvC,OAAO,CACL,eAAe,CAAC,KAAK,CAAC;QACrB,KAAsB,CAAC,IAAI,KAAK,UAAU;QAC3C,KAAK,CAAC,OAAO,CAAE,KAAsB,CAAC,WAAW,CAAC,CACnD,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,KAAgB;IACrC,OAAO,KAAK,CAAC,IAAI,K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AAU,OAAO,CAAC,SAAwB;IAC9C,OAAO,SAAS,CAAC,IAAI,KAAK,OAAO,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,SAAwB;IAExB,OAAO,SAAS,CAAC,IAAI,KAAK,gBAAgB,CAAC;AAC7C,CAAC","sourcesContent":["import { newInvariantError } from \"../globals/index.js\";\n\nimport type {\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 SelectionSetNode,\n DocumentNode,\n FragmentSpreadNode,\n} from \"graphql\";\n\nimport { isNonNullObject } from \"../common/objects.js\";\nimport type { FragmentMap } from \"./fragments.js\";\nimport { getFragmentFromSelection } from \"./fragments.js\";\n\nexport interface Reference {\n readonly __ref: string;\n}\n\nexport function makeReference(id: string): Reference {\n return { __ref: String(id) };\n}\n\nexport function isReference(obj: any): obj is Reference {\n return Boolean(\n obj && typeof obj === \"object\" && typeof obj.__ref === \"string\"\n );\n}\n\nexport type StoreValue =\n | number\n | string\n | string[]\n | Reference\n | Reference[]\n | null\n | undefined\n | void\n | Object;\n\nexport interface StoreObject {\n __typename?: string;\n [storeFieldName: string]: StoreValue;\n}\n\nexport function isDocumentNode(value: any): value is DocumentNode {\n return (\n isNonNullObject(value) &&\n (value as DocumentNode).kind === \"Document\" &&\n Array.isArray((value as DocumentNode).definitions)\n );\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 newInvariantError(\n `The inline argument \"%s\" of kind \"%s\"` +\n \"is not supported. Use variables instead of inline arguments to \" +\n \"overcome this limitation.\",\n name.value,\n (value as any).kind\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 \"nonreactive\",\n];\n\nexport const getStoreKeyName = Object.assign(\n function (\n fieldName: string,\n args?: Record<string, any> | null,\n directives?: Directives\n ): string {\n if (\n args &&\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 filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach((key) => {\n filteredArgs[key] = args[key];\n });\n\n return `${directives[\"connection\"][\"key\"]}(${stringify(filteredArgs)})`;\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}(${stringify(directives[key])})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n },\n {\n setStringify(s: typeof stringify) {\n const previous = stringify;\n stringify = s;\n return previous;\n },\n }\n);\n\n// Default stable JSON.stringify implementation. Can be updated/replaced with\n// something better by calling getStoreKeyName.setStringify.\nlet stringify = function defaultStringify(value: any): string {\n return JSON.stringify(value, stringifyReplacer);\n};\n\nfunction stringifyReplacer(_key: string, value: any): any {\n if (isNonNullObject(value) && !Array.isArray(value)) {\n value = Object.keys(value)\n .sort()\n .reduce(\n (copy, key) => {\n copy[key] = value[key];\n return copy;\n },\n {} as Record<string, any>\n );\n }\n return value;\n}\n\nexport function argumentsObjectFromField(\n field: FieldNode | DirectiveNode,\n variables?: Record<string, any>\n): Object | null {\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 return null;\n}\n\nexport function resultKeyNameFromField(field: FieldNode): string {\n return field.alias ? field.alias.value : field.name.value;\n}\n\nexport function getTypenameFromResult(\n result: Record<string, any>,\n selectionSet: SelectionSetNode,\n fragmentMap?: FragmentMap\n): string | undefined {\n let fragments: undefined | Array<InlineFragmentNode | FragmentSpreadNode>;\n for (const selection of selectionSet.selections) {\n if (isField(selection)) {\n if (selection.name.value === \"__typename\") {\n return result[resultKeyNameFromField(selection)];\n }\n } else if (fragments) {\n fragments.push(selection);\n } else {\n fragments = [selection];\n }\n }\n if (typeof result.__typename === \"string\") {\n return result.__typename;\n }\n if (fragments) {\n for (const selection of fragments) {\n const typename = getTypenameFromResult(\n result,\n getFragmentFromSelection(selection, fragmentMap)!.selectionSet,\n fragmentMap\n );\n if (typeof typename === \"string\") {\n return typename;\n }\n }\n }\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 type VariableValue = (node: VariableNode) => any;\n"]}
1
+ {"version":3,"file":"storeUtils.js","sourceRoot":"","sources":["../../../src/utilities/graphql/storeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAuBxD,OAAO,E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sBAAsB,CAAC,SAAS,CAAC,CAAC,CAAC;aAClD;SACF;aAAM,IAAI,SAAS,EAAE;YACpB,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SAC3B;aAAM;YACL,SAAS,GAAG,CAAC,SAAS,CAAC,CAAC;SACzB;KACF;IACD,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,QAAQ,EAAE;QACzC,OAAO,MAAM,CAAC,UAAU,CAAC;KAC1B;IACD,IAAI,SAAS,EAAE;QACb,KAAwB,UAAS,EAAT,uBAAS,EAAT,uBAAS,EAAT,IAAS,EAAE;YAA9B,IAAM,SAAS,kBAAA;YAClB,IAAM,QAAQ,GAAG,qBAAqB,CACpC,MAAM,EACN,wBAAwB,CAAC,SAAS,EAAE,WAAW,CAAE,CAAC,YAAY,EAC9D,WAAW,CACZ,CAAC;YACF,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;gBAChC,OAAO,QAAQ,CAAC;aACjB;SACF;KACF;AACH,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,SAAwB;IAC9C,OAAO,SAAS,CAAC,IAAI,KAAK,OAAO,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,SAAwB;IAExB,OAAO,SAAS,CAAC,IAAI,KAAK,gBAAgB,CAAC;AAC7C,CAAC","sourcesContent":["import { newInvariantError } from \"../globals/index.js\";\n\nimport type {\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 SelectionSetNode,\n DocumentNode,\n FragmentSpreadNode,\n} from \"graphql\";\n\nimport { isNonNullObject } from \"../common/objects.js\";\nimport type { FragmentMap } from \"./fragments.js\";\nimport { getFragmentFromSelection } from \"./fragments.js\";\n\nexport interface Reference {\n readonly __ref: string;\n}\n\nexport function makeReference(id: string): Reference {\n return { __ref: String(id) };\n}\n\nexport function isReference(obj: any): obj is Reference {\n return Boolean(\n obj && typeof obj === \"object\" && typeof obj.__ref === \"string\"\n );\n}\n\nexport type StoreValue =\n | number\n | string\n | string[]\n | Reference\n | Reference[]\n | null\n | undefined\n | void\n | Object;\n\nexport interface StoreObject {\n __typename?: string;\n [storeFieldName: string]: StoreValue;\n}\n\n/**\n * Workaround for a TypeScript quirk:\n * types per default have an implicit index signature that makes them\n * assignable to `StoreObject`.\n * interfaces do not have that implicit index signature, so they cannot\n * be assigned to `StoreObject`.\n * This type just maps over a type or interface that is passed in,\n * implicitly adding the index signature.\n * That way, the result can be assigned to `StoreObject`.\n *\n * This is important if some user-defined interface is used e.g.\n * in cache.modify, where the `toReference` method expects a\n * `StoreObject` as input.\n */\nexport type AsStoreObject<T extends { __typename?: string }> = {\n [K in keyof T]: T[K];\n};\n\nexport function isDocumentNode(value: any): value is DocumentNode {\n return (\n isNonNullObject(value) &&\n (value as DocumentNode).kind === \"Document\" &&\n Array.isArray((value as DocumentNode).definitions)\n );\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 newInvariantError(\n `The inline argument \"%s\" of kind \"%s\"` +\n \"is not supported. Use variables instead of inline arguments to \" +\n \"overcome this limitation.\",\n name.value,\n (value as any).kind\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 \"nonreactive\",\n];\n\nexport const getStoreKeyName = Object.assign(\n function (\n fieldName: string,\n args?: Record<string, any> | null,\n directives?: Directives\n ): string {\n if (\n args &&\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 filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach((key) => {\n filteredArgs[key] = args[key];\n });\n\n return `${directives[\"connection\"][\"key\"]}(${stringify(filteredArgs)})`;\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}(${stringify(directives[key])})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n },\n {\n setStringify(s: typeof stringify) {\n const previous = stringify;\n stringify = s;\n return previous;\n },\n }\n);\n\n// Default stable JSON.stringify implementation. Can be updated/replaced with\n// something better by calling getStoreKeyName.setStringify.\nlet stringify = function defaultStringify(value: any): string {\n return JSON.stringify(value, stringifyReplacer);\n};\n\nfunction stringifyReplacer(_key: string, value: any): any {\n if (isNonNullObject(value) && !Array.isArray(value)) {\n value = Object.keys(value)\n .sort()\n .reduce(\n (copy, key) => {\n copy[key] = value[key];\n return copy;\n },\n {} as Record<string, any>\n );\n }\n return value;\n}\n\nexport function argumentsObjectFromField(\n field: FieldNode | DirectiveNode,\n variables?: Record<string, any>\n): Object | null {\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 return null;\n}\n\nexport function resultKeyNameFromField(field: FieldNode): string {\n return field.alias ? field.alias.value : field.name.value;\n}\n\nexport function getTypenameFromResult(\n result: Record<string, any>,\n selectionSet: SelectionSetNode,\n fragmentMap?: FragmentMap\n): string | undefined {\n let fragments: undefined | Array<InlineFragmentNode | FragmentSpreadNode>;\n for (const selection of selectionSet.selections) {\n if (isField(selection)) {\n if (selection.name.value === \"__typename\") {\n return result[resultKeyNameFromField(selection)];\n }\n } else if (fragments) {\n fragments.push(selection);\n } else {\n fragments = [selection];\n }\n }\n if (typeof result.__typename === \"string\") {\n return result.__typename;\n }\n if (fragments) {\n for (const selection of fragments) {\n const typename = getTypenameFromResult(\n result,\n getFragmentFromSelection(selection, fragmentMap)!.selectionSet,\n fragmentMap\n );\n if (typeof typename === \"string\") {\n return typename;\n }\n }\n }\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 type VariableValue = (node: VariableNode) => any;\n"]}
@@ -78,7 +78,7 @@ export function removeDirectivesFromDocument(directives, doc) {
78
78
  return getInUseByFragmentName(ancestor.name.value);
79
79
  }
80
80
  }
81
- globalThis.__DEV__ !== false && invariant.error(80);
81
+ globalThis.__DEV__ !== false && invariant.error(82);
82
82
  return null;
83
83
  };
84
84
  var operationCount = 0;
@@ -265,7 +265,7 @@ var connectionRemoveConfig = {
265
265
  if (willRemove) {
266
266
  if (!directive.arguments ||
267
267
  !directive.arguments.some(function (arg) { return arg.name.value === "key"; })) {
268
- globalThis.__DEV__ !== false && invariant.warn(81);
268
+ globalThis.__DEV__ !== false && invariant.warn(83);
269
269
  }
270
270
  }
271
271
  return willRemove;
@@ -7,7 +7,7 @@ export type { FragmentMap, FragmentMapFunction } from "./graphql/fragments.js";
7
7
  export { createFragmentMap, getFragmentQueryDocument, getFragmentFromSelection, } from "./graphql/fragments.js";
8
8
  export { checkDocument, getOperationDefinition, getOperationName, getFragmentDefinitions, getQueryDefinition, getFragmentDefinition, getMainDefinition, getDefaultValues, } from "./graphql/getFromAST.js";
9
9
  export { print } from "./graphql/print.js";
10
- export type { StoreObject, Reference, StoreValue, Directives, VariableValue, } from "./graphql/storeUtils.js";
10
+ export type { StoreObject, AsStoreObject, Reference, StoreValue, Directives, VariableValue, } from "./graphql/storeUtils.js";
11
11
  export { makeReference, isDocumentNode, isReference, isField, isInlineFragment, valueToObjectRepresentation, storeKeyNameFromField, argumentsObjectFromField, resultKeyNameFromField, getStoreKeyName, getTypenameFromResult, } from "./graphql/storeUtils.js";
12
12
  export type { RemoveNodeConfig, GetNodeConfig, RemoveDirectiveConfig, GetDirectiveConfig, RemoveArgumentsConfig, GetFragmentSpreadConfig, RemoveFragmentSpreadConfig, RemoveFragmentDefinitionConfig, RemoveVariableDefinitionConfig, } from "./graphql/transform.js";
13
13
  export { addTypenameToDocument, buildQueryFromSelectionSet, removeDirectivesFromDocument, removeConnectionDirectiveFromDocument, removeArgumentsFromDocument, removeFragmentSpreadFromDocument, removeClientSetsFromDocument, } from "./graphql/transform.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,YAAY,EACV,aAAa,EACb,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAAE,iBAAi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AAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,cAAc,0BAA0B,CAAC","sourcesContent":["export { DEV, maybe } from \"./globals/index.js\";\n\nexport type {\n DirectiveInfo,\n InclusionDirectives,\n} from \"./graphql/directives.js\";\nexport {\n shouldInclude,\n hasDirectives,\n hasAnyDirectives,\n hasAllDirectives,\n hasClientExports,\n getDirectiveNames,\n getInclusionDirectives,\n} from \"./graphql/directives.js\";\n\nexport type { DocumentTransformCacheKey } from \"./graphql/DocumentTransform.js\";\nexport { DocumentTransform } from \"./graphql/DocumentTransform.js\";\n\nexport type { FragmentMap, FragmentMapFunction } from \"./graphql/fragments.js\";\nexport {\n createFragmentMap,\n getFragmentQueryDocument,\n getFragmentFromSelection,\n} from \"./graphql/fragments.js\";\n\nexport {\n checkDocument,\n getOperationDefinition,\n getOperationName,\n getFragmentDefinitions,\n getQueryDefinition,\n getFragmentDefinition,\n getMainDefinition,\n getDefaultValues,\n} from \"./graphql/getFromAST.js\";\n\nexport { print } from \"./graphql/print.js\";\n\nexport type {\n StoreObject,\n Reference,\n StoreValue,\n Directives,\n VariableValue,\n} from \"./graphql/storeUtils.js\";\nexport {\n makeReference,\n isDocumentNode,\n isReference,\n isField,\n isInlineFragment,\n valueToObjectRepresentation,\n storeKeyNameFromField,\n argumentsObjectFromField,\n resultKeyNameFromField,\n getStoreKeyName,\n getTypenameFromResult,\n} from \"./graphql/storeUtils.js\";\n\nexport type {\n RemoveNodeConfig,\n GetNodeConfig,\n RemoveDirectiveConfig,\n GetDirectiveConfig,\n RemoveArgumentsConfig,\n GetFragmentSpreadConfig,\n RemoveFragmentSpreadConfig,\n RemoveFragmentDefinitionConfig,\n RemoveVariableDefinitionConfig,\n} from \"./graphql/transform.js\";\nexport {\n addTypenameToDocument,\n buildQueryFromSelectionSet,\n removeDirectivesFromDocument,\n removeConnectionDirectiveFromDocument,\n removeArgumentsFromDocument,\n removeFragmentSpreadFromDocument,\n removeClientSetsFromDocument,\n} from \"./graphql/transform.js\";\n\nexport {\n isMutationOperation,\n isQueryOperation,\n isSubscriptionOperation,\n} from \"./graphql/operations.js\";\n\nexport {\n concatPagination,\n offsetLimitPagination,\n relayStylePagination,\n} from \"./policies/pagination.js\";\n\nexport type {\n Observer,\n ObservableSubscription,\n} from \"./observables/Observable.js\";\nexport { Observable } from \"./observables/Observable.js\";\n\nexport {\n isStatefulPromise,\n createFulfilledPromise,\n createRejectedPromise,\n wrapPromiseWithState,\n} from \"./promises/decoration.js\";\n\nexport * from \"./common/mergeDeep.js\";\nexport * from \"./common/cloneDeep.js\";\nexport * from \"./common/maybeDeepFreeze.js\";\nexport * from \"./observables/iteration.js\";\nexport * from \"./observables/asyncMap.js\";\nexport * from \"./observables/Concast.js\";\nexport * from \"./observables/subclassing.js\";\nexport * from \"./common/arrays.js\";\nexport * from \"./common/objects.js\";\nexport * from \"./common/errorHandling.js\";\nexport * from \"./common/canUse.js\";\nexport * from \"./common/compact.js\";\nexport * from \"./common/makeUniqueId.js\";\nexport * from \"./common/stringifyForDisplay.js\";\nexport * from \"./common/mergeOptions.js\";\nexport * from \"./common/incrementalResult.js\";\n\nexport { omitDeep } from \"./common/omitDeep.js\";\nexport { stripTypename } from \"./common/stripTypename.js\";\n\nexport * from \"./types/IsStrictlyAny.js\";\nexport type { DeepOmit } from \"./types/DeepOmit.js\";\nexport type { DeepPartial } from \"./types/DeepPartial.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAMhD,OAAO,EACL,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGnE,OAAO,EACL,iBAAiB,EACjB,wBAAwB,E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,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,cAAc,0BAA0B,CAAC","sourcesContent":["export { DEV, maybe } from \"./globals/index.js\";\n\nexport type {\n DirectiveInfo,\n InclusionDirectives,\n} from \"./graphql/directives.js\";\nexport {\n shouldInclude,\n hasDirectives,\n hasAnyDirectives,\n hasAllDirectives,\n hasClientExports,\n getDirectiveNames,\n getInclusionDirectives,\n} from \"./graphql/directives.js\";\n\nexport type { DocumentTransformCacheKey } from \"./graphql/DocumentTransform.js\";\nexport { DocumentTransform } from \"./graphql/DocumentTransform.js\";\n\nexport type { FragmentMap, FragmentMapFunction } from \"./graphql/fragments.js\";\nexport {\n createFragmentMap,\n getFragmentQueryDocument,\n getFragmentFromSelection,\n} from \"./graphql/fragments.js\";\n\nexport {\n checkDocument,\n getOperationDefinition,\n getOperationName,\n getFragmentDefinitions,\n getQueryDefinition,\n getFragmentDefinition,\n getMainDefinition,\n getDefaultValues,\n} from \"./graphql/getFromAST.js\";\n\nexport { print } from \"./graphql/print.js\";\n\nexport type {\n StoreObject,\n AsStoreObject,\n Reference,\n StoreValue,\n Directives,\n VariableValue,\n} from \"./graphql/storeUtils.js\";\nexport {\n makeReference,\n isDocumentNode,\n isReference,\n isField,\n isInlineFragment,\n valueToObjectRepresentation,\n storeKeyNameFromField,\n argumentsObjectFromField,\n resultKeyNameFromField,\n getStoreKeyName,\n getTypenameFromResult,\n} from \"./graphql/storeUtils.js\";\n\nexport type {\n RemoveNodeConfig,\n GetNodeConfig,\n RemoveDirectiveConfig,\n GetDirectiveConfig,\n RemoveArgumentsConfig,\n GetFragmentSpreadConfig,\n RemoveFragmentSpreadConfig,\n RemoveFragmentDefinitionConfig,\n RemoveVariableDefinitionConfig,\n} from \"./graphql/transform.js\";\nexport {\n addTypenameToDocument,\n buildQueryFromSelectionSet,\n removeDirectivesFromDocument,\n removeConnectionDirectiveFromDocument,\n removeArgumentsFromDocument,\n removeFragmentSpreadFromDocument,\n removeClientSetsFromDocument,\n} from \"./graphql/transform.js\";\n\nexport {\n isMutationOperation,\n isQueryOperation,\n isSubscriptionOperation,\n} from \"./graphql/operations.js\";\n\nexport {\n concatPagination,\n offsetLimitPagination,\n relayStylePagination,\n} from \"./policies/pagination.js\";\n\nexport type {\n Observer,\n ObservableSubscription,\n} from \"./observables/Observable.js\";\nexport { Observable } from \"./observables/Observable.js\";\n\nexport {\n isStatefulPromise,\n createFulfilledPromise,\n createRejectedPromise,\n wrapPromiseWithState,\n} from \"./promises/decoration.js\";\n\nexport * from \"./common/mergeDeep.js\";\nexport * from \"./common/cloneDeep.js\";\nexport * from \"./common/maybeDeepFreeze.js\";\nexport * from \"./observables/iteration.js\";\nexport * from \"./observables/asyncMap.js\";\nexport * from \"./observables/Concast.js\";\nexport * from \"./observables/subclassing.js\";\nexport * from \"./common/arrays.js\";\nexport * from \"./common/objects.js\";\nexport * from \"./common/errorHandling.js\";\nexport * from \"./common/canUse.js\";\nexport * from \"./common/compact.js\";\nexport * from \"./common/makeUniqueId.js\";\nexport * from \"./common/stringifyForDisplay.js\";\nexport * from \"./common/mergeOptions.js\";\nexport * from \"./common/incrementalResult.js\";\n\nexport { omitDeep } from \"./common/omitDeep.js\";\nexport { stripTypename } from \"./common/stripTypename.js\";\n\nexport * from \"./types/IsStrictlyAny.js\";\nexport type { DeepOmit } from \"./types/DeepOmit.js\";\nexport type { DeepPartial } from \"./types/DeepPartial.js\";\n"]}
@@ -20,7 +20,7 @@ function shouldInclude(_a, variables) {
20
20
  if (ifArgument.value.kind === "Variable") {
21
21
  evaledValue =
22
22
  variables && variables[ifArgument.value.name.value];
23
- globals.invariant(evaledValue !== void 0, 64, directive.name.value);
23
+ globals.invariant(evaledValue !== void 0, 66, directive.name.value);
24
24
  }
25
25
  else {
26
26
  evaledValue = ifArgument.value.value;
@@ -70,12 +70,12 @@ function getInclusionDirectives(directives) {
70
70
  return;
71
71
  var directiveArguments = directive.arguments;
72
72
  var directiveName = directive.name.value;
73
- globals.invariant(directiveArguments && directiveArguments.length === 1, 65, directiveName);
73
+ globals.invariant(directiveArguments && directiveArguments.length === 1, 67, directiveName);
74
74
  var ifArgument = directiveArguments[0];
75
- globals.invariant(ifArgument.name && ifArgument.name.value === "if", 66, directiveName);
75
+ globals.invariant(ifArgument.name && ifArgument.name.value === "if", 68, directiveName);
76
76
  var ifValue = ifArgument.value;
77
77
  globals.invariant(ifValue &&
78
- (ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"), 67, directiveName);
78
+ (ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"), 69, directiveName);
79
79
  result.push({ directive: directive, ifArgument: ifArgument });
80
80
  });
81
81
  }
@@ -107,7 +107,7 @@ function getFragmentQueryDocument(document, fragmentName) {
107
107
  document.definitions.forEach(function (definition) {
108
108
  if (definition.kind === "OperationDefinition") {
109
109
  throw globals.newInvariantError(
110
- 68,
110
+ 70,
111
111
  definition.operation,
112
112
  definition.name ? " named '".concat(definition.name.value, "'") : ""
113
113
  );
@@ -117,7 +117,7 @@ function getFragmentQueryDocument(document, fragmentName) {
117
117
  }
118
118
  });
119
119
  if (typeof actualFragmentName === "undefined") {
120
- globals.invariant(fragments.length === 1, 69, fragments.length);
120
+ globals.invariant(fragments.length === 1, 71, fragments.length);
121
121
  actualFragmentName = fragments[0].name.value;
122
122
  }
123
123
  var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
@@ -158,7 +158,7 @@ function getFragmentFromSelection(selection, fragmentMap) {
158
158
  return fragmentMap(fragmentName);
159
159
  }
160
160
  var fragment = fragmentMap && fragmentMap[fragmentName];
161
- globals.invariant(fragment, 70, fragmentName);
161
+ globals.invariant(fragment, 72, fragmentName);
162
162
  return fragment || null;
163
163
  }
164
164
  default:
@@ -236,7 +236,7 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
236
236
  argObj[name.value] = null;
237
237
  }
238
238
  else {
239
- throw globals.newInvariantError(79, name.value, value.kind);
239
+ throw globals.newInvariantError(81, name.value, value.kind);
240
240
  }
241
241
  }
242
242
  function storeKeyNameFromField(field, variables) {
@@ -383,16 +383,16 @@ function isInlineFragment(selection) {
383
383
  }
384
384
 
385
385
  function checkDocument(doc) {
386
- globals.invariant(doc && doc.kind === "Document", 71);
386
+ globals.invariant(doc && doc.kind === "Document", 73);
387
387
  var operations = doc.definitions
388
388
  .filter(function (d) { return d.kind !== "FragmentDefinition"; })
389
389
  .map(function (definition) {
390
390
  if (definition.kind !== "OperationDefinition") {
391
- throw globals.newInvariantError(72, definition.kind);
391
+ throw globals.newInvariantError(74, definition.kind);
392
392
  }
393
393
  return definition;
394
394
  });
395
- globals.invariant(operations.length <= 1, 73, operations.length);
395
+ globals.invariant(operations.length <= 1, 75, operations.length);
396
396
  return doc;
397
397
  }
398
398
  function getOperationDefinition(doc) {
@@ -415,14 +415,14 @@ function getFragmentDefinitions(doc) {
415
415
  }
416
416
  function getQueryDefinition(doc) {
417
417
  var queryDef = getOperationDefinition(doc);
418
- globals.invariant(queryDef && queryDef.operation === "query", 74);
418
+ globals.invariant(queryDef && queryDef.operation === "query", 76);
419
419
  return queryDef;
420
420
  }
421
421
  function getFragmentDefinition(doc) {
422
- globals.invariant(doc.kind === "Document", 75);
423
- globals.invariant(doc.definitions.length <= 1, 76);
422
+ globals.invariant(doc.kind === "Document", 77);
423
+ globals.invariant(doc.definitions.length <= 1, 78);
424
424
  var fragmentDef = doc.definitions[0];
425
- globals.invariant(fragmentDef.kind === "FragmentDefinition", 77);
425
+ globals.invariant(fragmentDef.kind === "FragmentDefinition", 79);
426
426
  return fragmentDef;
427
427
  }
428
428
  function getMainDefinition(queryDoc) {
@@ -445,7 +445,7 @@ function getMainDefinition(queryDoc) {
445
445
  if (fragmentDefinition) {
446
446
  return fragmentDefinition;
447
447
  }
448
- throw globals.newInvariantError(78);
448
+ throw globals.newInvariantError(80);
449
449
  }
450
450
  function getDefaultValues(definition) {
451
451
  var defaultValues = Object.create(null);
@@ -517,7 +517,7 @@ var DocumentTransform = (function () {
517
517
  return;
518
518
  var cacheKeys = this.getCacheKey(document);
519
519
  if (cacheKeys) {
520
- globals.invariant(Array.isArray(cacheKeys), 63);
520
+ globals.invariant(Array.isArray(cacheKeys), 65);
521
521
  return this.stableCacheKeys.lookupArray(cacheKeys);
522
522
  }
523
523
  };
@@ -613,7 +613,7 @@ function removeDirectivesFromDocument(directives, doc) {
613
613
  return getInUseByFragmentName(ancestor.name.value);
614
614
  }
615
615
  }
616
- globalThis.__DEV__ !== false && globals.invariant.error(80);
616
+ globalThis.__DEV__ !== false && globals.invariant.error(82);
617
617
  return null;
618
618
  };
619
619
  var operationCount = 0;
@@ -800,7 +800,7 @@ var connectionRemoveConfig = {
800
800
  if (willRemove) {
801
801
  if (!directive.arguments ||
802
802
  !directive.arguments.some(function (arg) { return arg.name.value === "key"; })) {
803
- globalThis.__DEV__ !== false && globals.invariant.warn(81);
803
+ globalThis.__DEV__ !== false && globals.invariant.warn(83);
804
804
  }
805
805
  }
806
806
  return willRemove;