@graphitation/apollo-react-relay-duct-tape 1.1.0 → 1.1.1
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.
- package/.eslintcache +1 -1
- package/CHANGELOG.md +10 -2
- package/lib/storeObservation/compiledHooks/useCompiledLazyLoadQuery.d.ts +2 -0
- package/lib/storeObservation/compiledHooks/useCompiledLazyLoadQuery.d.ts.map +1 -1
- package/lib/storeObservation/compiledHooks/useCompiledLazyLoadQuery.js +6 -4
- package/lib/storeObservation/compiledHooks/useCompiledLazyLoadQuery.js.map +2 -2
- package/lib/storeObservation/compiledHooks/useCompiledLazyLoadQuery.mjs +6 -4
- package/lib/storeObservation/compiledHooks/useCompiledLazyLoadQuery.mjs.map +2 -2
- package/package.json +1 -1
package/.eslintcache
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/hooks.test.tsx":"1","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/useOverridenOrDefaultApolloClient.test.tsx":"2","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/convertFetchPolicy.ts":"3","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/hooks.ts":"4","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/index.ts":"5","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__tests__/compiledHooks.test.tsx":"6","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__tests__/fragmentReferencesFieldPolicy.test.ts":"7","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__tests__/getPossibleTypesAndDataIdFromNode.test.ts":"8","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__tests__/nodeFromCacheFieldPolicy.test.ts":"9","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/index.ts":"10","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/types.ts":"11","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledFragment.ts":"12","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledLazyLoadQuery.ts":"13","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledPaginationFragment.ts":"14","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledRefetchableFragment.ts":"15","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useDeepCompareMemoize.ts":"16","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useForceUpdate.ts":"17","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/fragmentReferencesFieldPolicy.ts":"18","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/getPossibleTypesAndDataIdFromNode.ts":"19","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/index.ts":"20","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/nodeFromCacheFieldPolicy.ts":"21","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/shallowCompareFragmentReferences.ts":"22","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/typePolicies.ts":"23","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/types.ts":"24","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/useOverridenOrDefaultApolloClient.ts":"25"},{"size":11195,"mtime":1711399012992,"results":"26","hashOfConfig":"27"},{"size":1917,"mtime":1711399012992,"results":"28","hashOfConfig":"27"},{"size":690,"mtime":1711399012992,"results":"29","hashOfConfig":"27"},{"size":12265,"mtime":1711399012992,"results":"30","hashOfConfig":"27"},{"size":174,"mtime":1711399012992,"results":"31","hashOfConfig":"27"},{"size":37593,"mtime":1711399012992,"results":"32","hashOfConfig":"27"},{"size":1839,"mtime":1711399012992,"results":"33","hashOfConfig":"27"},{"size":1709,"mtime":1711399012992,"results":"34","hashOfConfig":"27"},{"size":3041,"mtime":1711399012992,"results":"35","hashOfConfig":"27"},{"size":445,"mtime":1711399012992,"results":"36","hashOfConfig":"27"},{"size":575,"mtime":1711399012992,"results":"37","hashOfConfig":"27"},{"size":3668,"mtime":1711399012992,"results":"38","hashOfConfig":"27"},{"size":3662,"mtime":1711399012992,"results":"39","hashOfConfig":"27"},{"size":10442,"mtime":1711399012992,"results":"40","hashOfConfig":"27"},{"size":5414,"mtime":1711399012992,"results":"41","hashOfConfig":"27"},{"size":843,"mtime":1711399012992,"results":"42","hashOfConfig":"27"},{"size":152,"mtime":1711399012992,"results":"43","hashOfConfig":"27"},{"size":286,"mtime":1711399012992,"results":"44","hashOfConfig":"27"},{"size":1243,"mtime":1711399012992,"results":"45","hashOfConfig":"27"},{"size":230,"mtime":1711399012992,"results":"46","hashOfConfig":"27"},{"size":2829,"mtime":1711399012992,"results":"47","hashOfConfig":"27"},{"size":2325,"mtime":1711399012992,"results":"48","hashOfConfig":"27"},{"size":1110,"mtime":1711399012992,"results":"49","hashOfConfig":"27"},{"size":2069,"mtime":1711399012992,"results":"50","hashOfConfig":"27"},{"size":1314,"mtime":1711399012992,"results":"51","hashOfConfig":"27"},{"filePath":"52","messages":"53","suppressedMessages":"54","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"qqqdtw",{"filePath":"55","messages":"56","suppressedMessages":"57","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"58","messages":"59","suppressedMessages":"60","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"61","messages":"62","suppressedMessages":"63","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"64","messages":"65","suppressedMessages":"66","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"67","messages":"68","suppressedMessages":"69","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"70","messages":"71","suppressedMessages":"72","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"73","messages":"74","suppressedMessages":"75","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"76","messages":"77","suppressedMessages":"78","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"79","messages":"80","suppressedMessages":"81","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"82","messages":"83","suppressedMessages":"84","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"85","messages":"86","suppressedMessages":"87","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"88","messages":"89","suppressedMessages":"90","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"91","messages":"92","suppressedMessages":"93","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"94","messages":"95","suppressedMessages":"96","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"97","messages":"98","suppressedMessages":"99","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"100","messages":"101","suppressedMessages":"102","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"103","messages":"104","suppressedMessages":"105","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"106","messages":"107","suppressedMessages":"108","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"109","messages":"110","suppressedMessages":"111","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"112","messages":"113","suppressedMessages":"114","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"115","messages":"116","suppressedMessages":"117","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"118","messages":"119","suppressedMessages":"120","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"121","messages":"122","suppressedMessages":"123","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"124","messages":"125","suppressedMessages":"126","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/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",[],["127"],"/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/__tests__/compiledHooks.test.tsx",[],[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__tests__/fragmentReferencesFieldPolicy.test.ts",[],[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__tests__/getPossibleTypesAndDataIdFromNode.test.ts",[],[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__tests__/nodeFromCacheFieldPolicy.test.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",[],["128"],"/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",[],["129"],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledPaginationFragment.ts",[],["130","131","132","133","134"],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledRefetchableFragment.ts",[],["135"],"/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/fragmentReferencesFieldPolicy.ts",[],[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/getPossibleTypesAndDataIdFromNode.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.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",[],["136","137"],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/useOverridenOrDefaultApolloClient.ts",[],["138"],{"ruleId":"139","severity":1,"message":"140","line":319,"column":38,"nodeType":"141","messageId":"142","endLine":319,"endColumn":41,"suggestions":"143","suppressions":"144"},{"ruleId":"139","severity":1,"message":"140","line":16,"column":32,"nodeType":"141","messageId":"142","endLine":16,"endColumn":35,"suggestions":"145","suppressions":"146"},{"ruleId":"139","severity":1,"message":"140","line":87,"column":28,"nodeType":"141","messageId":"142","endLine":87,"endColumn":31,"suggestions":"147","suppressions":"148"},{"ruleId":"139","severity":1,"message":"140","line":170,"column":24,"nodeType":"141","messageId":"142","endLine":170,"endColumn":27,"suggestions":"149","suppressions":"150"},{"ruleId":"139","severity":1,"message":"140","line":173,"column":4,"nodeType":"141","messageId":"142","endLine":173,"endColumn":7,"suggestions":"151","suppressions":"152"},{"ruleId":"139","severity":1,"message":"140","line":175,"column":30,"nodeType":"141","messageId":"142","endLine":175,"endColumn":33,"suggestions":"153","suppressions":"154"},{"ruleId":"139","severity":1,"message":"140","line":185,"column":24,"nodeType":"141","messageId":"142","endLine":185,"endColumn":27,"suggestions":"155","suppressions":"156"},{"ruleId":"139","severity":1,"message":"140","line":221,"column":9,"nodeType":"141","messageId":"142","endLine":221,"endColumn":12,"suggestions":"157","suppressions":"158"},{"ruleId":"139","severity":1,"message":"140","line":38,"column":26,"nodeType":"141","messageId":"142","endLine":38,"endColumn":29,"suggestions":"159","suppressions":"160"},{"ruleId":"139","severity":1,"message":"140","line":5,"column":19,"nodeType":"141","messageId":"142","endLine":5,"endColumn":22,"suggestions":"161","suppressions":"162"},{"ruleId":"139","severity":1,"message":"140","line":10,"column":19,"nodeType":"141","messageId":"142","endLine":10,"endColumn":22,"suggestions":"163","suppressions":"164"},{"ruleId":"139","severity":1,"message":"140","line":17,"column":51,"nodeType":"141","messageId":"142","endLine":17,"endColumn":54,"suggestions":"165","suppressions":"166"},"@typescript-eslint/no-explicit-any","Unexpected any. Specify a different type.","TSAnyKeyword","unexpectedAny",["167","168"],["169"],["170","171"],["172"],["173","174"],["175"],["176","177"],["178"],["179","180"],["181"],["182","183"],["184"],["185","186"],["187"],["188","189"],["190"],["191","192"],["193"],["194","195"],["196"],["197","198"],["199"],["200","201"],["202"],{"messageId":"203","fix":"204","desc":"205"},{"messageId":"206","fix":"207","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"211","desc":"205"},{"messageId":"206","fix":"212","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"213","desc":"205"},{"messageId":"206","fix":"214","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"215","desc":"205"},{"messageId":"206","fix":"216","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"217","desc":"205"},{"messageId":"206","fix":"218","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"219","desc":"205"},{"messageId":"206","fix":"220","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"221","desc":"205"},{"messageId":"206","fix":"222","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"223","desc":"205"},{"messageId":"206","fix":"224","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"225","desc":"205"},{"messageId":"206","fix":"226","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"227","desc":"205"},{"messageId":"206","fix":"228","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"229","desc":"205"},{"messageId":"206","fix":"230","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"231","desc":"205"},{"messageId":"206","fix":"232","desc":"208"},{"kind":"209","justification":"210"},"suggestUnknown",{"range":"233","text":"234"},"Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct.","suggestNever",{"range":"233","text":"235"},"Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.","directive","",{"range":"236","text":"234"},{"range":"236","text":"235"},{"range":"237","text":"234"},{"range":"237","text":"235"},{"range":"238","text":"234"},{"range":"238","text":"235"},{"range":"239","text":"234"},{"range":"239","text":"235"},{"range":"240","text":"234"},{"range":"240","text":"235"},{"range":"241","text":"234"},{"range":"241","text":"235"},{"range":"242","text":"234"},{"range":"242","text":"235"},{"range":"243","text":"234"},{"range":"243","text":"235"},{"range":"244","text":"234"},{"range":"244","text":"235"},{"range":"245","text":"234"},{"range":"245","text":"235"},{"range":"246","text":"234"},{"range":"246","text":"235"},[11682,11685],"unknown","never",[567,570],[2626,2629],[5796,5799],[5897,5900],[5997,6000],[6286,6289],[7350,7353],[1283,1286],[158,161],[276,279],[455,458]]
|
|
1
|
+
[{"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/hooks.test.tsx":"1","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/useOverridenOrDefaultApolloClient.test.tsx":"2","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/convertFetchPolicy.ts":"3","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/hooks.ts":"4","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/index.ts":"5","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__tests__/compiledHooks.test.tsx":"6","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__tests__/fragmentReferencesFieldPolicy.test.ts":"7","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__tests__/getPossibleTypesAndDataIdFromNode.test.ts":"8","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__tests__/nodeFromCacheFieldPolicy.test.ts":"9","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/index.ts":"10","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/types.ts":"11","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledFragment.ts":"12","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledLazyLoadQuery.ts":"13","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledPaginationFragment.ts":"14","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledRefetchableFragment.ts":"15","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useDeepCompareMemoize.ts":"16","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useForceUpdate.ts":"17","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/fragmentReferencesFieldPolicy.ts":"18","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/getPossibleTypesAndDataIdFromNode.ts":"19","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/index.ts":"20","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/nodeFromCacheFieldPolicy.ts":"21","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/shallowCompareFragmentReferences.ts":"22","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/typePolicies.ts":"23","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/types.ts":"24","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/useOverridenOrDefaultApolloClient.ts":"25"},{"size":11195,"mtime":1711404127083,"results":"26","hashOfConfig":"27"},{"size":1917,"mtime":1711404127083,"results":"28","hashOfConfig":"27"},{"size":690,"mtime":1711404127083,"results":"29","hashOfConfig":"27"},{"size":12265,"mtime":1711404127083,"results":"30","hashOfConfig":"27"},{"size":174,"mtime":1711404127083,"results":"31","hashOfConfig":"27"},{"size":39560,"mtime":1711404127083,"results":"32","hashOfConfig":"27"},{"size":1839,"mtime":1711404127083,"results":"33","hashOfConfig":"27"},{"size":1709,"mtime":1711404127083,"results":"34","hashOfConfig":"27"},{"size":3041,"mtime":1711404127083,"results":"35","hashOfConfig":"27"},{"size":445,"mtime":1711404127083,"results":"36","hashOfConfig":"27"},{"size":575,"mtime":1711404127083,"results":"37","hashOfConfig":"27"},{"size":3668,"mtime":1711404127083,"results":"38","hashOfConfig":"27"},{"size":3851,"mtime":1711404127083,"results":"39","hashOfConfig":"27"},{"size":10442,"mtime":1711404127087,"results":"40","hashOfConfig":"27"},{"size":5414,"mtime":1711404127087,"results":"41","hashOfConfig":"27"},{"size":843,"mtime":1711404127087,"results":"42","hashOfConfig":"27"},{"size":152,"mtime":1711404127087,"results":"43","hashOfConfig":"27"},{"size":286,"mtime":1711404127087,"results":"44","hashOfConfig":"27"},{"size":1243,"mtime":1711404127087,"results":"45","hashOfConfig":"27"},{"size":230,"mtime":1711404127087,"results":"46","hashOfConfig":"27"},{"size":2829,"mtime":1711404127087,"results":"47","hashOfConfig":"27"},{"size":2325,"mtime":1711404127087,"results":"48","hashOfConfig":"27"},{"size":1110,"mtime":1711404127087,"results":"49","hashOfConfig":"27"},{"size":2069,"mtime":1711404127087,"results":"50","hashOfConfig":"27"},{"size":1314,"mtime":1711404127087,"results":"51","hashOfConfig":"27"},{"filePath":"52","messages":"53","suppressedMessages":"54","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"qqqdtw",{"filePath":"55","messages":"56","suppressedMessages":"57","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"58","messages":"59","suppressedMessages":"60","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"61","messages":"62","suppressedMessages":"63","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"64","messages":"65","suppressedMessages":"66","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"67","messages":"68","suppressedMessages":"69","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"70","messages":"71","suppressedMessages":"72","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"73","messages":"74","suppressedMessages":"75","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"76","messages":"77","suppressedMessages":"78","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"79","messages":"80","suppressedMessages":"81","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"82","messages":"83","suppressedMessages":"84","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"85","messages":"86","suppressedMessages":"87","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"88","messages":"89","suppressedMessages":"90","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"91","messages":"92","suppressedMessages":"93","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"94","messages":"95","suppressedMessages":"96","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"97","messages":"98","suppressedMessages":"99","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"100","messages":"101","suppressedMessages":"102","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"103","messages":"104","suppressedMessages":"105","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"106","messages":"107","suppressedMessages":"108","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"109","messages":"110","suppressedMessages":"111","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"112","messages":"113","suppressedMessages":"114","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"115","messages":"116","suppressedMessages":"117","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"118","messages":"119","suppressedMessages":"120","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"121","messages":"122","suppressedMessages":"123","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"124","messages":"125","suppressedMessages":"126","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/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",[],["127"],"/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/__tests__/compiledHooks.test.tsx",[],[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__tests__/fragmentReferencesFieldPolicy.test.ts",[],[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__tests__/getPossibleTypesAndDataIdFromNode.test.ts",[],[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__tests__/nodeFromCacheFieldPolicy.test.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",[],["128"],"/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",[],["129"],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledPaginationFragment.ts",[],["130","131","132","133","134"],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledRefetchableFragment.ts",[],["135"],"/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/fragmentReferencesFieldPolicy.ts",[],[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/getPossibleTypesAndDataIdFromNode.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.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",[],["136","137"],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/useOverridenOrDefaultApolloClient.ts",[],["138"],{"ruleId":"139","severity":1,"message":"140","line":319,"column":38,"nodeType":"141","messageId":"142","endLine":319,"endColumn":41,"suggestions":"143","suppressions":"144"},{"ruleId":"139","severity":1,"message":"140","line":16,"column":32,"nodeType":"141","messageId":"142","endLine":16,"endColumn":35,"suggestions":"145","suppressions":"146"},{"ruleId":"139","severity":1,"message":"140","line":96,"column":28,"nodeType":"141","messageId":"142","endLine":96,"endColumn":31,"suggestions":"147","suppressions":"148"},{"ruleId":"139","severity":1,"message":"140","line":170,"column":24,"nodeType":"141","messageId":"142","endLine":170,"endColumn":27,"suggestions":"149","suppressions":"150"},{"ruleId":"139","severity":1,"message":"140","line":173,"column":4,"nodeType":"141","messageId":"142","endLine":173,"endColumn":7,"suggestions":"151","suppressions":"152"},{"ruleId":"139","severity":1,"message":"140","line":175,"column":30,"nodeType":"141","messageId":"142","endLine":175,"endColumn":33,"suggestions":"153","suppressions":"154"},{"ruleId":"139","severity":1,"message":"140","line":185,"column":24,"nodeType":"141","messageId":"142","endLine":185,"endColumn":27,"suggestions":"155","suppressions":"156"},{"ruleId":"139","severity":1,"message":"140","line":221,"column":9,"nodeType":"141","messageId":"142","endLine":221,"endColumn":12,"suggestions":"157","suppressions":"158"},{"ruleId":"139","severity":1,"message":"140","line":38,"column":26,"nodeType":"141","messageId":"142","endLine":38,"endColumn":29,"suggestions":"159","suppressions":"160"},{"ruleId":"139","severity":1,"message":"140","line":5,"column":19,"nodeType":"141","messageId":"142","endLine":5,"endColumn":22,"suggestions":"161","suppressions":"162"},{"ruleId":"139","severity":1,"message":"140","line":10,"column":19,"nodeType":"141","messageId":"142","endLine":10,"endColumn":22,"suggestions":"163","suppressions":"164"},{"ruleId":"139","severity":1,"message":"140","line":17,"column":51,"nodeType":"141","messageId":"142","endLine":17,"endColumn":54,"suggestions":"165","suppressions":"166"},"@typescript-eslint/no-explicit-any","Unexpected any. Specify a different type.","TSAnyKeyword","unexpectedAny",["167","168"],["169"],["170","171"],["172"],["173","174"],["175"],["176","177"],["178"],["179","180"],["181"],["182","183"],["184"],["185","186"],["187"],["188","189"],["190"],["191","192"],["193"],["194","195"],["196"],["197","198"],["199"],["200","201"],["202"],{"messageId":"203","fix":"204","desc":"205"},{"messageId":"206","fix":"207","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"211","desc":"205"},{"messageId":"206","fix":"212","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"213","desc":"205"},{"messageId":"206","fix":"214","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"215","desc":"205"},{"messageId":"206","fix":"216","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"217","desc":"205"},{"messageId":"206","fix":"218","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"219","desc":"205"},{"messageId":"206","fix":"220","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"221","desc":"205"},{"messageId":"206","fix":"222","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"223","desc":"205"},{"messageId":"206","fix":"224","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"225","desc":"205"},{"messageId":"206","fix":"226","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"227","desc":"205"},{"messageId":"206","fix":"228","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"229","desc":"205"},{"messageId":"206","fix":"230","desc":"208"},{"kind":"209","justification":"210"},{"messageId":"203","fix":"231","desc":"205"},{"messageId":"206","fix":"232","desc":"208"},{"kind":"209","justification":"210"},"suggestUnknown",{"range":"233","text":"234"},"Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct.","suggestNever",{"range":"233","text":"235"},"Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.","directive","",{"range":"236","text":"234"},{"range":"236","text":"235"},{"range":"237","text":"234"},{"range":"237","text":"235"},{"range":"238","text":"234"},{"range":"238","text":"235"},{"range":"239","text":"234"},{"range":"239","text":"235"},{"range":"240","text":"234"},{"range":"240","text":"235"},{"range":"241","text":"234"},{"range":"241","text":"235"},{"range":"242","text":"234"},{"range":"242","text":"235"},{"range":"243","text":"234"},{"range":"243","text":"235"},{"range":"244","text":"234"},{"range":"244","text":"235"},{"range":"245","text":"234"},{"range":"245","text":"235"},{"range":"246","text":"234"},{"range":"246","text":"235"},[11682,11685],"unknown","never",[567,570],[2790,2793],[5796,5799],[5897,5900],[5997,6000],[6286,6289],[7350,7353],[1283,1286],[158,161],[276,279],[455,458]]
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
# Change Log - @graphitation/apollo-react-relay-duct-tape
|
|
2
2
|
|
|
3
|
-
This log was last generated on Mon, 25 Mar 2024
|
|
3
|
+
This log was last generated on Mon, 25 Mar 2024 22:06:53 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.1.1
|
|
8
|
+
|
|
9
|
+
Mon, 25 Mar 2024 22:06:53 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Using custom fetch-policy while lazyloading queries. (94519378+pasubhas@users.noreply.github.com)
|
|
14
|
+
|
|
7
15
|
## 1.1.0
|
|
8
16
|
|
|
9
|
-
Mon, 25 Mar 2024 20:42:
|
|
17
|
+
Mon, 25 Mar 2024 20:42:32 GMT
|
|
10
18
|
|
|
11
19
|
### Minor changes
|
|
12
20
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WatchQueryFetchPolicy } from "@apollo/client";
|
|
1
2
|
import type { CompiledArtefactModule } from "@graphitation/apollo-react-relay-duct-tape-compiler";
|
|
2
3
|
/**
|
|
3
4
|
* @todo Rewrite this to mimic Relay's preload APIs
|
|
@@ -9,6 +10,7 @@ import type { CompiledArtefactModule } from "@graphitation/apollo-react-relay-du
|
|
|
9
10
|
*/
|
|
10
11
|
export declare function useCompiledLazyLoadQuery(documents: CompiledArtefactModule, options: {
|
|
11
12
|
variables: Record<string, unknown>;
|
|
13
|
+
fetchPolicy?: WatchQueryFetchPolicy;
|
|
12
14
|
}): {
|
|
13
15
|
data?: Record<string, any>;
|
|
14
16
|
error?: Error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCompiledLazyLoadQuery.d.ts","sourceRoot":"","sources":["../../../src/storeObservation/compiledHooks/useCompiledLazyLoadQuery.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCompiledLazyLoadQuery.d.ts","sourceRoot":"","sources":["../../../src/storeObservation/compiledHooks/useCompiledLazyLoadQuery.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAGV,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAmElG;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,sBAAsB,EACjC,OAAO,EAAE;IACP,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACrC,GAEA;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CA+B/C"}
|
|
@@ -70,7 +70,7 @@ class ExecutionQueryHandler {
|
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
function useExecutionQuery(client, executionQueryDocument, variables) {
|
|
73
|
+
function useExecutionQuery(client, executionQueryDocument, variables, fetchPolicy) {
|
|
74
74
|
const forceUpdate = (0, import_useForceUpdate.useForceUpdate)();
|
|
75
75
|
const execution = (0, import_react.useRef)(new ExecutionQueryHandler(() => forceUpdate()));
|
|
76
76
|
(0, import_react.useEffect)(() => {
|
|
@@ -78,14 +78,15 @@ function useExecutionQuery(client, executionQueryDocument, variables) {
|
|
|
78
78
|
execution.current.subscribe(
|
|
79
79
|
client.watchQuery({
|
|
80
80
|
query: executionQueryDocument,
|
|
81
|
-
variables
|
|
81
|
+
variables,
|
|
82
|
+
fetchPolicy
|
|
82
83
|
})
|
|
83
84
|
);
|
|
84
85
|
}
|
|
85
86
|
return () => {
|
|
86
87
|
execution.current.reset();
|
|
87
88
|
};
|
|
88
|
-
}, [executionQueryDocument, variables]);
|
|
89
|
+
}, [executionQueryDocument, variables, fetchPolicy]);
|
|
89
90
|
return execution.current.status;
|
|
90
91
|
}
|
|
91
92
|
function useCompiledLazyLoadQuery(documents, options) {
|
|
@@ -104,7 +105,8 @@ function useCompiledLazyLoadQuery(documents, options) {
|
|
|
104
105
|
const [loading, error] = useExecutionQuery(
|
|
105
106
|
client,
|
|
106
107
|
executionQueryDocument,
|
|
107
|
-
variables
|
|
108
|
+
variables,
|
|
109
|
+
options.fetchPolicy
|
|
108
110
|
);
|
|
109
111
|
const { data } = (0, import_client.useQuery)(watchQueryDocument, {
|
|
110
112
|
client,
|
|
@@ -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 { useQuery as useApolloQuery } from \"@apollo/client\";\nimport invariant from \"invariant\";\nimport { useDeepCompareMemoize } from \"./useDeepCompareMemoize\";\nimport { useForceUpdate } from \"./useForceUpdate\";\nimport { useOverridenOrDefaultApolloClient } from \"../../useOverridenOrDefaultApolloClient\";\n\nimport type {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkC;AAClC,oBAA2C;AAC3C,uBAAsB;AACtB,mCAAsC;AACtC,4BAA+B;AAC/B,+CAAkD;
|
|
4
|
+
"sourcesContent": ["import { useRef, useEffect } from \"react\";\nimport { useQuery as useApolloQuery } from \"@apollo/client\";\nimport invariant from \"invariant\";\nimport { useDeepCompareMemoize } from \"./useDeepCompareMemoize\";\nimport { useForceUpdate } from \"./useForceUpdate\";\nimport { useOverridenOrDefaultApolloClient } from \"../../useOverridenOrDefaultApolloClient\";\n\nimport type {\n ObservableQuery,\n ApolloClient,\n WatchQueryFetchPolicy,\n} from \"@apollo/client\";\nimport type { DocumentNode } from \"graphql\";\nimport type { CompiledArtefactModule } from \"@graphitation/apollo-react-relay-duct-tape-compiler\";\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 client: ApolloClient<unknown>,\n executionQueryDocument: DocumentNode,\n variables: Record<string, unknown>,\n fetchPolicy: WatchQueryFetchPolicy | undefined,\n): [loading: boolean, error?: Error] {\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 fetchPolicy,\n }),\n );\n }\n return () => {\n execution.current.reset();\n };\n }, [executionQueryDocument, variables, fetchPolicy]);\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: {\n variables: Record<string, unknown>;\n fetchPolicy?: WatchQueryFetchPolicy;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): { data?: Record<string, 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 client = useOverridenOrDefaultApolloClient();\n const variables = useDeepCompareMemoize(options.variables);\n // First fetch all data needed for the entire tree...\n const [loading, error] = useExecutionQuery(\n client,\n executionQueryDocument,\n variables,\n options.fetchPolicy,\n );\n // ...then fetch/watch data for only the calling component...\n const { data } = useApolloQuery(watchQueryDocument, {\n client,\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;AAAA,mBAAkC;AAClC,oBAA2C;AAC3C,uBAAsB;AACtB,mCAAsC;AACtC,4BAA+B;AAC/B,+CAAkD;AAUlD,MAAM,sBAAsB;AAAA,EAI1B,YAAoB,YAAwB;AAAxB;AAClB,SAAK,SAAS,CAAC,MAAM,MAAS;AAAA,EAChC;AAAA,EAEO,SAAS;AACd,WAAO,KAAK,OAAO,CAAC,KAAK,KAAK,sBAAsB;AAAA,EACtD;AAAA,EAEO,UAAU;AA3BnB;AA4BI,eAAK,sBAAL,mBAAwB;AACxB,SAAK,oBAAoB;AAAA,EAC3B;AAAA,EAEO,QAAQ;AACb,SAAK,QAAQ;AACb,SAAK,SAAS,CAAC,MAAM,MAAS;AAAA,EAChC;AAAA,EAEQ,aAAa,OAAe;AAClC,SAAK,SAAS,CAAC,OAAO,KAAK;AAC3B,SAAK,QAAQ;AACb,SAAK,WAAW;AAAA,EAClB;AAAA,EAEO,UAAU,YAA6B;AAC5C,SAAK,oBAAoB,WAAW;AAAA,MAClC,CAAC,EAAE,OAAO,IAAI,MAAM;AAClB,aAAK,aAAa,GAAG;AAAA,MACvB;AAAA,MACA,CAAC,QAAQ;AACP,aAAK,aAAa,GAAG;AAAA,MACvB;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,kBACP,QACA,wBACA,WACA,aACmC;AACnC,QAAM,kBAAc,sCAAe;AACnC,QAAM,gBAAY,qBAAO,IAAI,sBAAsB,MAAM,YAAY,CAAC,CAAC;AACvE,8BAAU,MAAM;AACd,QAAI,UAAU,QAAQ,OAAO,GAAG;AAC9B,gBAAU,QAAQ;AAAA,QAChB,OAAO,WAAW;AAAA,UAChB,OAAO;AAAA,UACP;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AACA,WAAO,MAAM;AACX,gBAAU,QAAQ,MAAM;AAAA,IAC1B;AAAA,EACF,GAAG,CAAC,wBAAwB,WAAW,WAAW,CAAC;AACnD,SAAO,UAAU,QAAQ;AAC3B;AAUO,SAAS,yBACd,WACA,SAK+C;AAC/C,QAAM,EAAE,mBAAmB,IAAI;AAC/B,uBAAAA;AAAA,IACE;AAAA,IACA;AAAA,EAEF;AACA,QAAM,EAAE,uBAAuB,IAAI;AACnC,uBAAAA;AAAA,IACE;AAAA,IACA;AAAA,EAEF;AACA,QAAM,aAAS,4EAAkC;AACjD,QAAM,gBAAY,oDAAsB,QAAQ,SAAS;AAEzD,QAAM,CAAC,SAAS,KAAK,IAAI;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACV;AAEA,QAAM,EAAE,KAAK,QAAI,cAAAC,UAAe,oBAAoB;AAAA,IAClD;AAAA,IACA;AAAA,IACA,aAAa;AAAA;AAAA,IAEb,MAAM,WAAW,CAAC,CAAC;AAAA,EACrB,CAAC;AACD,SAAO,EAAE,MAAM,MAAM;AACvB;",
|
|
6
6
|
"names": ["invariant", "useApolloQuery"]
|
|
7
7
|
}
|
|
@@ -38,7 +38,7 @@ var ExecutionQueryHandler = class {
|
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
function useExecutionQuery(client, executionQueryDocument, variables) {
|
|
41
|
+
function useExecutionQuery(client, executionQueryDocument, variables, fetchPolicy) {
|
|
42
42
|
const forceUpdate = useForceUpdate();
|
|
43
43
|
const execution = useRef(new ExecutionQueryHandler(() => forceUpdate()));
|
|
44
44
|
useEffect(() => {
|
|
@@ -46,14 +46,15 @@ function useExecutionQuery(client, executionQueryDocument, variables) {
|
|
|
46
46
|
execution.current.subscribe(
|
|
47
47
|
client.watchQuery({
|
|
48
48
|
query: executionQueryDocument,
|
|
49
|
-
variables
|
|
49
|
+
variables,
|
|
50
|
+
fetchPolicy
|
|
50
51
|
})
|
|
51
52
|
);
|
|
52
53
|
}
|
|
53
54
|
return () => {
|
|
54
55
|
execution.current.reset();
|
|
55
56
|
};
|
|
56
|
-
}, [executionQueryDocument, variables]);
|
|
57
|
+
}, [executionQueryDocument, variables, fetchPolicy]);
|
|
57
58
|
return execution.current.status;
|
|
58
59
|
}
|
|
59
60
|
function useCompiledLazyLoadQuery(documents, options) {
|
|
@@ -72,7 +73,8 @@ function useCompiledLazyLoadQuery(documents, options) {
|
|
|
72
73
|
const [loading, error] = useExecutionQuery(
|
|
73
74
|
client,
|
|
74
75
|
executionQueryDocument,
|
|
75
|
-
variables
|
|
76
|
+
variables,
|
|
77
|
+
options.fetchPolicy
|
|
76
78
|
);
|
|
77
79
|
const { data } = useApolloQuery(watchQueryDocument, {
|
|
78
80
|
client,
|
|
@@ -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 { useQuery as useApolloQuery } from \"@apollo/client\";\nimport invariant from \"invariant\";\nimport { useDeepCompareMemoize } from \"./useDeepCompareMemoize\";\nimport { useForceUpdate } from \"./useForceUpdate\";\nimport { useOverridenOrDefaultApolloClient } from \"../../useOverridenOrDefaultApolloClient\";\n\nimport type {
|
|
5
|
-
"mappings": ";AAAA,SAAS,QAAQ,iBAAiB;AAClC,SAAS,YAAY,sBAAsB;AAC3C,OAAO,eAAe;AACtB,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,yCAAyC;
|
|
4
|
+
"sourcesContent": ["import { useRef, useEffect } from \"react\";\nimport { useQuery as useApolloQuery } from \"@apollo/client\";\nimport invariant from \"invariant\";\nimport { useDeepCompareMemoize } from \"./useDeepCompareMemoize\";\nimport { useForceUpdate } from \"./useForceUpdate\";\nimport { useOverridenOrDefaultApolloClient } from \"../../useOverridenOrDefaultApolloClient\";\n\nimport type {\n ObservableQuery,\n ApolloClient,\n WatchQueryFetchPolicy,\n} from \"@apollo/client\";\nimport type { DocumentNode } from \"graphql\";\nimport type { CompiledArtefactModule } from \"@graphitation/apollo-react-relay-duct-tape-compiler\";\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 client: ApolloClient<unknown>,\n executionQueryDocument: DocumentNode,\n variables: Record<string, unknown>,\n fetchPolicy: WatchQueryFetchPolicy | undefined,\n): [loading: boolean, error?: Error] {\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 fetchPolicy,\n }),\n );\n }\n return () => {\n execution.current.reset();\n };\n }, [executionQueryDocument, variables, fetchPolicy]);\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: {\n variables: Record<string, unknown>;\n fetchPolicy?: WatchQueryFetchPolicy;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): { data?: Record<string, 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 client = useOverridenOrDefaultApolloClient();\n const variables = useDeepCompareMemoize(options.variables);\n // First fetch all data needed for the entire tree...\n const [loading, error] = useExecutionQuery(\n client,\n executionQueryDocument,\n variables,\n options.fetchPolicy,\n );\n // ...then fetch/watch data for only the calling component...\n const { data } = useApolloQuery(watchQueryDocument, {\n client,\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,SAAS,QAAQ,iBAAiB;AAClC,SAAS,YAAY,sBAAsB;AAC3C,OAAO,eAAe;AACtB,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,yCAAyC;AAUlD,IAAM,wBAAN,MAA4B;AAAA,EAI1B,YAAoB,YAAwB;AAAxB;AAClB,SAAK,SAAS,CAAC,MAAM,MAAS;AAAA,EAChC;AAAA,EAEO,SAAS;AACd,WAAO,KAAK,OAAO,CAAC,KAAK,KAAK,sBAAsB;AAAA,EACtD;AAAA,EAEO,UAAU;AA3BnB;AA4BI,eAAK,sBAAL,mBAAwB;AACxB,SAAK,oBAAoB;AAAA,EAC3B;AAAA,EAEO,QAAQ;AACb,SAAK,QAAQ;AACb,SAAK,SAAS,CAAC,MAAM,MAAS;AAAA,EAChC;AAAA,EAEQ,aAAa,OAAe;AAClC,SAAK,SAAS,CAAC,OAAO,KAAK;AAC3B,SAAK,QAAQ;AACb,SAAK,WAAW;AAAA,EAClB;AAAA,EAEO,UAAU,YAA6B;AAC5C,SAAK,oBAAoB,WAAW;AAAA,MAClC,CAAC,EAAE,OAAO,IAAI,MAAM;AAClB,aAAK,aAAa,GAAG;AAAA,MACvB;AAAA,MACA,CAAC,QAAQ;AACP,aAAK,aAAa,GAAG;AAAA,MACvB;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,kBACP,QACA,wBACA,WACA,aACmC;AACnC,QAAM,cAAc,eAAe;AACnC,QAAM,YAAY,OAAO,IAAI,sBAAsB,MAAM,YAAY,CAAC,CAAC;AACvE,YAAU,MAAM;AACd,QAAI,UAAU,QAAQ,OAAO,GAAG;AAC9B,gBAAU,QAAQ;AAAA,QAChB,OAAO,WAAW;AAAA,UAChB,OAAO;AAAA,UACP;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AACA,WAAO,MAAM;AACX,gBAAU,QAAQ,MAAM;AAAA,IAC1B;AAAA,EACF,GAAG,CAAC,wBAAwB,WAAW,WAAW,CAAC;AACnD,SAAO,UAAU,QAAQ;AAC3B;AAUO,SAAS,yBACd,WACA,SAK+C;AAC/C,QAAM,EAAE,mBAAmB,IAAI;AAC/B;AAAA,IACE;AAAA,IACA;AAAA,EAEF;AACA,QAAM,EAAE,uBAAuB,IAAI;AACnC;AAAA,IACE;AAAA,IACA;AAAA,EAEF;AACA,QAAM,SAAS,kCAAkC;AACjD,QAAM,YAAY,sBAAsB,QAAQ,SAAS;AAEzD,QAAM,CAAC,SAAS,KAAK,IAAI;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACV;AAEA,QAAM,EAAE,KAAK,IAAI,eAAe,oBAAoB;AAAA,IAClD;AAAA,IACA;AAAA,IACA,aAAa;AAAA;AAAA,IAEb,MAAM,WAAW,CAAC,CAAC;AAAA,EACrB,CAAC;AACD,SAAO,EAAE,MAAM,MAAM;AACvB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphitation/apollo-react-relay-duct-tape",
|
|
3
3
|
"description": "A compatibility wrapper that provides the react-relay API on top of Apollo Client.",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "1.1.
|
|
5
|
+
"version": "1.1.1",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/microsoft/graphitation.git",
|