@graphitation/apollo-react-relay-duct-tape 1.0.1-alpha.2 → 1.0.1-alpha.5

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 (50) hide show
  1. package/.eslintcache +1 -1
  2. package/CHANGELOG.md +27 -2
  3. package/lib/hooks.d.ts.map +1 -1
  4. package/lib/hooks.js +7 -2
  5. package/lib/hooks.js.map +2 -2
  6. package/lib/hooks.mjs +7 -2
  7. package/lib/hooks.mjs.map +2 -2
  8. package/lib/index.d.ts +1 -0
  9. package/lib/index.d.ts.map +1 -1
  10. package/lib/index.js +8 -0
  11. package/lib/index.js.map +2 -2
  12. package/lib/index.mjs +4 -0
  13. package/lib/index.mjs.map +2 -2
  14. package/lib/storeObservation/compiledHooks/useCompiledFragment.d.ts.map +1 -1
  15. package/lib/storeObservation/compiledHooks/useCompiledFragment.js +2 -2
  16. package/lib/storeObservation/compiledHooks/useCompiledFragment.js.map +2 -2
  17. package/lib/storeObservation/compiledHooks/useCompiledFragment.mjs +2 -2
  18. package/lib/storeObservation/compiledHooks/useCompiledFragment.mjs.map +2 -2
  19. package/lib/storeObservation/compiledHooks/useCompiledLazyLoadQuery.d.ts.map +1 -1
  20. package/lib/storeObservation/compiledHooks/useCompiledLazyLoadQuery.js +2 -1
  21. package/lib/storeObservation/compiledHooks/useCompiledLazyLoadQuery.js.map +2 -2
  22. package/lib/storeObservation/compiledHooks/useCompiledLazyLoadQuery.mjs +3 -5
  23. package/lib/storeObservation/compiledHooks/useCompiledLazyLoadQuery.mjs.map +2 -2
  24. package/lib/storeObservation/compiledHooks/useCompiledPaginationFragment.d.ts.map +1 -1
  25. package/lib/storeObservation/compiledHooks/useCompiledPaginationFragment.js +3 -3
  26. package/lib/storeObservation/compiledHooks/useCompiledPaginationFragment.js.map +2 -2
  27. package/lib/storeObservation/compiledHooks/useCompiledPaginationFragment.mjs +3 -5
  28. package/lib/storeObservation/compiledHooks/useCompiledPaginationFragment.mjs.map +2 -2
  29. package/lib/storeObservation/compiledHooks/useCompiledRefetchableFragment.d.ts.map +1 -1
  30. package/lib/storeObservation/compiledHooks/useCompiledRefetchableFragment.js +2 -2
  31. package/lib/storeObservation/compiledHooks/useCompiledRefetchableFragment.js.map +2 -2
  32. package/lib/storeObservation/compiledHooks/useCompiledRefetchableFragment.mjs +2 -2
  33. package/lib/storeObservation/compiledHooks/useCompiledRefetchableFragment.mjs.map +2 -2
  34. package/lib/storeObservation/createImportDocumentsTransform.d.ts +1 -0
  35. package/lib/storeObservation/createImportDocumentsTransform.d.ts.map +1 -1
  36. package/lib/storeObservation/createImportDocumentsTransform.js +28 -17
  37. package/lib/storeObservation/createImportDocumentsTransform.js.map +2 -2
  38. package/lib/storeObservation/createImportDocumentsTransform.mjs +29 -17
  39. package/lib/storeObservation/createImportDocumentsTransform.mjs.map +2 -2
  40. package/lib/storeObservation/createImportDocumentsTransform.test.js +55 -27
  41. package/lib/storeObservation/createImportDocumentsTransform.test.js.map +2 -2
  42. package/lib/storeObservation/createImportDocumentsTransform.test.mjs +57 -30
  43. package/lib/storeObservation/createImportDocumentsTransform.test.mjs.map +2 -2
  44. package/lib/useOverridenOrDefaultApolloClient.d.ts +18 -0
  45. package/lib/useOverridenOrDefaultApolloClient.d.ts.map +1 -0
  46. package/lib/useOverridenOrDefaultApolloClient.js +40 -0
  47. package/lib/useOverridenOrDefaultApolloClient.js.map +7 -0
  48. package/lib/useOverridenOrDefaultApolloClient.mjs +20 -0
  49. package/lib/useOverridenOrDefaultApolloClient.mjs.map +7 -0
  50. package/package.json +9 -8
package/.eslintcache CHANGED
@@ -1 +1 @@
1
- [{"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestFragment.graphql.ts":"1","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestMutation.graphql.ts":"2","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestQuery.graphql.ts":"3","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestSubscription.graphql.ts":"4","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestWatchNodeQuery.graphql.ts":"5","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/hooks.test.tsx":"6","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/convertFetchPolicy.ts":"7","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/hooks.ts":"8","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/index.ts":"9","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment.graphql.ts":"10","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment_PaginationQuery.graphql.ts":"11","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ChildFragment.graphql.ts":"12","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ChildWatchNodeQuery.graphql.ts":"13","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment.graphql.ts":"14","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment_PaginationQuery.graphql.ts":"15","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_QueryTypeFragment.graphql.ts":"16","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_QueryTypeWatchNodeQuery.graphql.ts":"17","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_RefetchableFragment.graphql.ts":"18","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_RefetchableFragment_RefetchQuery.graphql.ts":"19","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_Root_executionQuery.graphql.ts":"20","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/index.ts":"21","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/types.ts":"22","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledFragment.ts":"23","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledLazyLoadQuery.ts":"24","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledPaginationFragment.ts":"25","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledRefetchableFragment.ts":"26","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useDeepCompareMemoize.ts":"27","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useForceUpdate.ts":"28","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks.test.tsx":"29","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/createImportDocumentsTransform.test.ts":"30","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/createImportDocumentsTransform.ts":"31","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/fragmentReferencesFieldPolicy.test.ts":"32","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/fragmentReferencesFieldPolicy.ts":"33","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/index.ts":"34","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/nodeFromCacheFieldPolicy.test.ts":"35","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/nodeFromCacheFieldPolicy.ts":"36","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/shallowCompareFragmentReferences.ts":"37","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/typePolicies.ts":"38","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/types.ts":"39"},{"size":527,"mtime":1648823241594,"results":"40","hashOfConfig":"41"},{"size":8845,"mtime":1648823241594,"results":"42","hashOfConfig":"41"},{"size":6838,"mtime":1648823241594,"results":"43","hashOfConfig":"41"},{"size":6980,"mtime":1648823241594,"results":"44","hashOfConfig":"41"},{"size":4869,"mtime":1648823241594,"results":"45","hashOfConfig":"41"},{"size":9970,"mtime":1648823241594,"results":"46","hashOfConfig":"41"},{"size":689,"mtime":1648823241594,"results":"47","hashOfConfig":"41"},{"size":8678,"mtime":1648823241594,"results":"48","hashOfConfig":"41"},{"size":86,"mtime":1648823241594,"results":"49","hashOfConfig":"41"},{"size":795,"mtime":1648823241594,"results":"50","hashOfConfig":"41"},{"size":21245,"mtime":1648823241594,"results":"51","hashOfConfig":"41"},{"size":542,"mtime":1648823241594,"results":"52","hashOfConfig":"41"},{"size":4762,"mtime":1648823241594,"results":"53","hashOfConfig":"41"},{"size":957,"mtime":1648823241594,"results":"54","hashOfConfig":"41"},{"size":34594,"mtime":1648823241594,"results":"55","hashOfConfig":"41"},{"size":607,"mtime":1648823241594,"results":"56","hashOfConfig":"41"},{"size":2420,"mtime":1648823241594,"results":"57","hashOfConfig":"41"},{"size":641,"mtime":1648823241594,"results":"58","hashOfConfig":"41"},{"size":11175,"mtime":1648823241594,"results":"59","hashOfConfig":"41"},{"size":27253,"mtime":1648823241594,"results":"60","hashOfConfig":"41"},{"size":445,"mtime":1648823241594,"results":"61","hashOfConfig":"41"},{"size":518,"mtime":1648823241594,"results":"62","hashOfConfig":"41"},{"size":2329,"mtime":1648823241594,"results":"63","hashOfConfig":"41"},{"size":3332,"mtime":1648823241594,"results":"64","hashOfConfig":"41"},{"size":8799,"mtime":1648823241594,"results":"65","hashOfConfig":"41"},{"size":5149,"mtime":1648823241594,"results":"66","hashOfConfig":"41"},{"size":843,"mtime":1648823241594,"results":"67","hashOfConfig":"41"},{"size":152,"mtime":1648823241594,"results":"68","hashOfConfig":"41"},{"size":33457,"mtime":1648823241594,"results":"69","hashOfConfig":"41"},{"size":1686,"mtime":1648823241598,"results":"70","hashOfConfig":"41"},{"size":5349,"mtime":1648823241598,"results":"71","hashOfConfig":"41"},{"size":1838,"mtime":1648823241598,"results":"72","hashOfConfig":"41"},{"size":285,"mtime":1648823241598,"results":"73","hashOfConfig":"41"},{"size":342,"mtime":1648823241598,"results":"74","hashOfConfig":"41"},{"size":3040,"mtime":1648823241598,"results":"75","hashOfConfig":"41"},{"size":2765,"mtime":1648823241598,"results":"76","hashOfConfig":"41"},{"size":2092,"mtime":1648823241598,"results":"77","hashOfConfig":"41"},{"size":1102,"mtime":1648823241598,"results":"78","hashOfConfig":"41"},{"size":1674,"mtime":1648823241598,"results":"79","hashOfConfig":"41"},{"filePath":"80","messages":"81","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1lwegyw",{"filePath":"82","messages":"83","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"84","messages":"85","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"86","messages":"87","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"88","messages":"89","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"90","messages":"91","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"92","messages":"93","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"94","messages":"95","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"96","messages":"97","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"98","messages":"99","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"100","messages":"101","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"102","messages":"103","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"104","messages":"105","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"106","messages":"107","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"108","messages":"109","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"110","messages":"111","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"112","messages":"113","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"114","messages":"115","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"116","messages":"117","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"118","messages":"119","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"120","messages":"121","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"122","messages":"123","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"124","messages":"125","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"126","messages":"127","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"128","messages":"129","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"130","messages":"131","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"132","messages":"133","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"134","messages":"135","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"136","messages":"137","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"138","messages":"139","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"140","messages":"141","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"142","messages":"143","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"144","messages":"145","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"146","messages":"147","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"148","messages":"149","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"150","messages":"151","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"152","messages":"153","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"154","messages":"155","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"156","messages":"157","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestFragment.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestMutation.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestSubscription.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestWatchNodeQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/hooks.test.tsx",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/convertFetchPolicy.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/hooks.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/index.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment_PaginationQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ChildFragment.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ChildWatchNodeQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment_PaginationQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_QueryTypeFragment.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_QueryTypeWatchNodeQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_RefetchableFragment.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_RefetchableFragment_RefetchQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_Root_executionQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/index.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/types.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledFragment.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledLazyLoadQuery.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledPaginationFragment.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledRefetchableFragment.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useDeepCompareMemoize.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useForceUpdate.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks.test.tsx",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/createImportDocumentsTransform.test.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/createImportDocumentsTransform.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/fragmentReferencesFieldPolicy.test.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/fragmentReferencesFieldPolicy.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/index.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/nodeFromCacheFieldPolicy.test.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/nodeFromCacheFieldPolicy.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/shallowCompareFragmentReferences.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/typePolicies.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/types.ts",[]]
1
+ [{"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestFragment.graphql.ts":"1","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestMutation.graphql.ts":"2","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestQuery.graphql.ts":"3","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestSubscription.graphql.ts":"4","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestWatchNodeQuery.graphql.ts":"5","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/hooks.test.tsx":"6","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/useOverridenOrDefaultApolloClient.test.tsx":"7","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/convertFetchPolicy.ts":"8","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/hooks.ts":"9","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/index.ts":"10","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment.graphql.ts":"11","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment_PaginationQuery.graphql.ts":"12","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ChildFragment.graphql.ts":"13","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ChildWatchNodeQuery.graphql.ts":"14","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment.graphql.ts":"15","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment_PaginationQuery.graphql.ts":"16","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_QueryTypeFragment.graphql.ts":"17","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_QueryTypeWatchNodeQuery.graphql.ts":"18","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_RefetchableFragment.graphql.ts":"19","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_RefetchableFragment_RefetchQuery.graphql.ts":"20","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_Root_executionQuery.graphql.ts":"21","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/index.ts":"22","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/types.ts":"23","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledFragment.ts":"24","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledLazyLoadQuery.ts":"25","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledPaginationFragment.ts":"26","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledRefetchableFragment.ts":"27","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useDeepCompareMemoize.ts":"28","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useForceUpdate.ts":"29","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks.test.tsx":"30","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/createImportDocumentsTransform.test.ts":"31","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/createImportDocumentsTransform.ts":"32","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/fragmentReferencesFieldPolicy.test.ts":"33","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/fragmentReferencesFieldPolicy.ts":"34","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/index.ts":"35","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/nodeFromCacheFieldPolicy.test.ts":"36","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/nodeFromCacheFieldPolicy.ts":"37","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/shallowCompareFragmentReferences.ts":"38","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/typePolicies.ts":"39","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/types.ts":"40","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/useOverridenOrDefaultApolloClient.ts":"41"},{"size":527,"mtime":1653946283301,"results":"42","hashOfConfig":"43"},{"size":8845,"mtime":1653946283301,"results":"44","hashOfConfig":"43"},{"size":6838,"mtime":1653946283301,"results":"45","hashOfConfig":"43"},{"size":6980,"mtime":1653946283301,"results":"46","hashOfConfig":"43"},{"size":4869,"mtime":1653946283301,"results":"47","hashOfConfig":"43"},{"size":9970,"mtime":1653946283301,"results":"48","hashOfConfig":"43"},{"size":1915,"mtime":1653946283301,"results":"49","hashOfConfig":"43"},{"size":689,"mtime":1653946283301,"results":"50","hashOfConfig":"43"},{"size":8969,"mtime":1653946283301,"results":"51","hashOfConfig":"43"},{"size":174,"mtime":1653946283301,"results":"52","hashOfConfig":"43"},{"size":795,"mtime":1653946283301,"results":"53","hashOfConfig":"43"},{"size":21245,"mtime":1653946283301,"results":"54","hashOfConfig":"43"},{"size":542,"mtime":1653946283301,"results":"55","hashOfConfig":"43"},{"size":4762,"mtime":1653946283301,"results":"56","hashOfConfig":"43"},{"size":957,"mtime":1653946283301,"results":"57","hashOfConfig":"43"},{"size":34594,"mtime":1653946283305,"results":"58","hashOfConfig":"43"},{"size":607,"mtime":1653946283305,"results":"59","hashOfConfig":"43"},{"size":2420,"mtime":1653946283305,"results":"60","hashOfConfig":"43"},{"size":641,"mtime":1653946283305,"results":"61","hashOfConfig":"43"},{"size":11175,"mtime":1653946283305,"results":"62","hashOfConfig":"43"},{"size":27253,"mtime":1653946283305,"results":"63","hashOfConfig":"43"},{"size":445,"mtime":1653946283305,"results":"64","hashOfConfig":"43"},{"size":518,"mtime":1653946283305,"results":"65","hashOfConfig":"43"},{"size":2390,"mtime":1653946283305,"results":"66","hashOfConfig":"43"},{"size":3419,"mtime":1653946283305,"results":"67","hashOfConfig":"43"},{"size":8866,"mtime":1653946283305,"results":"68","hashOfConfig":"43"},{"size":5210,"mtime":1653946283305,"results":"69","hashOfConfig":"43"},{"size":843,"mtime":1653946283305,"results":"70","hashOfConfig":"43"},{"size":152,"mtime":1653946283305,"results":"71","hashOfConfig":"43"},{"size":33457,"mtime":1653946283305,"results":"72","hashOfConfig":"43"},{"size":2108,"mtime":1653946283305,"results":"73","hashOfConfig":"43"},{"size":5887,"mtime":1653946283305,"results":"74","hashOfConfig":"43"},{"size":1838,"mtime":1653946283305,"results":"75","hashOfConfig":"43"},{"size":285,"mtime":1653946283305,"results":"76","hashOfConfig":"43"},{"size":342,"mtime":1653946283305,"results":"77","hashOfConfig":"43"},{"size":3040,"mtime":1653946283305,"results":"78","hashOfConfig":"43"},{"size":2765,"mtime":1653946283305,"results":"79","hashOfConfig":"43"},{"size":2092,"mtime":1653946283305,"results":"80","hashOfConfig":"43"},{"size":1102,"mtime":1653946283305,"results":"81","hashOfConfig":"43"},{"size":1674,"mtime":1653946283305,"results":"82","hashOfConfig":"43"},{"size":1107,"mtime":1653946283305,"results":"83","hashOfConfig":"43"},{"filePath":"84","messages":"85","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1vsqegx",{"filePath":"86","messages":"87","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"88","messages":"89","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"90","messages":"91","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"92","messages":"93","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"94","messages":"95","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"96","messages":"97","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"98","messages":"99","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"100","messages":"101","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"102","messages":"103","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"104","messages":"105","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"106","messages":"107","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"108","messages":"109","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"110","messages":"111","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"112","messages":"113","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"114","messages":"115","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"116","messages":"117","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"118","messages":"119","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"120","messages":"121","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"122","messages":"123","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"124","messages":"125","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"126","messages":"127","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"128","messages":"129","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"130","messages":"131","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"132","messages":"133","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"134","messages":"135","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"136","messages":"137","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"138","messages":"139","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"140","messages":"141","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"142","messages":"143","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"144","messages":"145","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"146","messages":"147","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"148","messages":"149","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"150","messages":"151","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"152","messages":"153","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"154","messages":"155","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"156","messages":"157","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"158","messages":"159","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"160","messages":"161","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"162","messages":"163","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"164","messages":"165","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestFragment.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestMutation.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestSubscription.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestWatchNodeQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/hooks.test.tsx",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/useOverridenOrDefaultApolloClient.test.tsx",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/convertFetchPolicy.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/hooks.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/index.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment_PaginationQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ChildFragment.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ChildWatchNodeQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment_PaginationQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_QueryTypeFragment.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_QueryTypeWatchNodeQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_RefetchableFragment.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_RefetchableFragment_RefetchQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_Root_executionQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/index.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/types.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledFragment.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledLazyLoadQuery.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledPaginationFragment.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledRefetchableFragment.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useDeepCompareMemoize.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useForceUpdate.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks.test.tsx",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/createImportDocumentsTransform.test.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/createImportDocumentsTransform.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/fragmentReferencesFieldPolicy.test.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/fragmentReferencesFieldPolicy.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/index.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/nodeFromCacheFieldPolicy.test.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/nodeFromCacheFieldPolicy.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/shallowCompareFragmentReferences.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/typePolicies.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/types.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/useOverridenOrDefaultApolloClient.ts",[]]
package/CHANGELOG.md CHANGED
@@ -1,12 +1,37 @@
1
1
  # Change Log - @graphitation/apollo-react-relay-duct-tape
2
2
 
3
- This log was last generated on Fri, 01 Apr 2022 14:32:38 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 30 May 2022 21:36:42 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.0.1-alpha.5
8
+
9
+ Mon, 30 May 2022 21:36:42 GMT
10
+
11
+ ### Changes
12
+
13
+ - [duct-tape] Allow overriding of ApolloClient instance to be used (eloy.de.enige@gmail.com)
14
+
15
+ ## 1.0.1-alpha.4
16
+
17
+ Thu, 26 May 2022 00:34:26 GMT
18
+
19
+ ### Changes
20
+
21
+ - [duct-tape] Export import transform for ts-jest (eloy.de.enige@gmail.com)
22
+ - [duct-tape] Make artefact import transform work for es5 modules (eloy.de.enige@gmail.com)
23
+
24
+ ## 1.0.1-alpha.3
25
+
26
+ Thu, 07 Apr 2022 17:44:14 GMT
27
+
28
+ ### Changes
29
+
30
+ - [object Object] (eloy.de.enige@gmail.com)
31
+
7
32
  ## 1.0.1-alpha.2
8
33
 
9
- Fri, 01 Apr 2022 14:32:38 GMT
34
+ Fri, 01 Apr 2022 14:32:44 GMT
10
35
 
11
36
  ### Changes
12
37
 
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,WAAW,EACX,aAAa,EACd,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,SAAS,EACT,YAAY,EAKb,MAAM,kCAAkC,CAAC;AAG1C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,SAAS,aAAa,EAC3D,KAAK,EAAE,iBAAiB,EACxB,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,EAC9B,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,WAAW,CAAA;CAAE,GACtC;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;CAAE,CAa9C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CAAC,IAAI,SAAS,OAAO,EAC9C,aAAa,EAAE,iBAAiB,EAChC,WAAW,EAAE,IAAI,GAChB,WAAW,CAAC,IAAI,CAAC,CAMnB;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,SAAS,aAAa,EAC5B,IAAI,SAAS,OAAO,EAEpB,aAAa,EAAE,iBAAiB,EAChC,WAAW,EAAE,IAAI,GAChB,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CASpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,SAAS,aAAa,EAC5B,IAAI,SAAS,OAAO,EAEpB,aAAa,EAAE,iBAAiB,EAChC,WAAW,EAAE,IAAI,GAChB;IACD,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IACxB,QAAQ,EAAE,YAAY,CAAC;IACvB,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;CACzC,CASA;AAGD,UAAU,yBAAyB,CACjC,oBAAoB,SAAS,aAAa;IAE1C,YAAY,EAAE,iBAAiB,CAAC;IAChC,SAAS,EAAE,oBAAoB,CAAC,WAAW,CAAC,CAAC;IAC7C;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,oBAAoB,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IAC9D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,oBAAoB,SAAS,aAAa,EACxE,MAAM,EAAE,yBAAyB,CAAC,oBAAoB,CAAC,GACtD,IAAI,CA4BN;AAED,UAAU,yBAAyB,CAAC,gBAAgB,SAAS,aAAa;IACxE,SAAS,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;IACzC,kBAAkB,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,GAAG,IAAI,CAAC;CACnE;AAED,aAAK,gBAAgB,CAAC,gBAAgB,SAAS,aAAa,IAAI,CAC9D,OAAO,EAAE,yBAAyB,CAAC,gBAAgB,CAAC,KACjD,OAAO,CAAC;IAAE,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAA;CAAE,CAAC,CAAC;AAExE;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,gBAAgB,SAAS,aAAa,EAChE,QAAQ,EAAE,iBAAiB,GAC1B,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,CAwB/C"}
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,WAAW,EACX,aAAa,EACd,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,SAAS,EACT,YAAY,EAKb,MAAM,kCAAkC,CAAC;AAI1C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,SAAS,aAAa,EAC3D,KAAK,EAAE,iBAAiB,EACxB,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,EAC9B,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,WAAW,CAAA;CAAE,GACtC;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;CAAE,CAc9C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CAAC,IAAI,SAAS,OAAO,EAC9C,aAAa,EAAE,iBAAiB,EAChC,WAAW,EAAE,IAAI,GAChB,WAAW,CAAC,IAAI,CAAC,CAMnB;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,SAAS,aAAa,EAC5B,IAAI,SAAS,OAAO,EAEpB,aAAa,EAAE,iBAAiB,EAChC,WAAW,EAAE,IAAI,GAChB,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CASpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,SAAS,aAAa,EAC5B,IAAI,SAAS,OAAO,EAEpB,aAAa,EAAE,iBAAiB,EAChC,WAAW,EAAE,IAAI,GAChB;IACD,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IACxB,QAAQ,EAAE,YAAY,CAAC;IACvB,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;CACzC,CASA;AAGD,UAAU,yBAAyB,CACjC,oBAAoB,SAAS,aAAa;IAE1C,YAAY,EAAE,iBAAiB,CAAC;IAChC,SAAS,EAAE,oBAAoB,CAAC,WAAW,CAAC,CAAC;IAC7C;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,oBAAoB,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IAC9D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,oBAAoB,SAAS,aAAa,EACxE,MAAM,EAAE,yBAAyB,CAAC,oBAAoB,CAAC,GACtD,IAAI,CA8BN;AAED,UAAU,yBAAyB,CAAC,gBAAgB,SAAS,aAAa;IACxE,SAAS,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;IACzC,kBAAkB,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,GAAG,IAAI,CAAC;CACnE;AAED,aAAK,gBAAgB,CAAC,gBAAgB,SAAS,aAAa,IAAI,CAC9D,OAAO,EAAE,yBAAyB,CAAC,gBAAgB,CAAC,KACjD,OAAO,CAAC;IAAE,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAA;CAAE,CAAC,CAAC;AAExE;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,gBAAgB,SAAS,aAAa,EAChE,QAAQ,EAAE,iBAAiB,GAC1B,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,CA0B/C"}
package/lib/hooks.js CHANGED
@@ -67,6 +67,7 @@ var import_invariant = __toModule(require("invariant"));
67
67
  var import_client = __toModule(require("@apollo/client"));
68
68
  var import_compiledHooks = __toModule(require("./storeObservation/compiledHooks"));
69
69
  var import_convertFetchPolicy = __toModule(require("./convertFetchPolicy"));
70
+ var import_useOverridenOrDefaultApolloClient = __toModule(require("./useOverridenOrDefaultApolloClient"));
70
71
  function useLazyLoadQuery(query, variables, options) {
71
72
  const apolloOptions = options && __objSpread(__objSpread({}, options), {
72
73
  fetchPolicy: (0, import_convertFetchPolicy.convertFetchPolicy)(options.fetchPolicy)
@@ -76,7 +77,8 @@ function useLazyLoadQuery(query, variables, options) {
76
77
  variables
77
78
  }, apolloOptions));
78
79
  } else {
79
- return (0, import_client.useQuery)(query, __objSpread({variables}, apolloOptions));
80
+ const client = (0, import_useOverridenOrDefaultApolloClient.useOverridenOrDefaultApolloClient)();
81
+ return (0, import_client.useQuery)(query, __objSpread({client, variables}, apolloOptions));
80
82
  }
81
83
  }
82
84
  function useFragment(fragmentInput, fragmentRef) {
@@ -95,7 +97,9 @@ function usePaginationFragment(fragmentInput, fragmentRef) {
95
97
  return (0, import_compiledHooks.useCompiledPaginationFragment)(fragmentInput, fragmentRef);
96
98
  }
97
99
  function useSubscription(config) {
100
+ const client = (0, import_useOverridenOrDefaultApolloClient.useOverridenOrDefaultApolloClient)();
98
101
  const {error} = (0, import_client.useSubscription)(config.subscription, {
102
+ client,
99
103
  variables: config.variables,
100
104
  onSubscriptionData: ({subscriptionData}) => {
101
105
  (0, import_invariant.default)(!subscriptionData.error, "Did not expect to receive an error here");
@@ -113,7 +117,8 @@ function useSubscription(config) {
113
117
  }
114
118
  }
115
119
  function useMutation(mutation) {
116
- const [apolloUpdater, {loading: mutationLoading}] = (0, import_client.useMutation)(mutation);
120
+ const client = (0, import_useOverridenOrDefaultApolloClient.useOverridenOrDefaultApolloClient)();
121
+ const [apolloUpdater, {loading: mutationLoading}] = (0, import_client.useMutation)(mutation, {client});
117
122
  return [
118
123
  (options) => __async(this, null, function* () {
119
124
  const apolloResult = yield apolloUpdater({
package/lib/hooks.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/hooks.ts"],
4
- "sourcesContent": ["import { DocumentNode } from \"graphql\";\nimport invariant from \"invariant\";\nimport {\n useSubscription as useApolloSubscription,\n useQuery as useApolloQuery,\n useMutation as useApolloMutation,\n} from \"@apollo/client\";\n\nimport {\n FetchPolicy,\n GraphQLTaggedNode,\n KeyType,\n KeyTypeData,\n OperationType,\n} from \"./types\";\nimport {\n RefetchFn,\n PaginationFn,\n useCompiledLazyLoadQuery,\n useCompiledFragment,\n useCompiledRefetchableFragment,\n useCompiledPaginationFragment,\n} from \"./storeObservation/compiledHooks\";\nimport { convertFetchPolicy } from \"./convertFetchPolicy\";\n\n/**\n * Executes a GraphQL query.\n *\n * This hook is called 'lazy' as it is used to fetch a GraphQL query _during_ render. This hook can trigger multiple\n * round trips, one for loading and one for resolving.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-lazy-load-query}\n *\n * @param query The query operation to perform.\n * @param variables Object containing the variable values to fetch the query. These variables need to match GraphQL\n * variables declared inside the query.\n * @param options Options passed on to the underlying implementation.\n * @returns An object with either an error, the result data, or neither while loading.\n */\nexport function useLazyLoadQuery<TQuery extends OperationType>(\n query: GraphQLTaggedNode,\n variables: TQuery[\"variables\"],\n options?: { fetchPolicy?: FetchPolicy }\n): { error?: Error; data?: TQuery[\"response\"] } {\n const apolloOptions = options && {\n ...options,\n fetchPolicy: convertFetchPolicy(options.fetchPolicy),\n };\n if (query.watchQueryDocument) {\n return useCompiledLazyLoadQuery(query as any, {\n variables,\n ...apolloOptions,\n });\n } else {\n return useApolloQuery(query, { variables, ...apolloOptions });\n }\n}\n\n/**\n * A first-class way for an individual component to express its direct data requirements using GraphQL. The fragment\n * should select all the fields that the component directly uses in its rendering or needs to pass to external\n * functions. It should *not* select data that its children need, unless those children are intended to remain their\n * pure React props as data inputs.\n *\n * For children that *do* have their own data requirements expressed using GraphQL, the fragment should ensure to\n * spread in the child's fragment.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-fragment}\n *\n * @note For now, the fragment objects should be exported such that parent's can interpolate them into their own\n * GraphQL documents. This may change in the future when/if we entirely switch to static compilation and will\n * allow us to also move the usage of the graphql tagged template function inline at the `useFragment` call-site.\n *\n * @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections.\n */\nexport function useFragment<TKey extends KeyType>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): KeyTypeData<TKey> {\n if (fragmentInput.watchQueryDocument) {\n return useCompiledFragment(fragmentInput, fragmentRef as any);\n } else {\n return fragmentRef as unknown;\n }\n}\n\n/**\n * Equivalent to `useFragment`, but allows refetching of its subtree of the overall query.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-refetchable-fragment}\n *\n * @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections and a function to perform the refetch.\n */\nexport function useRefetchableFragment<\n TQuery extends OperationType,\n TKey extends KeyType\n>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): [data: KeyTypeData<TKey>, refetch: RefetchFn<TQuery[\"variables\"]>] {\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"useRefetchableFragment is only supported at this time when using compilation\"\n );\n return useCompiledRefetchableFragment(\n fragmentInput as any,\n fragmentRef as any\n );\n}\n\n/**\n * Equivalent to `useFragment`, but allows pagination of its subtree of the overall query.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-pagination-fragment}\n *\n * @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections and functions to deal with pagination.\n */\nexport function usePaginationFragment<\n TQuery extends OperationType,\n TKey extends KeyType\n>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): {\n data: KeyTypeData<TKey>;\n loadNext: PaginationFn;\n loadPrevious: PaginationFn;\n hasNext: boolean;\n hasPrevious: boolean;\n isLoadingNext: boolean;\n isLoadingPrevious: boolean;\n refetch: RefetchFn<TQuery[\"variables\"]>;\n} {\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"usePaginationFragment is only supported at this time when using compilation\"\n );\n return useCompiledPaginationFragment(\n fragmentInput as any,\n fragmentRef as any\n );\n}\n\n// https://github.com/facebook/relay/blob/master/website/docs/api-reference/types/GraphQLSubscriptionConfig.md\ninterface GraphQLSubscriptionConfig<\n TSubscriptionPayload extends OperationType\n> {\n subscription: GraphQLTaggedNode;\n variables: TSubscriptionPayload[\"variables\"];\n /**\n * Should response be nullable?\n */\n onNext?: (response: TSubscriptionPayload[\"response\"]) => void;\n onError?: (error: Error) => void;\n}\n\n/**\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-subscription}\n *\n * @param config\n */\nexport function useSubscription<TSubscriptionPayload extends OperationType>(\n config: GraphQLSubscriptionConfig<TSubscriptionPayload>\n): void {\n const { error } = useApolloSubscription(\n // TODO: Right now we don't replace mutation documents with imported artefacts.\n config.subscription as DocumentNode,\n {\n variables: config.variables,\n onSubscriptionData: ({ subscriptionData }) => {\n // Supposedly this never gets triggered for an error by design:\n // https://github.com/apollographql/react-apollo/issues/3177#issuecomment-506758144\n invariant(\n !subscriptionData.error,\n \"Did not expect to receive an error here\"\n );\n if (subscriptionData.data && config.onNext) {\n config.onNext(subscriptionData.data);\n }\n },\n }\n );\n if (error) {\n if (config.onError) {\n config.onError(error);\n } else {\n console.warn(\n `An unhandled GraphQL subscription error occurred: ${error.message}`\n );\n }\n }\n}\n\ninterface IMutationCommitterOptions<TMutationPayload extends OperationType> {\n variables: TMutationPayload[\"variables\"];\n optimisticResponse?: Partial<TMutationPayload[\"response\"]> | null;\n}\n\ntype MutationCommiter<TMutationPayload extends OperationType> = (\n options: IMutationCommitterOptions<TMutationPayload>\n) => Promise<{ errors?: Error[]; data?: TMutationPayload[\"response\"] }>;\n\n/**\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-mutation}\n *\n * @param mutation\n * @returns\n */\nexport function useMutation<TMutationPayload extends OperationType>(\n mutation: GraphQLTaggedNode\n): [MutationCommiter<TMutationPayload>, boolean] {\n const [apolloUpdater, { loading: mutationLoading }] = useApolloMutation(\n // TODO: Right now we don't replace mutation documents with imported artefacts.\n mutation as DocumentNode\n );\n\n return [\n async (options: IMutationCommitterOptions<TMutationPayload>) => {\n const apolloResult = await apolloUpdater({\n variables: options.variables || {},\n optimisticResponse: options.optimisticResponse,\n });\n if (apolloResult.errors) {\n return {\n errors: Array.from(Object.values(apolloResult.errors)),\n data: apolloResult.data,\n };\n }\n return {\n data: apolloResult.data,\n };\n },\n mutationLoading,\n ];\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,uBAAsB;AACtB,oBAIO;AASP,2BAOO;AACP,gCAAmC;AAgB5B,0BACL,OACA,WACA,SAC8C;AAC9C,QAAM,gBAAgB,WAAW,4BAC5B,UAD4B;AAAA,IAE/B,aAAa,kDAAmB,QAAQ;AAAA;AAE1C,MAAI,MAAM,oBAAoB;AAC5B,WAAO,mDAAyB,OAAc;AAAA,MAC5C;AAAA,OACG;AAAA,SAEA;AACL,WAAO,4BAAe,OAAO,aAAE,YAAc;AAAA;AAAA;AAwB1C,qBACL,eACA,aACmB;AACnB,MAAI,cAAc,oBAAoB;AACpC,WAAO,8CAAoB,eAAe;AAAA,SACrC;AACL,WAAO;AAAA;AAAA;AAcJ,gCAIL,eACA,aACoE;AACpE,gCACE,CAAC,CAAC,cAAc,oBAChB;AAEF,SAAO,yDACL,eACA;AAAA;AAcG,+BAIL,eACA,aAUA;AACA,gCACE,CAAC,CAAC,cAAc,oBAChB;AAEF,SAAO,wDACL,eACA;AAAA;AAsBG,yBACL,QACM;AACN,QAAM,CAAE,SAAU,mCAEhB,OAAO,cACP;AAAA,IACE,WAAW,OAAO;AAAA,IAClB,oBAAoB,CAAC,CAAE,sBAAuB;AAG5C,oCACE,CAAC,iBAAiB,OAClB;AAEF,UAAI,iBAAiB,QAAQ,OAAO,QAAQ;AAC1C,eAAO,OAAO,iBAAiB;AAAA;AAAA;AAAA;AAKvC,MAAI,OAAO;AACT,QAAI,OAAO,SAAS;AAClB,aAAO,QAAQ;AAAA,WACV;AACL,cAAQ,KACN,qDAAqD,MAAM;AAAA;AAAA;AAAA;AAqB5D,qBACL,UAC+C;AAC/C,QAAM,CAAC,eAAe,CAAE,SAAS,oBAAqB,+BAEpD;AAGF,SAAO;AAAA,IACL,CAAO,YAAyD;AAC9D,YAAM,eAAe,MAAM,cAAc;AAAA,QACvC,WAAW,QAAQ,aAAa;AAAA,QAChC,oBAAoB,QAAQ;AAAA;AAE9B,UAAI,aAAa,QAAQ;AACvB,eAAO;AAAA,UACL,QAAQ,MAAM,KAAK,OAAO,OAAO,aAAa;AAAA,UAC9C,MAAM,aAAa;AAAA;AAAA;AAGvB,aAAO;AAAA,QACL,MAAM,aAAa;AAAA;AAAA;AAAA,IAGvB;AAAA;AAAA;",
4
+ "sourcesContent": ["import { DocumentNode } from \"graphql\";\nimport invariant from \"invariant\";\nimport {\n useSubscription as useApolloSubscription,\n useQuery as useApolloQuery,\n useMutation as useApolloMutation,\n} from \"@apollo/client\";\n\nimport {\n FetchPolicy,\n GraphQLTaggedNode,\n KeyType,\n KeyTypeData,\n OperationType,\n} from \"./types\";\nimport {\n RefetchFn,\n PaginationFn,\n useCompiledLazyLoadQuery,\n useCompiledFragment,\n useCompiledRefetchableFragment,\n useCompiledPaginationFragment,\n} from \"./storeObservation/compiledHooks\";\nimport { convertFetchPolicy } from \"./convertFetchPolicy\";\nimport { useOverridenOrDefaultApolloClient } from \"./useOverridenOrDefaultApolloClient\";\n\n/**\n * Executes a GraphQL query.\n *\n * This hook is called 'lazy' as it is used to fetch a GraphQL query _during_ render. This hook can trigger multiple\n * round trips, one for loading and one for resolving.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-lazy-load-query}\n *\n * @param query The query operation to perform.\n * @param variables Object containing the variable values to fetch the query. These variables need to match GraphQL\n * variables declared inside the query.\n * @param options Options passed on to the underlying implementation.\n * @returns An object with either an error, the result data, or neither while loading.\n */\nexport function useLazyLoadQuery<TQuery extends OperationType>(\n query: GraphQLTaggedNode,\n variables: TQuery[\"variables\"],\n options?: { fetchPolicy?: FetchPolicy }\n): { error?: Error; data?: TQuery[\"response\"] } {\n const apolloOptions = options && {\n ...options,\n fetchPolicy: convertFetchPolicy(options.fetchPolicy),\n };\n if (query.watchQueryDocument) {\n return useCompiledLazyLoadQuery(query as any, {\n variables,\n ...apolloOptions,\n });\n } else {\n const client = useOverridenOrDefaultApolloClient();\n return useApolloQuery(query, { client, variables, ...apolloOptions });\n }\n}\n\n/**\n * A first-class way for an individual component to express its direct data requirements using GraphQL. The fragment\n * should select all the fields that the component directly uses in its rendering or needs to pass to external\n * functions. It should *not* select data that its children need, unless those children are intended to remain their\n * pure React props as data inputs.\n *\n * For children that *do* have their own data requirements expressed using GraphQL, the fragment should ensure to\n * spread in the child's fragment.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-fragment}\n *\n * @note For now, the fragment objects should be exported such that parent's can interpolate them into their own\n * GraphQL documents. This may change in the future when/if we entirely switch to static compilation and will\n * allow us to also move the usage of the graphql tagged template function inline at the `useFragment` call-site.\n *\n * @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections.\n */\nexport function useFragment<TKey extends KeyType>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): KeyTypeData<TKey> {\n if (fragmentInput.watchQueryDocument) {\n return useCompiledFragment(fragmentInput, fragmentRef as any);\n } else {\n return fragmentRef as unknown;\n }\n}\n\n/**\n * Equivalent to `useFragment`, but allows refetching of its subtree of the overall query.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-refetchable-fragment}\n *\n * @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections and a function to perform the refetch.\n */\nexport function useRefetchableFragment<\n TQuery extends OperationType,\n TKey extends KeyType\n>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): [data: KeyTypeData<TKey>, refetch: RefetchFn<TQuery[\"variables\"]>] {\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"useRefetchableFragment is only supported at this time when using compilation\"\n );\n return useCompiledRefetchableFragment(\n fragmentInput as any,\n fragmentRef as any\n );\n}\n\n/**\n * Equivalent to `useFragment`, but allows pagination of its subtree of the overall query.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-pagination-fragment}\n *\n * @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections and functions to deal with pagination.\n */\nexport function usePaginationFragment<\n TQuery extends OperationType,\n TKey extends KeyType\n>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): {\n data: KeyTypeData<TKey>;\n loadNext: PaginationFn;\n loadPrevious: PaginationFn;\n hasNext: boolean;\n hasPrevious: boolean;\n isLoadingNext: boolean;\n isLoadingPrevious: boolean;\n refetch: RefetchFn<TQuery[\"variables\"]>;\n} {\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"usePaginationFragment is only supported at this time when using compilation\"\n );\n return useCompiledPaginationFragment(\n fragmentInput as any,\n fragmentRef as any\n );\n}\n\n// https://github.com/facebook/relay/blob/master/website/docs/api-reference/types/GraphQLSubscriptionConfig.md\ninterface GraphQLSubscriptionConfig<\n TSubscriptionPayload extends OperationType\n> {\n subscription: GraphQLTaggedNode;\n variables: TSubscriptionPayload[\"variables\"];\n /**\n * Should response be nullable?\n */\n onNext?: (response: TSubscriptionPayload[\"response\"]) => void;\n onError?: (error: Error) => void;\n}\n\n/**\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-subscription}\n *\n * @param config\n */\nexport function useSubscription<TSubscriptionPayload extends OperationType>(\n config: GraphQLSubscriptionConfig<TSubscriptionPayload>\n): void {\n const client = useOverridenOrDefaultApolloClient();\n const { error } = useApolloSubscription(\n // TODO: Right now we don't replace mutation documents with imported artefacts.\n config.subscription as DocumentNode,\n {\n client,\n variables: config.variables,\n onSubscriptionData: ({ subscriptionData }) => {\n // Supposedly this never gets triggered for an error by design:\n // https://github.com/apollographql/react-apollo/issues/3177#issuecomment-506758144\n invariant(\n !subscriptionData.error,\n \"Did not expect to receive an error here\"\n );\n if (subscriptionData.data && config.onNext) {\n config.onNext(subscriptionData.data);\n }\n },\n }\n );\n if (error) {\n if (config.onError) {\n config.onError(error);\n } else {\n console.warn(\n `An unhandled GraphQL subscription error occurred: ${error.message}`\n );\n }\n }\n}\n\ninterface IMutationCommitterOptions<TMutationPayload extends OperationType> {\n variables: TMutationPayload[\"variables\"];\n optimisticResponse?: Partial<TMutationPayload[\"response\"]> | null;\n}\n\ntype MutationCommiter<TMutationPayload extends OperationType> = (\n options: IMutationCommitterOptions<TMutationPayload>\n) => Promise<{ errors?: Error[]; data?: TMutationPayload[\"response\"] }>;\n\n/**\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-mutation}\n *\n * @param mutation\n * @returns\n */\nexport function useMutation<TMutationPayload extends OperationType>(\n mutation: GraphQLTaggedNode\n): [MutationCommiter<TMutationPayload>, boolean] {\n const client = useOverridenOrDefaultApolloClient();\n const [apolloUpdater, { loading: mutationLoading }] = useApolloMutation(\n // TODO: Right now we don't replace mutation documents with imported artefacts.\n mutation as DocumentNode,\n { client }\n );\n\n return [\n async (options: IMutationCommitterOptions<TMutationPayload>) => {\n const apolloResult = await apolloUpdater({\n variables: options.variables || {},\n optimisticResponse: options.optimisticResponse,\n });\n if (apolloResult.errors) {\n return {\n errors: Array.from(Object.values(apolloResult.errors)),\n data: apolloResult.data,\n };\n }\n return {\n data: apolloResult.data,\n };\n },\n mutationLoading,\n ];\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,uBAAsB;AACtB,oBAIO;AASP,2BAOO;AACP,gCAAmC;AACnC,+CAAkD;AAgB3C,0BACL,OACA,WACA,SAC8C;AAC9C,QAAM,gBAAgB,WAAW,4BAC5B,UAD4B;AAAA,IAE/B,aAAa,kDAAmB,QAAQ;AAAA;AAE1C,MAAI,MAAM,oBAAoB;AAC5B,WAAO,mDAAyB,OAAc;AAAA,MAC5C;AAAA,OACG;AAAA,SAEA;AACL,UAAM,SAAS;AACf,WAAO,4BAAe,OAAO,aAAE,QAAQ,YAAc;AAAA;AAAA;AAwBlD,qBACL,eACA,aACmB;AACnB,MAAI,cAAc,oBAAoB;AACpC,WAAO,8CAAoB,eAAe;AAAA,SACrC;AACL,WAAO;AAAA;AAAA;AAcJ,gCAIL,eACA,aACoE;AACpE,gCACE,CAAC,CAAC,cAAc,oBAChB;AAEF,SAAO,yDACL,eACA;AAAA;AAcG,+BAIL,eACA,aAUA;AACA,gCACE,CAAC,CAAC,cAAc,oBAChB;AAEF,SAAO,wDACL,eACA;AAAA;AAsBG,yBACL,QACM;AACN,QAAM,SAAS;AACf,QAAM,CAAE,SAAU,mCAEhB,OAAO,cACP;AAAA,IACE;AAAA,IACA,WAAW,OAAO;AAAA,IAClB,oBAAoB,CAAC,CAAE,sBAAuB;AAG5C,oCACE,CAAC,iBAAiB,OAClB;AAEF,UAAI,iBAAiB,QAAQ,OAAO,QAAQ;AAC1C,eAAO,OAAO,iBAAiB;AAAA;AAAA;AAAA;AAKvC,MAAI,OAAO;AACT,QAAI,OAAO,SAAS;AAClB,aAAO,QAAQ;AAAA,WACV;AACL,cAAQ,KACN,qDAAqD,MAAM;AAAA;AAAA;AAAA;AAqB5D,qBACL,UAC+C;AAC/C,QAAM,SAAS;AACf,QAAM,CAAC,eAAe,CAAE,SAAS,oBAAqB,+BAEpD,UACA,CAAE;AAGJ,SAAO;AAAA,IACL,CAAO,YAAyD;AAC9D,YAAM,eAAe,MAAM,cAAc;AAAA,QACvC,WAAW,QAAQ,aAAa;AAAA,QAChC,oBAAoB,QAAQ;AAAA;AAE9B,UAAI,aAAa,QAAQ;AACvB,eAAO;AAAA,UACL,QAAQ,MAAM,KAAK,OAAO,OAAO,aAAa;AAAA,UAC9C,MAAM,aAAa;AAAA;AAAA;AAGvB,aAAO;AAAA,QACL,MAAM,aAAa;AAAA;AAAA;AAAA,IAGvB;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
package/lib/hooks.mjs CHANGED
@@ -49,6 +49,7 @@ import {
49
49
  useCompiledPaginationFragment
50
50
  } from "./storeObservation/compiledHooks/index.mjs";
51
51
  import {convertFetchPolicy} from "./convertFetchPolicy.mjs";
52
+ import {useOverridenOrDefaultApolloClient} from "./useOverridenOrDefaultApolloClient.mjs";
52
53
  function useLazyLoadQuery(query, variables, options) {
53
54
  const apolloOptions = options && __objSpread(__objSpread({}, options), {
54
55
  fetchPolicy: convertFetchPolicy(options.fetchPolicy)
@@ -58,7 +59,8 @@ function useLazyLoadQuery(query, variables, options) {
58
59
  variables
59
60
  }, apolloOptions));
60
61
  } else {
61
- return useApolloQuery(query, __objSpread({variables}, apolloOptions));
62
+ const client = useOverridenOrDefaultApolloClient();
63
+ return useApolloQuery(query, __objSpread({client, variables}, apolloOptions));
62
64
  }
63
65
  }
64
66
  function useFragment(fragmentInput, fragmentRef) {
@@ -77,7 +79,9 @@ function usePaginationFragment(fragmentInput, fragmentRef) {
77
79
  return useCompiledPaginationFragment(fragmentInput, fragmentRef);
78
80
  }
79
81
  function useSubscription(config) {
82
+ const client = useOverridenOrDefaultApolloClient();
80
83
  const {error} = useApolloSubscription(config.subscription, {
84
+ client,
81
85
  variables: config.variables,
82
86
  onSubscriptionData: ({subscriptionData}) => {
83
87
  invariant(!subscriptionData.error, "Did not expect to receive an error here");
@@ -95,7 +99,8 @@ function useSubscription(config) {
95
99
  }
96
100
  }
97
101
  function useMutation(mutation) {
98
- const [apolloUpdater, {loading: mutationLoading}] = useApolloMutation(mutation);
102
+ const client = useOverridenOrDefaultApolloClient();
103
+ const [apolloUpdater, {loading: mutationLoading}] = useApolloMutation(mutation, {client});
99
104
  return [
100
105
  (options) => __async(this, null, function* () {
101
106
  const apolloResult = yield apolloUpdater({
package/lib/hooks.mjs.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/hooks.ts"],
4
- "sourcesContent": ["import { DocumentNode } from \"graphql\";\nimport invariant from \"invariant\";\nimport {\n useSubscription as useApolloSubscription,\n useQuery as useApolloQuery,\n useMutation as useApolloMutation,\n} from \"@apollo/client\";\n\nimport {\n FetchPolicy,\n GraphQLTaggedNode,\n KeyType,\n KeyTypeData,\n OperationType,\n} from \"./types\";\nimport {\n RefetchFn,\n PaginationFn,\n useCompiledLazyLoadQuery,\n useCompiledFragment,\n useCompiledRefetchableFragment,\n useCompiledPaginationFragment,\n} from \"./storeObservation/compiledHooks\";\nimport { convertFetchPolicy } from \"./convertFetchPolicy\";\n\n/**\n * Executes a GraphQL query.\n *\n * This hook is called 'lazy' as it is used to fetch a GraphQL query _during_ render. This hook can trigger multiple\n * round trips, one for loading and one for resolving.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-lazy-load-query}\n *\n * @param query The query operation to perform.\n * @param variables Object containing the variable values to fetch the query. These variables need to match GraphQL\n * variables declared inside the query.\n * @param options Options passed on to the underlying implementation.\n * @returns An object with either an error, the result data, or neither while loading.\n */\nexport function useLazyLoadQuery<TQuery extends OperationType>(\n query: GraphQLTaggedNode,\n variables: TQuery[\"variables\"],\n options?: { fetchPolicy?: FetchPolicy }\n): { error?: Error; data?: TQuery[\"response\"] } {\n const apolloOptions = options && {\n ...options,\n fetchPolicy: convertFetchPolicy(options.fetchPolicy),\n };\n if (query.watchQueryDocument) {\n return useCompiledLazyLoadQuery(query as any, {\n variables,\n ...apolloOptions,\n });\n } else {\n return useApolloQuery(query, { variables, ...apolloOptions });\n }\n}\n\n/**\n * A first-class way for an individual component to express its direct data requirements using GraphQL. The fragment\n * should select all the fields that the component directly uses in its rendering or needs to pass to external\n * functions. It should *not* select data that its children need, unless those children are intended to remain their\n * pure React props as data inputs.\n *\n * For children that *do* have their own data requirements expressed using GraphQL, the fragment should ensure to\n * spread in the child's fragment.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-fragment}\n *\n * @note For now, the fragment objects should be exported such that parent's can interpolate them into their own\n * GraphQL documents. This may change in the future when/if we entirely switch to static compilation and will\n * allow us to also move the usage of the graphql tagged template function inline at the `useFragment` call-site.\n *\n * @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections.\n */\nexport function useFragment<TKey extends KeyType>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): KeyTypeData<TKey> {\n if (fragmentInput.watchQueryDocument) {\n return useCompiledFragment(fragmentInput, fragmentRef as any);\n } else {\n return fragmentRef as unknown;\n }\n}\n\n/**\n * Equivalent to `useFragment`, but allows refetching of its subtree of the overall query.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-refetchable-fragment}\n *\n * @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections and a function to perform the refetch.\n */\nexport function useRefetchableFragment<\n TQuery extends OperationType,\n TKey extends KeyType\n>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): [data: KeyTypeData<TKey>, refetch: RefetchFn<TQuery[\"variables\"]>] {\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"useRefetchableFragment is only supported at this time when using compilation\"\n );\n return useCompiledRefetchableFragment(\n fragmentInput as any,\n fragmentRef as any\n );\n}\n\n/**\n * Equivalent to `useFragment`, but allows pagination of its subtree of the overall query.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-pagination-fragment}\n *\n * @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections and functions to deal with pagination.\n */\nexport function usePaginationFragment<\n TQuery extends OperationType,\n TKey extends KeyType\n>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): {\n data: KeyTypeData<TKey>;\n loadNext: PaginationFn;\n loadPrevious: PaginationFn;\n hasNext: boolean;\n hasPrevious: boolean;\n isLoadingNext: boolean;\n isLoadingPrevious: boolean;\n refetch: RefetchFn<TQuery[\"variables\"]>;\n} {\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"usePaginationFragment is only supported at this time when using compilation\"\n );\n return useCompiledPaginationFragment(\n fragmentInput as any,\n fragmentRef as any\n );\n}\n\n// https://github.com/facebook/relay/blob/master/website/docs/api-reference/types/GraphQLSubscriptionConfig.md\ninterface GraphQLSubscriptionConfig<\n TSubscriptionPayload extends OperationType\n> {\n subscription: GraphQLTaggedNode;\n variables: TSubscriptionPayload[\"variables\"];\n /**\n * Should response be nullable?\n */\n onNext?: (response: TSubscriptionPayload[\"response\"]) => void;\n onError?: (error: Error) => void;\n}\n\n/**\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-subscription}\n *\n * @param config\n */\nexport function useSubscription<TSubscriptionPayload extends OperationType>(\n config: GraphQLSubscriptionConfig<TSubscriptionPayload>\n): void {\n const { error } = useApolloSubscription(\n // TODO: Right now we don't replace mutation documents with imported artefacts.\n config.subscription as DocumentNode,\n {\n variables: config.variables,\n onSubscriptionData: ({ subscriptionData }) => {\n // Supposedly this never gets triggered for an error by design:\n // https://github.com/apollographql/react-apollo/issues/3177#issuecomment-506758144\n invariant(\n !subscriptionData.error,\n \"Did not expect to receive an error here\"\n );\n if (subscriptionData.data && config.onNext) {\n config.onNext(subscriptionData.data);\n }\n },\n }\n );\n if (error) {\n if (config.onError) {\n config.onError(error);\n } else {\n console.warn(\n `An unhandled GraphQL subscription error occurred: ${error.message}`\n );\n }\n }\n}\n\ninterface IMutationCommitterOptions<TMutationPayload extends OperationType> {\n variables: TMutationPayload[\"variables\"];\n optimisticResponse?: Partial<TMutationPayload[\"response\"]> | null;\n}\n\ntype MutationCommiter<TMutationPayload extends OperationType> = (\n options: IMutationCommitterOptions<TMutationPayload>\n) => Promise<{ errors?: Error[]; data?: TMutationPayload[\"response\"] }>;\n\n/**\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-mutation}\n *\n * @param mutation\n * @returns\n */\nexport function useMutation<TMutationPayload extends OperationType>(\n mutation: GraphQLTaggedNode\n): [MutationCommiter<TMutationPayload>, boolean] {\n const [apolloUpdater, { loading: mutationLoading }] = useApolloMutation(\n // TODO: Right now we don't replace mutation documents with imported artefacts.\n mutation as DocumentNode\n );\n\n return [\n async (options: IMutationCommitterOptions<TMutationPayload>) => {\n const apolloResult = await apolloUpdater({\n variables: options.variables || {},\n optimisticResponse: options.optimisticResponse,\n });\n if (apolloResult.errors) {\n return {\n errors: Array.from(Object.values(apolloResult.errors)),\n data: apolloResult.data,\n };\n }\n return {\n data: apolloResult.data,\n };\n },\n mutationLoading,\n ];\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAaA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAgBO,0BACL,OACA,WACA,SAC8C;AAC9C,QAAM,gBAAgB,WAAW,4BAC5B,UAD4B;AAAA,IAE/B,aAAa,mBAAmB,QAAQ;AAAA;AAE1C,MAAI,MAAM,oBAAoB;AAC5B,WAAO,yBAAyB,OAAc;AAAA,MAC5C;AAAA,OACG;AAAA,SAEA;AACL,WAAO,eAAe,OAAO,aAAE,YAAc;AAAA;AAAA;AAwB1C,qBACL,eACA,aACmB;AACnB,MAAI,cAAc,oBAAoB;AACpC,WAAO,oBAAoB,eAAe;AAAA,SACrC;AACL,WAAO;AAAA;AAAA;AAcJ,gCAIL,eACA,aACoE;AACpE,YACE,CAAC,CAAC,cAAc,oBAChB;AAEF,SAAO,+BACL,eACA;AAAA;AAcG,+BAIL,eACA,aAUA;AACA,YACE,CAAC,CAAC,cAAc,oBAChB;AAEF,SAAO,8BACL,eACA;AAAA;AAsBG,yBACL,QACM;AACN,QAAM,CAAE,SAAU,sBAEhB,OAAO,cACP;AAAA,IACE,WAAW,OAAO;AAAA,IAClB,oBAAoB,CAAC,CAAE,sBAAuB;AAG5C,gBACE,CAAC,iBAAiB,OAClB;AAEF,UAAI,iBAAiB,QAAQ,OAAO,QAAQ;AAC1C,eAAO,OAAO,iBAAiB;AAAA;AAAA;AAAA;AAKvC,MAAI,OAAO;AACT,QAAI,OAAO,SAAS;AAClB,aAAO,QAAQ;AAAA,WACV;AACL,cAAQ,KACN,qDAAqD,MAAM;AAAA;AAAA;AAAA;AAqB5D,qBACL,UAC+C;AAC/C,QAAM,CAAC,eAAe,CAAE,SAAS,oBAAqB,kBAEpD;AAGF,SAAO;AAAA,IACL,CAAO,YAAyD;AAC9D,YAAM,eAAe,MAAM,cAAc;AAAA,QACvC,WAAW,QAAQ,aAAa;AAAA,QAChC,oBAAoB,QAAQ;AAAA;AAE9B,UAAI,aAAa,QAAQ;AACvB,eAAO;AAAA,UACL,QAAQ,MAAM,KAAK,OAAO,OAAO,aAAa;AAAA,UAC9C,MAAM,aAAa;AAAA;AAAA;AAGvB,aAAO;AAAA,QACL,MAAM,aAAa;AAAA;AAAA;AAAA,IAGvB;AAAA;AAAA;",
4
+ "sourcesContent": ["import { DocumentNode } from \"graphql\";\nimport invariant from \"invariant\";\nimport {\n useSubscription as useApolloSubscription,\n useQuery as useApolloQuery,\n useMutation as useApolloMutation,\n} from \"@apollo/client\";\n\nimport {\n FetchPolicy,\n GraphQLTaggedNode,\n KeyType,\n KeyTypeData,\n OperationType,\n} from \"./types\";\nimport {\n RefetchFn,\n PaginationFn,\n useCompiledLazyLoadQuery,\n useCompiledFragment,\n useCompiledRefetchableFragment,\n useCompiledPaginationFragment,\n} from \"./storeObservation/compiledHooks\";\nimport { convertFetchPolicy } from \"./convertFetchPolicy\";\nimport { useOverridenOrDefaultApolloClient } from \"./useOverridenOrDefaultApolloClient\";\n\n/**\n * Executes a GraphQL query.\n *\n * This hook is called 'lazy' as it is used to fetch a GraphQL query _during_ render. This hook can trigger multiple\n * round trips, one for loading and one for resolving.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-lazy-load-query}\n *\n * @param query The query operation to perform.\n * @param variables Object containing the variable values to fetch the query. These variables need to match GraphQL\n * variables declared inside the query.\n * @param options Options passed on to the underlying implementation.\n * @returns An object with either an error, the result data, or neither while loading.\n */\nexport function useLazyLoadQuery<TQuery extends OperationType>(\n query: GraphQLTaggedNode,\n variables: TQuery[\"variables\"],\n options?: { fetchPolicy?: FetchPolicy }\n): { error?: Error; data?: TQuery[\"response\"] } {\n const apolloOptions = options && {\n ...options,\n fetchPolicy: convertFetchPolicy(options.fetchPolicy),\n };\n if (query.watchQueryDocument) {\n return useCompiledLazyLoadQuery(query as any, {\n variables,\n ...apolloOptions,\n });\n } else {\n const client = useOverridenOrDefaultApolloClient();\n return useApolloQuery(query, { client, variables, ...apolloOptions });\n }\n}\n\n/**\n * A first-class way for an individual component to express its direct data requirements using GraphQL. The fragment\n * should select all the fields that the component directly uses in its rendering or needs to pass to external\n * functions. It should *not* select data that its children need, unless those children are intended to remain their\n * pure React props as data inputs.\n *\n * For children that *do* have their own data requirements expressed using GraphQL, the fragment should ensure to\n * spread in the child's fragment.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-fragment}\n *\n * @note For now, the fragment objects should be exported such that parent's can interpolate them into their own\n * GraphQL documents. This may change in the future when/if we entirely switch to static compilation and will\n * allow us to also move the usage of the graphql tagged template function inline at the `useFragment` call-site.\n *\n * @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections.\n */\nexport function useFragment<TKey extends KeyType>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): KeyTypeData<TKey> {\n if (fragmentInput.watchQueryDocument) {\n return useCompiledFragment(fragmentInput, fragmentRef as any);\n } else {\n return fragmentRef as unknown;\n }\n}\n\n/**\n * Equivalent to `useFragment`, but allows refetching of its subtree of the overall query.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-refetchable-fragment}\n *\n * @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections and a function to perform the refetch.\n */\nexport function useRefetchableFragment<\n TQuery extends OperationType,\n TKey extends KeyType\n>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): [data: KeyTypeData<TKey>, refetch: RefetchFn<TQuery[\"variables\"]>] {\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"useRefetchableFragment is only supported at this time when using compilation\"\n );\n return useCompiledRefetchableFragment(\n fragmentInput as any,\n fragmentRef as any\n );\n}\n\n/**\n * Equivalent to `useFragment`, but allows pagination of its subtree of the overall query.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-pagination-fragment}\n *\n * @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections and functions to deal with pagination.\n */\nexport function usePaginationFragment<\n TQuery extends OperationType,\n TKey extends KeyType\n>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): {\n data: KeyTypeData<TKey>;\n loadNext: PaginationFn;\n loadPrevious: PaginationFn;\n hasNext: boolean;\n hasPrevious: boolean;\n isLoadingNext: boolean;\n isLoadingPrevious: boolean;\n refetch: RefetchFn<TQuery[\"variables\"]>;\n} {\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"usePaginationFragment is only supported at this time when using compilation\"\n );\n return useCompiledPaginationFragment(\n fragmentInput as any,\n fragmentRef as any\n );\n}\n\n// https://github.com/facebook/relay/blob/master/website/docs/api-reference/types/GraphQLSubscriptionConfig.md\ninterface GraphQLSubscriptionConfig<\n TSubscriptionPayload extends OperationType\n> {\n subscription: GraphQLTaggedNode;\n variables: TSubscriptionPayload[\"variables\"];\n /**\n * Should response be nullable?\n */\n onNext?: (response: TSubscriptionPayload[\"response\"]) => void;\n onError?: (error: Error) => void;\n}\n\n/**\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-subscription}\n *\n * @param config\n */\nexport function useSubscription<TSubscriptionPayload extends OperationType>(\n config: GraphQLSubscriptionConfig<TSubscriptionPayload>\n): void {\n const client = useOverridenOrDefaultApolloClient();\n const { error } = useApolloSubscription(\n // TODO: Right now we don't replace mutation documents with imported artefacts.\n config.subscription as DocumentNode,\n {\n client,\n variables: config.variables,\n onSubscriptionData: ({ subscriptionData }) => {\n // Supposedly this never gets triggered for an error by design:\n // https://github.com/apollographql/react-apollo/issues/3177#issuecomment-506758144\n invariant(\n !subscriptionData.error,\n \"Did not expect to receive an error here\"\n );\n if (subscriptionData.data && config.onNext) {\n config.onNext(subscriptionData.data);\n }\n },\n }\n );\n if (error) {\n if (config.onError) {\n config.onError(error);\n } else {\n console.warn(\n `An unhandled GraphQL subscription error occurred: ${error.message}`\n );\n }\n }\n}\n\ninterface IMutationCommitterOptions<TMutationPayload extends OperationType> {\n variables: TMutationPayload[\"variables\"];\n optimisticResponse?: Partial<TMutationPayload[\"response\"]> | null;\n}\n\ntype MutationCommiter<TMutationPayload extends OperationType> = (\n options: IMutationCommitterOptions<TMutationPayload>\n) => Promise<{ errors?: Error[]; data?: TMutationPayload[\"response\"] }>;\n\n/**\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-mutation}\n *\n * @param mutation\n * @returns\n */\nexport function useMutation<TMutationPayload extends OperationType>(\n mutation: GraphQLTaggedNode\n): [MutationCommiter<TMutationPayload>, boolean] {\n const client = useOverridenOrDefaultApolloClient();\n const [apolloUpdater, { loading: mutationLoading }] = useApolloMutation(\n // TODO: Right now we don't replace mutation documents with imported artefacts.\n mutation as DocumentNode,\n { client }\n );\n\n return [\n async (options: IMutationCommitterOptions<TMutationPayload>) => {\n const apolloResult = await apolloUpdater({\n variables: options.variables || {},\n optimisticResponse: options.optimisticResponse,\n });\n if (apolloResult.errors) {\n return {\n errors: Array.from(Object.values(apolloResult.errors)),\n data: apolloResult.data,\n };\n }\n return {\n data: apolloResult.data,\n };\n },\n mutationLoading,\n ];\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAaA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AACA;AAgBO,0BACL,OACA,WACA,SAC8C;AAC9C,QAAM,gBAAgB,WAAW,4BAC5B,UAD4B;AAAA,IAE/B,aAAa,mBAAmB,QAAQ;AAAA;AAE1C,MAAI,MAAM,oBAAoB;AAC5B,WAAO,yBAAyB,OAAc;AAAA,MAC5C;AAAA,OACG;AAAA,SAEA;AACL,UAAM,SAAS;AACf,WAAO,eAAe,OAAO,aAAE,QAAQ,YAAc;AAAA;AAAA;AAwBlD,qBACL,eACA,aACmB;AACnB,MAAI,cAAc,oBAAoB;AACpC,WAAO,oBAAoB,eAAe;AAAA,SACrC;AACL,WAAO;AAAA;AAAA;AAcJ,gCAIL,eACA,aACoE;AACpE,YACE,CAAC,CAAC,cAAc,oBAChB;AAEF,SAAO,+BACL,eACA;AAAA;AAcG,+BAIL,eACA,aAUA;AACA,YACE,CAAC,CAAC,cAAc,oBAChB;AAEF,SAAO,8BACL,eACA;AAAA;AAsBG,yBACL,QACM;AACN,QAAM,SAAS;AACf,QAAM,CAAE,SAAU,sBAEhB,OAAO,cACP;AAAA,IACE;AAAA,IACA,WAAW,OAAO;AAAA,IAClB,oBAAoB,CAAC,CAAE,sBAAuB;AAG5C,gBACE,CAAC,iBAAiB,OAClB;AAEF,UAAI,iBAAiB,QAAQ,OAAO,QAAQ;AAC1C,eAAO,OAAO,iBAAiB;AAAA;AAAA;AAAA;AAKvC,MAAI,OAAO;AACT,QAAI,OAAO,SAAS;AAClB,aAAO,QAAQ;AAAA,WACV;AACL,cAAQ,KACN,qDAAqD,MAAM;AAAA;AAAA;AAAA;AAqB5D,qBACL,UAC+C;AAC/C,QAAM,SAAS;AACf,QAAM,CAAC,eAAe,CAAE,SAAS,oBAAqB,kBAEpD,UACA,CAAE;AAGJ,SAAO;AAAA,IACL,CAAO,YAAyD;AAC9D,YAAM,eAAe,MAAM,cAAc;AAAA,QACvC,WAAW,QAAQ,aAAa;AAAA,QAChC,oBAAoB,QAAQ;AAAA;AAE9B,UAAI,aAAa,QAAQ;AACvB,eAAO;AAAA,UACL,QAAQ,MAAM,KAAK,OAAO,OAAO,aAAa;AAAA,UAC9C,MAAM,aAAa;AAAA;AAAA;AAGvB,aAAO;AAAA,QACL,MAAM,aAAa;AAAA;AAAA;AAAA,IAGvB;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
package/lib/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./hooks";
2
2
  export * from "./types";
3
3
  export * from "./storeObservation";
4
+ export { ApolloReactRelayDuctTapeProvider } from "./useOverridenOrDefaultApolloClient";
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,gCAAgC,EAAE,MAAM,qCAAqC,CAAC"}
package/lib/index.js CHANGED
@@ -5,6 +5,10 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
7
  var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, {get: all[name], enumerable: true});
11
+ };
8
12
  var __reExport = (target, module2, desc) => {
9
13
  if (module2 && typeof module2 === "object" || typeof module2 === "function") {
10
14
  for (let key of __getOwnPropNames(module2))
@@ -17,6 +21,10 @@ var __toModule = (module2) => {
17
21
  return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: () => module2.default, enumerable: true} : {value: module2, enumerable: true})), module2);
18
22
  };
19
23
  __markAsModule(exports);
24
+ __export(exports, {
25
+ ApolloReactRelayDuctTapeProvider: () => import_useOverridenOrDefaultApolloClient.ApolloReactRelayDuctTapeProvider
26
+ });
20
27
  __reExport(exports, __toModule(require("./hooks")));
21
28
  __reExport(exports, __toModule(require("./types")));
22
29
  __reExport(exports, __toModule(require("./storeObservation")));
30
+ var import_useOverridenOrDefaultApolloClient = __toModule(require("./useOverridenOrDefaultApolloClient"));
package/lib/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["export * from \"./hooks\";\nexport * from \"./types\";\nexport * from \"./storeObservation\";\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA,oBAAc;AACd,oBAAc;AACd,oBAAc;",
4
+ "sourcesContent": ["export * from \"./hooks\";\nexport * from \"./types\";\nexport * from \"./storeObservation\";\nexport { ApolloReactRelayDuctTapeProvider } from \"./useOverridenOrDefaultApolloClient\";\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAc;AACd,oBAAc;AACd,oBAAc;AACd,+CAAiD;",
6
6
  "names": []
7
7
  }
package/lib/index.mjs CHANGED
@@ -2,3 +2,7 @@
2
2
  export * from "./hooks.mjs";
3
3
  export * from "./types.mjs";
4
4
  export * from "./storeObservation/index.mjs";
5
+ import {ApolloReactRelayDuctTapeProvider} from "./useOverridenOrDefaultApolloClient.mjs";
6
+ export {
7
+ ApolloReactRelayDuctTapeProvider
8
+ };
package/lib/index.mjs.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["export * from \"./hooks\";\nexport * from \"./types\";\nexport * from \"./storeObservation\";\n"],
5
- "mappings": ";AAAA;AACA;AACA;",
4
+ "sourcesContent": ["export * from \"./hooks\";\nexport * from \"./types\";\nexport * from \"./storeObservation\";\nexport { ApolloReactRelayDuctTapeProvider } from \"./useOverridenOrDefaultApolloClient\";\n"],
5
+ "mappings": ";AAAA;AACA;AACA;AACA;",
6
6
  "names": []
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useCompiledFragment.d.ts","sourceRoot":"","sources":["../../../src/storeObservation/compiledHooks/useCompiledFragment.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG5C;;;;GAIG;AAEH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,sBAAsB,EACjC,iBAAiB,EAAE,iBAAiB,GACnC,EAAE,CA2DJ"}
1
+ {"version":3,"file":"useCompiledFragment.d.ts","sourceRoot":"","sources":["../../../src/storeObservation/compiledHooks/useCompiledFragment.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAI5C;;;;GAIG;AAEH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,sBAAsB,EACjC,iBAAiB,EAAE,iBAAiB,GACnC,EAAE,CA2DJ"}
@@ -39,14 +39,14 @@ __export(exports, {
39
39
  useCompiledFragment: () => useCompiledFragment
40
40
  });
41
41
  var import_react = __toModule(require("react"));
42
- var import_client = __toModule(require("@apollo/client"));
43
42
  var import_invariant = __toModule(require("invariant"));
44
43
  var import_useForceUpdate = __toModule(require("./useForceUpdate"));
44
+ var import_useOverridenOrDefaultApolloClient = __toModule(require("../../useOverridenOrDefaultApolloClient"));
45
45
  function useCompiledFragment(documents, fragmentReference) {
46
46
  (0, import_invariant.default)(fragmentReference, "useFragment(): Expected metadata to have been extracted from the fragment. Did you forget to invoke the compiler?");
47
47
  const {watchQueryDocument, metadata} = documents;
48
48
  (0, import_invariant.default)(watchQueryDocument, "useFragment(): Expected a `watchQueryDocument` to have been extracted. Did you forget to invoke the compiler?");
49
- const client = (0, import_client.useApolloClient)();
49
+ const client = (0, import_useOverridenOrDefaultApolloClient.useOverridenOrDefaultApolloClient)();
50
50
  const forceUpdate = (0, import_useForceUpdate.useForceUpdate)();
51
51
  const observableQuery = (0, import_react.useMemo)(() => client.watchQuery({
52
52
  fetchPolicy: "cache-only",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/storeObservation/compiledHooks/useCompiledFragment.ts"],
4
- "sourcesContent": ["import { useEffect, useMemo } from \"react\";\nimport { useApolloClient } from \"@apollo/client\";\nimport invariant from \"invariant\";\nimport { CompiledArtefactModule } from \"relay-compiler-language-graphitation\";\nimport { FragmentReference } from \"./types\";\nimport { useForceUpdate } from \"./useForceUpdate\";\n\n/**\n * @param documents Compiled watch query document that is used to setup a narrow\n * observable for just the data selected by the original fragment.\n * @param fragmentReference A Node object that has a globally unique `id` field.\n */\n\nexport function useCompiledFragment(\n documents: CompiledArtefactModule,\n fragmentReference: FragmentReference\n): {} {\n invariant(\n fragmentReference,\n \"useFragment(): Expected metadata to have been extracted from \" +\n \"the fragment. Did you forget to invoke the compiler?\"\n );\n const { watchQueryDocument, metadata } = documents;\n invariant(\n watchQueryDocument,\n \"useFragment(): Expected a `watchQueryDocument` to have been \" +\n \"extracted. Did you forget to invoke the compiler?\"\n );\n\n const client = useApolloClient();\n const forceUpdate = useForceUpdate();\n\n const observableQuery = useMemo(\n () =>\n client.watchQuery({\n fetchPolicy: \"cache-only\",\n query: watchQueryDocument,\n returnPartialData: false,\n variables: {\n id: fragmentReference.id,\n __fragments: fragmentReference.__fragments,\n ...fragmentReference.__fragments,\n },\n }),\n [client, fragmentReference.id, fragmentReference.__fragments]\n );\n\n useEffect(() => {\n let skipFirst = true;\n const subscription = observableQuery.subscribe(\n () => {\n // Unclear why, but this yields twice with the same results, so skip one.\n if (skipFirst) {\n skipFirst = false;\n } else {\n forceUpdate();\n }\n },\n (error) => {\n console.log(error);\n }\n );\n return () => subscription.unsubscribe();\n }, [observableQuery]);\n\n const result = observableQuery.getCurrentResult();\n let data = result.data;\n if (metadata?.rootSelection) {\n data = data[metadata.rootSelection];\n }\n invariant(\n data,\n \"useFragment(): Expected Apollo to respond with previously seeded data of the execution query document\"\n );\n return data;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAmC;AACnC,oBAAgC;AAChC,uBAAsB;AAGtB,4BAA+B;AAQxB,6BACL,WACA,mBACI;AACJ,gCACE,mBACA;AAGF,QAAM,CAAE,oBAAoB,YAAa;AACzC,gCACE,oBACA;AAIF,QAAM,SAAS;AACf,QAAM,cAAc;AAEpB,QAAM,kBAAkB,0BACtB,MACE,OAAO,WAAW;AAAA,IAChB,aAAa;AAAA,IACb,OAAO;AAAA,IACP,mBAAmB;AAAA,IACnB,WAAW;AAAA,MACT,IAAI,kBAAkB;AAAA,MACtB,aAAa,kBAAkB;AAAA,OAC5B,kBAAkB;AAAA,MAG3B,CAAC,QAAQ,kBAAkB,IAAI,kBAAkB;AAGnD,8BAAU,MAAM;AACd,QAAI,YAAY;AAChB,UAAM,eAAe,gBAAgB,UACnC,MAAM;AAEJ,UAAI,WAAW;AACb,oBAAY;AAAA,aACP;AACL;AAAA;AAAA,OAGJ,CAAC,UAAU;AACT,cAAQ,IAAI;AAAA;AAGhB,WAAO,MAAM,aAAa;AAAA,KACzB,CAAC;AAEJ,QAAM,SAAS,gBAAgB;AAC/B,MAAI,OAAO,OAAO;AAClB,MAAI,qCAAU,eAAe;AAC3B,WAAO,KAAK,SAAS;AAAA;AAEvB,gCACE,MACA;AAEF,SAAO;AAAA;",
4
+ "sourcesContent": ["import { useEffect, useMemo } from \"react\";\nimport invariant from \"invariant\";\nimport { CompiledArtefactModule } from \"relay-compiler-language-graphitation\";\nimport { FragmentReference } from \"./types\";\nimport { useForceUpdate } from \"./useForceUpdate\";\nimport { useOverridenOrDefaultApolloClient } from \"../../useOverridenOrDefaultApolloClient\";\n\n/**\n * @param documents Compiled watch query document that is used to setup a narrow\n * observable for just the data selected by the original fragment.\n * @param fragmentReference A Node object that has a globally unique `id` field.\n */\n\nexport function useCompiledFragment(\n documents: CompiledArtefactModule,\n fragmentReference: FragmentReference\n): {} {\n invariant(\n fragmentReference,\n \"useFragment(): Expected metadata to have been extracted from \" +\n \"the fragment. Did you forget to invoke the compiler?\"\n );\n const { watchQueryDocument, metadata } = documents;\n invariant(\n watchQueryDocument,\n \"useFragment(): Expected a `watchQueryDocument` to have been \" +\n \"extracted. Did you forget to invoke the compiler?\"\n );\n\n const client = useOverridenOrDefaultApolloClient();\n const forceUpdate = useForceUpdate();\n\n const observableQuery = useMemo(\n () =>\n client.watchQuery({\n fetchPolicy: \"cache-only\",\n query: watchQueryDocument,\n returnPartialData: false,\n variables: {\n id: fragmentReference.id,\n __fragments: fragmentReference.__fragments,\n ...fragmentReference.__fragments,\n },\n }),\n [client, fragmentReference.id, fragmentReference.__fragments]\n );\n\n useEffect(() => {\n let skipFirst = true;\n const subscription = observableQuery.subscribe(\n () => {\n // Unclear why, but this yields twice with the same results, so skip one.\n if (skipFirst) {\n skipFirst = false;\n } else {\n forceUpdate();\n }\n },\n (error) => {\n console.log(error);\n }\n );\n return () => subscription.unsubscribe();\n }, [observableQuery]);\n\n const result = observableQuery.getCurrentResult();\n let data = result.data;\n if (metadata?.rootSelection) {\n data = data[metadata.rootSelection];\n }\n invariant(\n data,\n \"useFragment(): Expected Apollo to respond with previously seeded data of the execution query document\"\n );\n return data;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAmC;AACnC,uBAAsB;AAGtB,4BAA+B;AAC/B,+CAAkD;AAQ3C,6BACL,WACA,mBACI;AACJ,gCACE,mBACA;AAGF,QAAM,CAAE,oBAAoB,YAAa;AACzC,gCACE,oBACA;AAIF,QAAM,SAAS;AACf,QAAM,cAAc;AAEpB,QAAM,kBAAkB,0BACtB,MACE,OAAO,WAAW;AAAA,IAChB,aAAa;AAAA,IACb,OAAO;AAAA,IACP,mBAAmB;AAAA,IACnB,WAAW;AAAA,MACT,IAAI,kBAAkB;AAAA,MACtB,aAAa,kBAAkB;AAAA,OAC5B,kBAAkB;AAAA,MAG3B,CAAC,QAAQ,kBAAkB,IAAI,kBAAkB;AAGnD,8BAAU,MAAM;AACd,QAAI,YAAY;AAChB,UAAM,eAAe,gBAAgB,UACnC,MAAM;AAEJ,UAAI,WAAW;AACb,oBAAY;AAAA,aACP;AACL;AAAA;AAAA,OAGJ,CAAC,UAAU;AACT,cAAQ,IAAI;AAAA;AAGhB,WAAO,MAAM,aAAa;AAAA,KACzB,CAAC;AAEJ,QAAM,SAAS,gBAAgB;AAC/B,MAAI,OAAO,OAAO;AAClB,MAAI,qCAAU,eAAe;AAC3B,WAAO,KAAK,SAAS;AAAA;AAEvB,gCACE,MACA;AAEF,SAAO;AAAA;",
6
6
  "names": []
7
7
  }
@@ -17,14 +17,14 @@ var __objSpread = (a, b) => {
17
17
 
18
18
  // src/storeObservation/compiledHooks/useCompiledFragment.ts
19
19
  import {useEffect, useMemo} from "react";
20
- import {useApolloClient} from "@apollo/client";
21
20
  import invariant from "invariant";
22
21
  import {useForceUpdate} from "./useForceUpdate.mjs";
22
+ import {useOverridenOrDefaultApolloClient} from "../../useOverridenOrDefaultApolloClient.mjs";
23
23
  function useCompiledFragment(documents, fragmentReference) {
24
24
  invariant(fragmentReference, "useFragment(): Expected metadata to have been extracted from the fragment. Did you forget to invoke the compiler?");
25
25
  const {watchQueryDocument, metadata} = documents;
26
26
  invariant(watchQueryDocument, "useFragment(): Expected a `watchQueryDocument` to have been extracted. Did you forget to invoke the compiler?");
27
- const client = useApolloClient();
27
+ const client = useOverridenOrDefaultApolloClient();
28
28
  const forceUpdate = useForceUpdate();
29
29
  const observableQuery = useMemo(() => client.watchQuery({
30
30
  fetchPolicy: "cache-only",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/storeObservation/compiledHooks/useCompiledFragment.ts"],
4
- "sourcesContent": ["import { useEffect, useMemo } from \"react\";\nimport { useApolloClient } from \"@apollo/client\";\nimport invariant from \"invariant\";\nimport { CompiledArtefactModule } from \"relay-compiler-language-graphitation\";\nimport { FragmentReference } from \"./types\";\nimport { useForceUpdate } from \"./useForceUpdate\";\n\n/**\n * @param documents Compiled watch query document that is used to setup a narrow\n * observable for just the data selected by the original fragment.\n * @param fragmentReference A Node object that has a globally unique `id` field.\n */\n\nexport function useCompiledFragment(\n documents: CompiledArtefactModule,\n fragmentReference: FragmentReference\n): {} {\n invariant(\n fragmentReference,\n \"useFragment(): Expected metadata to have been extracted from \" +\n \"the fragment. Did you forget to invoke the compiler?\"\n );\n const { watchQueryDocument, metadata } = documents;\n invariant(\n watchQueryDocument,\n \"useFragment(): Expected a `watchQueryDocument` to have been \" +\n \"extracted. Did you forget to invoke the compiler?\"\n );\n\n const client = useApolloClient();\n const forceUpdate = useForceUpdate();\n\n const observableQuery = useMemo(\n () =>\n client.watchQuery({\n fetchPolicy: \"cache-only\",\n query: watchQueryDocument,\n returnPartialData: false,\n variables: {\n id: fragmentReference.id,\n __fragments: fragmentReference.__fragments,\n ...fragmentReference.__fragments,\n },\n }),\n [client, fragmentReference.id, fragmentReference.__fragments]\n );\n\n useEffect(() => {\n let skipFirst = true;\n const subscription = observableQuery.subscribe(\n () => {\n // Unclear why, but this yields twice with the same results, so skip one.\n if (skipFirst) {\n skipFirst = false;\n } else {\n forceUpdate();\n }\n },\n (error) => {\n console.log(error);\n }\n );\n return () => subscription.unsubscribe();\n }, [observableQuery]);\n\n const result = observableQuery.getCurrentResult();\n let data = result.data;\n if (metadata?.rootSelection) {\n data = data[metadata.rootSelection];\n }\n invariant(\n data,\n \"useFragment(): Expected Apollo to respond with previously seeded data of the execution query document\"\n );\n return data;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAGA;AAQO,6BACL,WACA,mBACI;AACJ,YACE,mBACA;AAGF,QAAM,CAAE,oBAAoB,YAAa;AACzC,YACE,oBACA;AAIF,QAAM,SAAS;AACf,QAAM,cAAc;AAEpB,QAAM,kBAAkB,QACtB,MACE,OAAO,WAAW;AAAA,IAChB,aAAa;AAAA,IACb,OAAO;AAAA,IACP,mBAAmB;AAAA,IACnB,WAAW;AAAA,MACT,IAAI,kBAAkB;AAAA,MACtB,aAAa,kBAAkB;AAAA,OAC5B,kBAAkB;AAAA,MAG3B,CAAC,QAAQ,kBAAkB,IAAI,kBAAkB;AAGnD,YAAU,MAAM;AACd,QAAI,YAAY;AAChB,UAAM,eAAe,gBAAgB,UACnC,MAAM;AAEJ,UAAI,WAAW;AACb,oBAAY;AAAA,aACP;AACL;AAAA;AAAA,OAGJ,CAAC,UAAU;AACT,cAAQ,IAAI;AAAA;AAGhB,WAAO,MAAM,aAAa;AAAA,KACzB,CAAC;AAEJ,QAAM,SAAS,gBAAgB;AAC/B,MAAI,OAAO,OAAO;AAClB,MAAI,qCAAU,eAAe;AAC3B,WAAO,KAAK,SAAS;AAAA;AAEvB,YACE,MACA;AAEF,SAAO;AAAA;",
4
+ "sourcesContent": ["import { useEffect, useMemo } from \"react\";\nimport invariant from \"invariant\";\nimport { CompiledArtefactModule } from \"relay-compiler-language-graphitation\";\nimport { FragmentReference } from \"./types\";\nimport { useForceUpdate } from \"./useForceUpdate\";\nimport { useOverridenOrDefaultApolloClient } from \"../../useOverridenOrDefaultApolloClient\";\n\n/**\n * @param documents Compiled watch query document that is used to setup a narrow\n * observable for just the data selected by the original fragment.\n * @param fragmentReference A Node object that has a globally unique `id` field.\n */\n\nexport function useCompiledFragment(\n documents: CompiledArtefactModule,\n fragmentReference: FragmentReference\n): {} {\n invariant(\n fragmentReference,\n \"useFragment(): Expected metadata to have been extracted from \" +\n \"the fragment. Did you forget to invoke the compiler?\"\n );\n const { watchQueryDocument, metadata } = documents;\n invariant(\n watchQueryDocument,\n \"useFragment(): Expected a `watchQueryDocument` to have been \" +\n \"extracted. Did you forget to invoke the compiler?\"\n );\n\n const client = useOverridenOrDefaultApolloClient();\n const forceUpdate = useForceUpdate();\n\n const observableQuery = useMemo(\n () =>\n client.watchQuery({\n fetchPolicy: \"cache-only\",\n query: watchQueryDocument,\n returnPartialData: false,\n variables: {\n id: fragmentReference.id,\n __fragments: fragmentReference.__fragments,\n ...fragmentReference.__fragments,\n },\n }),\n [client, fragmentReference.id, fragmentReference.__fragments]\n );\n\n useEffect(() => {\n let skipFirst = true;\n const subscription = observableQuery.subscribe(\n () => {\n // Unclear why, but this yields twice with the same results, so skip one.\n if (skipFirst) {\n skipFirst = false;\n } else {\n forceUpdate();\n }\n },\n (error) => {\n console.log(error);\n }\n );\n return () => subscription.unsubscribe();\n }, [observableQuery]);\n\n const result = observableQuery.getCurrentResult();\n let data = result.data;\n if (metadata?.rootSelection) {\n data = data[metadata.rootSelection];\n }\n invariant(\n data,\n \"useFragment(): Expected Apollo to respond with previously seeded data of the execution query document\"\n );\n return data;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AACA;AAGA;AACA;AAQO,6BACL,WACA,mBACI;AACJ,YACE,mBACA;AAGF,QAAM,CAAE,oBAAoB,YAAa;AACzC,YACE,oBACA;AAIF,QAAM,SAAS;AACf,QAAM,cAAc;AAEpB,QAAM,kBAAkB,QACtB,MACE,OAAO,WAAW;AAAA,IAChB,aAAa;AAAA,IACb,OAAO;AAAA,IACP,mBAAmB;AAAA,IACnB,WAAW;AAAA,MACT,IAAI,kBAAkB;AAAA,MACtB,aAAa,kBAAkB;AAAA,OAC5B,kBAAkB;AAAA,MAG3B,CAAC,QAAQ,kBAAkB,IAAI,kBAAkB;AAGnD,YAAU,MAAM;AACd,QAAI,YAAY;AAChB,UAAM,eAAe,gBAAgB,UACnC,MAAM;AAEJ,UAAI,WAAW;AACb,oBAAY;AAAA,aACP;AACL;AAAA;AAAA,OAGJ,CAAC,UAAU;AACT,cAAQ,IAAI;AAAA;AAGhB,WAAO,MAAM,aAAa;AAAA,KACzB,CAAC;AAEJ,QAAM,SAAS,gBAAgB;AAC/B,MAAI,OAAO,OAAO;AAClB,MAAI,qCAAU,eAAe;AAC3B,WAAO,KAAK,SAAS;AAAA;AAEvB,YACE,MACA;AAEF,SAAO;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useCompiledLazyLoadQuery.d.ts","sourceRoot":"","sources":["../../../src/storeObservation/compiledHooks/useCompiledLazyLoadQuery.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAmE9E;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,sBAAsB,EACjC,OAAO,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE,GAC1C;IAAE,IAAI,CAAC,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAwB/B"}
1
+ {"version":3,"file":"useCompiledLazyLoadQuery.d.ts","sourceRoot":"","sources":["../../../src/storeObservation/compiledHooks/useCompiledLazyLoadQuery.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAoE9E;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,sBAAsB,EACjC,OAAO,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE,GAC1C;IAAE,IAAI,CAAC,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAwB/B"}
@@ -29,6 +29,7 @@ var import_client = __toModule(require("@apollo/client"));
29
29
  var import_invariant = __toModule(require("invariant"));
30
30
  var import_useDeepCompareMemoize = __toModule(require("./useDeepCompareMemoize"));
31
31
  var import_useForceUpdate = __toModule(require("./useForceUpdate"));
32
+ var import_useOverridenOrDefaultApolloClient = __toModule(require("../../useOverridenOrDefaultApolloClient"));
32
33
  class ExecutionQueryHandler {
33
34
  constructor(onComplete) {
34
35
  this.onComplete = onComplete;
@@ -60,7 +61,7 @@ class ExecutionQueryHandler {
60
61
  }
61
62
  }
62
63
  function useExecutionQuery(executionQueryDocument, variables) {
63
- const client = (0, import_client.useApolloClient)();
64
+ const client = (0, import_useOverridenOrDefaultApolloClient.useOverridenOrDefaultApolloClient)();
64
65
  const forceUpdate = (0, import_useForceUpdate.useForceUpdate)();
65
66
  const execution = (0, import_react.useRef)(new ExecutionQueryHandler(() => forceUpdate()));
66
67
  (0, import_react.useEffect)(() => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/storeObservation/compiledHooks/useCompiledLazyLoadQuery.ts"],
4
- "sourcesContent": ["import { useRef, useEffect } from \"react\";\nimport {\n useApolloClient,\n useQuery as useApolloQuery,\n ObservableQuery,\n} from \"@apollo/client\";\nimport invariant from \"invariant\";\nimport { useDeepCompareMemoize } from \"./useDeepCompareMemoize\";\nimport { CompiledArtefactModule } from \"relay-compiler-language-graphitation\";\nimport { DocumentNode } from \"graphql\";\nimport { useForceUpdate } from \"./useForceUpdate\";\n\nclass ExecutionQueryHandler {\n public status: [loading: boolean, error?: Error];\n private querySubscription?: ZenObservable.Subscription;\n\n constructor(private onComplete: () => void) {\n this.status = [true, undefined];\n }\n\n public isIdle() {\n return this.status[0] && this.querySubscription === undefined;\n }\n\n public dispose() {\n this.querySubscription?.unsubscribe();\n this.querySubscription = undefined;\n }\n\n public reset() {\n this.dispose();\n this.status = [true, undefined];\n }\n\n private handleResult(error?: Error) {\n this.status = [false, error];\n this.dispose();\n this.onComplete();\n }\n\n public subscribe(observable: ObservableQuery) {\n this.querySubscription = observable.subscribe(\n ({ error: err }) => {\n this.handleResult(err);\n },\n (err) => {\n this.handleResult(err);\n }\n );\n }\n}\n\nfunction useExecutionQuery(\n executionQueryDocument: DocumentNode,\n variables: Record<string, any>\n): [loading: boolean, error?: Error] {\n const client = useApolloClient();\n const forceUpdate = useForceUpdate();\n const execution = useRef(new ExecutionQueryHandler(() => forceUpdate()));\n useEffect(() => {\n if (execution.current.isIdle()) {\n execution.current.subscribe(\n client.watchQuery({\n query: executionQueryDocument,\n variables,\n })\n );\n }\n return () => {\n execution.current.reset();\n };\n }, [executionQueryDocument, variables]);\n return execution.current.status;\n}\n\n/**\n * @todo Rewrite this to mimic Relay's preload APIs\n *\n * @param documents Compiled execute and watch query documents that are used to\n * setup a narrow observable for just the data selected by the\n * original fragment.\n * @param options An object containing a variables field.\n */\nexport function useCompiledLazyLoadQuery(\n documents: CompiledArtefactModule,\n options: { variables: Record<string, any> }\n): { data?: any; error?: Error } {\n const { watchQueryDocument } = documents;\n invariant(\n watchQueryDocument,\n \"useLazyLoadQuery(): Expected a `watchQueryDocument` to have been \" +\n \"extracted. Did you forget to invoke the compiler?\"\n );\n const { executionQueryDocument } = documents;\n invariant(\n executionQueryDocument,\n \"useLazyLoadQuery(): Expected a `executionQueryDocument` to have been \" +\n \"extracted. Did you forget to invoke the compiler?\"\n );\n const variables = useDeepCompareMemoize(options.variables);\n // First fetch all data needed for the entire tree...\n const [loading, error] = useExecutionQuery(executionQueryDocument, variables);\n // ...then fetch/watch data for only the calling component...\n const { data } = useApolloQuery(watchQueryDocument, {\n variables,\n fetchPolicy: \"cache-only\",\n // ...but only once finished loading.\n skip: loading || !!error,\n });\n return { data, error };\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkC;AAClC,oBAIO;AACP,uBAAsB;AACtB,mCAAsC;AAGtC,4BAA+B;AAE/B,4BAA4B;AAAA,EAI1B,YAAoB,YAAwB;AAAxB;AAClB,SAAK,SAAS,CAAC,MAAM;AAAA;AAAA,EAGhB,SAAS;AACd,WAAO,KAAK,OAAO,MAAM,KAAK,sBAAsB;AAAA;AAAA,EAG/C,UAAU;AAxBnB;AAyBI,eAAK,sBAAL,mBAAwB;AACxB,SAAK,oBAAoB;AAAA;AAAA,EAGpB,QAAQ;AACb,SAAK;AACL,SAAK,SAAS,CAAC,MAAM;AAAA;AAAA,EAGf,aAAa,OAAe;AAClC,SAAK,SAAS,CAAC,OAAO;AACtB,SAAK;AACL,SAAK;AAAA;AAAA,EAGA,UAAU,YAA6B;AAC5C,SAAK,oBAAoB,WAAW,UAClC,CAAC,CAAE,OAAO,SAAU;AAClB,WAAK,aAAa;AAAA,OAEpB,CAAC,QAAQ;AACP,WAAK,aAAa;AAAA;AAAA;AAAA;AAM1B,2BACE,wBACA,WACmC;AACnC,QAAM,SAAS;AACf,QAAM,cAAc;AACpB,QAAM,YAAY,yBAAO,IAAI,sBAAsB,MAAM;AACzD,8BAAU,MAAM;AACd,QAAI,UAAU,QAAQ,UAAU;AAC9B,gBAAU,QAAQ,UAChB,OAAO,WAAW;AAAA,QAChB,OAAO;AAAA,QACP;AAAA;AAAA;AAIN,WAAO,MAAM;AACX,gBAAU,QAAQ;AAAA;AAAA,KAEnB,CAAC,wBAAwB;AAC5B,SAAO,UAAU,QAAQ;AAAA;AAWpB,kCACL,WACA,SAC+B;AAC/B,QAAM,CAAE,sBAAuB;AAC/B,gCACE,oBACA;AAGF,QAAM,CAAE,0BAA2B;AACnC,gCACE,wBACA;AAGF,QAAM,YAAY,wDAAsB,QAAQ;AAEhD,QAAM,CAAC,SAAS,SAAS,kBAAkB,wBAAwB;AAEnE,QAAM,CAAE,QAAS,4BAAe,oBAAoB;AAAA,IAClD;AAAA,IACA,aAAa;AAAA,IAEb,MAAM,WAAW,CAAC,CAAC;AAAA;AAErB,SAAO,CAAE,MAAM;AAAA;",
4
+ "sourcesContent": ["import { useRef, useEffect } from \"react\";\nimport { useQuery as useApolloQuery, ObservableQuery } from \"@apollo/client\";\nimport invariant from \"invariant\";\nimport { useDeepCompareMemoize } from \"./useDeepCompareMemoize\";\nimport { CompiledArtefactModule } from \"relay-compiler-language-graphitation\";\nimport { DocumentNode } from \"graphql\";\nimport { useForceUpdate } from \"./useForceUpdate\";\nimport { useOverridenOrDefaultApolloClient } from \"../../useOverridenOrDefaultApolloClient\";\n\nclass ExecutionQueryHandler {\n public status: [loading: boolean, error?: Error];\n private querySubscription?: ZenObservable.Subscription;\n\n constructor(private onComplete: () => void) {\n this.status = [true, undefined];\n }\n\n public isIdle() {\n return this.status[0] && this.querySubscription === undefined;\n }\n\n public dispose() {\n this.querySubscription?.unsubscribe();\n this.querySubscription = undefined;\n }\n\n public reset() {\n this.dispose();\n this.status = [true, undefined];\n }\n\n private handleResult(error?: Error) {\n this.status = [false, error];\n this.dispose();\n this.onComplete();\n }\n\n public subscribe(observable: ObservableQuery) {\n this.querySubscription = observable.subscribe(\n ({ error: err }) => {\n this.handleResult(err);\n },\n (err) => {\n this.handleResult(err);\n }\n );\n }\n}\n\nfunction useExecutionQuery(\n executionQueryDocument: DocumentNode,\n variables: Record<string, any>\n): [loading: boolean, error?: Error] {\n const client = useOverridenOrDefaultApolloClient();\n const forceUpdate = useForceUpdate();\n const execution = useRef(new ExecutionQueryHandler(() => forceUpdate()));\n useEffect(() => {\n if (execution.current.isIdle()) {\n execution.current.subscribe(\n client.watchQuery({\n query: executionQueryDocument,\n variables,\n })\n );\n }\n return () => {\n execution.current.reset();\n };\n }, [executionQueryDocument, variables]);\n return execution.current.status;\n}\n\n/**\n * @todo Rewrite this to mimic Relay's preload APIs\n *\n * @param documents Compiled execute and watch query documents that are used to\n * setup a narrow observable for just the data selected by the\n * original fragment.\n * @param options An object containing a variables field.\n */\nexport function useCompiledLazyLoadQuery(\n documents: CompiledArtefactModule,\n options: { variables: Record<string, any> }\n): { data?: any; error?: Error } {\n const { watchQueryDocument } = documents;\n invariant(\n watchQueryDocument,\n \"useLazyLoadQuery(): Expected a `watchQueryDocument` to have been \" +\n \"extracted. Did you forget to invoke the compiler?\"\n );\n const { executionQueryDocument } = documents;\n invariant(\n executionQueryDocument,\n \"useLazyLoadQuery(): Expected a `executionQueryDocument` to have been \" +\n \"extracted. Did you forget to invoke the compiler?\"\n );\n const variables = useDeepCompareMemoize(options.variables);\n // First fetch all data needed for the entire tree...\n const [loading, error] = useExecutionQuery(executionQueryDocument, variables);\n // ...then fetch/watch data for only the calling component...\n const { data } = useApolloQuery(watchQueryDocument, {\n variables,\n fetchPolicy: \"cache-only\",\n // ...but only once finished loading.\n skip: loading || !!error,\n });\n return { data, error };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkC;AAClC,oBAA4D;AAC5D,uBAAsB;AACtB,mCAAsC;AAGtC,4BAA+B;AAC/B,+CAAkD;AAElD,4BAA4B;AAAA,EAI1B,YAAoB,YAAwB;AAAxB;AAClB,SAAK,SAAS,CAAC,MAAM;AAAA;AAAA,EAGhB,SAAS;AACd,WAAO,KAAK,OAAO,MAAM,KAAK,sBAAsB;AAAA;AAAA,EAG/C,UAAU;AArBnB;AAsBI,eAAK,sBAAL,mBAAwB;AACxB,SAAK,oBAAoB;AAAA;AAAA,EAGpB,QAAQ;AACb,SAAK;AACL,SAAK,SAAS,CAAC,MAAM;AAAA;AAAA,EAGf,aAAa,OAAe;AAClC,SAAK,SAAS,CAAC,OAAO;AACtB,SAAK;AACL,SAAK;AAAA;AAAA,EAGA,UAAU,YAA6B;AAC5C,SAAK,oBAAoB,WAAW,UAClC,CAAC,CAAE,OAAO,SAAU;AAClB,WAAK,aAAa;AAAA,OAEpB,CAAC,QAAQ;AACP,WAAK,aAAa;AAAA;AAAA;AAAA;AAM1B,2BACE,wBACA,WACmC;AACnC,QAAM,SAAS;AACf,QAAM,cAAc;AACpB,QAAM,YAAY,yBAAO,IAAI,sBAAsB,MAAM;AACzD,8BAAU,MAAM;AACd,QAAI,UAAU,QAAQ,UAAU;AAC9B,gBAAU,QAAQ,UAChB,OAAO,WAAW;AAAA,QAChB,OAAO;AAAA,QACP;AAAA;AAAA;AAIN,WAAO,MAAM;AACX,gBAAU,QAAQ;AAAA;AAAA,KAEnB,CAAC,wBAAwB;AAC5B,SAAO,UAAU,QAAQ;AAAA;AAWpB,kCACL,WACA,SAC+B;AAC/B,QAAM,CAAE,sBAAuB;AAC/B,gCACE,oBACA;AAGF,QAAM,CAAE,0BAA2B;AACnC,gCACE,wBACA;AAGF,QAAM,YAAY,wDAAsB,QAAQ;AAEhD,QAAM,CAAC,SAAS,SAAS,kBAAkB,wBAAwB;AAEnE,QAAM,CAAE,QAAS,4BAAe,oBAAoB;AAAA,IAClD;AAAA,IACA,aAAa;AAAA,IAEb,MAAM,WAAW,CAAC,CAAC;AAAA;AAErB,SAAO,CAAE,MAAM;AAAA;",
6
6
  "names": []
7
7
  }