@apollo/client 3.6.0-beta.10 → 3.6.0-beta.13

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 (48) hide show
  1. package/apollo-client.cjs +187 -173
  2. package/apollo-client.cjs.map +1 -1
  3. package/apollo-client.min.cjs +1 -1
  4. package/core/ApolloClient.d.ts +1 -1
  5. package/core/ApolloClient.d.ts.map +1 -1
  6. package/core/ApolloClient.js.map +1 -1
  7. package/core/ObservableQuery.d.ts +0 -1
  8. package/core/ObservableQuery.d.ts.map +1 -1
  9. package/core/ObservableQuery.js +14 -13
  10. package/core/ObservableQuery.js.map +1 -1
  11. package/core/QueryManager.d.ts.map +1 -1
  12. package/core/QueryManager.js +2 -1
  13. package/core/QueryManager.js.map +1 -1
  14. package/core/core.cjs +15 -14
  15. package/core/core.cjs.map +1 -1
  16. package/core/watchQueryOptions.d.ts +2 -1
  17. package/core/watchQueryOptions.d.ts.map +1 -1
  18. package/core/watchQueryOptions.js.map +1 -1
  19. package/invariantErrorCodes.js +1 -1
  20. package/package.json +4 -2
  21. package/react/hooks/hooks.cjs +154 -142
  22. package/react/hooks/hooks.cjs.map +1 -1
  23. package/react/hooks/index.d.ts +1 -1
  24. package/react/hooks/index.d.ts.map +1 -1
  25. package/react/hooks/index.js +1 -1
  26. package/react/hooks/index.js.map +1 -1
  27. package/react/hooks/useLazyQuery.d.ts +2 -2
  28. package/react/hooks/useLazyQuery.d.ts.map +1 -1
  29. package/react/hooks/useLazyQuery.js +38 -24
  30. package/react/hooks/useLazyQuery.js.map +1 -1
  31. package/react/hooks/useQuery.d.ts +34 -3
  32. package/react/hooks/useQuery.d.ts.map +1 -1
  33. package/react/hooks/useQuery.js +120 -99
  34. package/react/hooks/useQuery.js.map +1 -1
  35. package/react/types/types.d.ts +9 -13
  36. package/react/types/types.d.ts.map +1 -1
  37. package/react/types/types.js.map +1 -1
  38. package/utilities/graphql/transform.d.ts +2 -2
  39. package/utilities/graphql/transform.d.ts.map +1 -1
  40. package/utilities/graphql/transform.js +1 -1
  41. package/utilities/graphql/transform.js.map +1 -1
  42. package/utilities/utilities.cjs +1 -1
  43. package/utilities/utilities.cjs.map +1 -1
  44. package/version.js +1 -1
  45. package/react/hooks/options.d.ts +0 -3
  46. package/react/hooks/options.d.ts.map +0 -1
  47. package/react/hooks/options.js +0 -20
  48. package/react/hooks/options.js.map +0 -1
package/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export var version = '3.6.0-beta.10';
1
+ export var version = '3.6.0-beta.13';
2
2
  //# sourceMappingURL=version.js.map
@@ -1,3 +0,0 @@
1
- import { QueryHookOptions, LazyQueryHookOptions } from "../types/types";
2
- export declare function useNormalizedOptions<TOptions extends QueryHookOptions<any, any> | LazyQueryHookOptions<any, any>>(optionsOrFunction?: TOptions | ((prevOptions: TOptions) => TOptions)): TOptions;
3
- //# sourceMappingURL=options.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/options.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;AAMxB,wBAAgB,oBAAoB,CAClC,QAAQ,SACJ,gBAAgB,CAAC,GAAG,EAAE,GAAG,CAAC,GAC1B,oBAAoB,CAAC,GAAG,EAAE,GAAG,CAAC,EAElC,iBAAiB,CAAC,EACd,QAAQ,GACR,CAAC,CAAC,WAAW,EAAE,QAAQ,KAAK,QAAQ,CAAC,GACxC,QAAQ,CAmBV"}
@@ -1,20 +0,0 @@
1
- import { __assign } from "tslib";
2
- import { useRef } from "react";
3
- import equal from "@wry/equality";
4
- export function useNormalizedOptions(optionsOrFunction) {
5
- var optionsRef = useRef();
6
- var options = optionsRef.current || Object.create(null);
7
- if (typeof optionsOrFunction === "function") {
8
- var newOptions = optionsOrFunction(options);
9
- if (newOptions !== options) {
10
- Object.assign(options, newOptions, newOptions.variables && {
11
- variables: __assign(__assign({}, options.variables), newOptions.variables),
12
- });
13
- }
14
- }
15
- else if (optionsOrFunction && !equal(optionsOrFunction, options)) {
16
- options = optionsOrFunction;
17
- }
18
- return optionsRef.current = options;
19
- }
20
- //# sourceMappingURL=options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/react/hooks/options.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,MAAM,eAAe,CAAC;AAWlC,MAAM,UAAU,oBAAoB,CAKlC,iBAEyC;IAEzC,IAAM,UAAU,GAAG,MAAM,EAAY,CAAC;IACtC,IAAI,OAAO,GAAa,UAAU,CAAC,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAElE,IAAI,OAAO,iBAAiB,KAAK,UAAU,EAAE;QAC3C,IAAM,UAAU,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,UAAU,KAAK,OAAO,EAAE;YAC1B,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,SAAS,IAAI;gBACzD,SAAS,wBACJ,OAAO,CAAC,SAAS,GACjB,UAAU,CAAC,SAAS,CACxB;aACF,CAAC,CAAC;SACJ;KACF;SAAM,IAAI,iBAAiB,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE,OAAO,CAAC,EAAE;QAClE,OAAO,GAAG,iBAAiB,CAAC;KAC7B;IAED,OAAO,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC;AACtC,CAAC","sourcesContent":["import { useRef } from \"react\";\nimport equal from \"@wry/equality\";\n\nimport {\n QueryHookOptions,\n LazyQueryHookOptions,\n} from \"../types/types\";\n\n// I would have made this function a method of the InternalState class, but it\n// needs to run before we get the client from useApolloClient in the useQuery\n// function above, just in case the options function returns options.client as\n// an override for the ApolloClient instance provided by React context.\nexport function useNormalizedOptions<\n TOptions extends\n | QueryHookOptions<any, any>\n | LazyQueryHookOptions<any, any>\n>(\n optionsOrFunction?:\n | TOptions\n | ((prevOptions: TOptions) => TOptions)\n): TOptions {\n const optionsRef = useRef<TOptions>();\n let options: TOptions = optionsRef.current || Object.create(null);\n\n if (typeof optionsOrFunction === \"function\") {\n const newOptions = optionsOrFunction(options);\n if (newOptions !== options) {\n Object.assign(options, newOptions, newOptions.variables && {\n variables: {\n ...options.variables,\n ...newOptions.variables,\n },\n });\n }\n } else if (optionsOrFunction && !equal(optionsOrFunction, options)) {\n options = optionsOrFunction;\n }\n\n return optionsRef.current = options;\n}\n"]}