@graphitation/apollo-react-relay-duct-tape 1.1.5 → 1.2.0
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/hooks.d.ts +1 -0
- package/lib/hooks.d.ts.map +1 -1
- package/lib/hooks.js +1 -0
- package/lib/hooks.js.map +2 -2
- package/lib/hooks.mjs +1 -0
- package/lib/hooks.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":1720027674181,"results":"26","hashOfConfig":"27"},{"size":1917,"mtime":1720027674181,"results":"28","hashOfConfig":"27"},{"size":690,"mtime":1720027674185,"results":"29","hashOfConfig":"27"},{"size":12265,"mtime":1720027674185,"results":"30","hashOfConfig":"27"},{"size":174,"mtime":1720027674185,"results":"31","hashOfConfig":"27"},{"size":41103,"mtime":1720027674185,"results":"32","hashOfConfig":"27"},{"size":1839,"mtime":1720027674185,"results":"33","hashOfConfig":"27"},{"size":1709,"mtime":1720027674185,"results":"34","hashOfConfig":"27"},{"size":3041,"mtime":1720027674185,"results":"35","hashOfConfig":"27"},{"size":445,"mtime":1720027674185,"results":"36","hashOfConfig":"27"},{"size":575,"mtime":1720027674185,"results":"37","hashOfConfig":"27"},{"size":3668,"mtime":1720027674185,"results":"38","hashOfConfig":"27"},{"size":3851,"mtime":1720027674185,"results":"39","hashOfConfig":"27"},{"size":10514,"mtime":1720027674185,"results":"40","hashOfConfig":"27"},{"size":5414,"mtime":1720027674185,"results":"41","hashOfConfig":"27"},{"size":843,"mtime":1720027674185,"results":"42","hashOfConfig":"27"},{"size":152,"mtime":1720027674185,"results":"43","hashOfConfig":"27"},{"size":286,"mtime":1720027674185,"results":"44","hashOfConfig":"27"},{"size":1243,"mtime":1720027674185,"results":"45","hashOfConfig":"27"},{"size":230,"mtime":1720027674185,"results":"46","hashOfConfig":"27"},{"size":2829,"mtime":1720027674185,"results":"47","hashOfConfig":"27"},{"size":2325,"mtime":1720027674185,"results":"48","hashOfConfig":"27"},{"size":1110,"mtime":1720027674185,"results":"49","hashOfConfig":"27"},{"size":2069,"mtime":1720027674185,"results":"50","hashOfConfig":"27"},{"size":1314,"mtime":1720027674185,"results":"51","hashOfConfig":"27"},{"filePath":"52","messages":"53","suppressedMessages":"54","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"3r1snp",{"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":174,"column":24,"nodeType":"141","messageId":"142","endLine":174,"endColumn":27,"suggestions":"149","suppressions":"150"},{"ruleId":"139","severity":1,"message":"140","line":177,"column":4,"nodeType":"141","messageId":"142","endLine":177,"endColumn":7,"suggestions":"151","suppressions":"152"},{"ruleId":"139","severity":1,"message":"140","line":179,"column":30,"nodeType":"141","messageId":"142","endLine":179,"endColumn":33,"suggestions":"153","suppressions":"154"},{"ruleId":"139","severity":1,"message":"140","line":189,"column":24,"nodeType":"141","messageId":"142","endLine":189,"endColumn":27,"suggestions":"155","suppressions":"156"},{"ruleId":"139","severity":1,"message":"140","line":225,"column":9,"nodeType":"141","messageId":"142","endLine":225,"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],[5868,5871],[5969,5972],[6069,6072],[6358,6361],[7422,7425],[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":11622,"mtime":1726671907218,"results":"26","hashOfConfig":"27"},{"size":1917,"mtime":1726671907222,"results":"28","hashOfConfig":"27"},{"size":690,"mtime":1726671907222,"results":"29","hashOfConfig":"27"},{"size":12373,"mtime":1726671907222,"results":"30","hashOfConfig":"27"},{"size":174,"mtime":1726671907222,"results":"31","hashOfConfig":"27"},{"size":41103,"mtime":1726671907222,"results":"32","hashOfConfig":"27"},{"size":1839,"mtime":1726671907222,"results":"33","hashOfConfig":"27"},{"size":1709,"mtime":1726671907222,"results":"34","hashOfConfig":"27"},{"size":3041,"mtime":1726671907222,"results":"35","hashOfConfig":"27"},{"size":445,"mtime":1726671907222,"results":"36","hashOfConfig":"27"},{"size":575,"mtime":1726671907222,"results":"37","hashOfConfig":"27"},{"size":3668,"mtime":1726671907222,"results":"38","hashOfConfig":"27"},{"size":3851,"mtime":1726671907222,"results":"39","hashOfConfig":"27"},{"size":10514,"mtime":1726671907222,"results":"40","hashOfConfig":"27"},{"size":5414,"mtime":1726671907222,"results":"41","hashOfConfig":"27"},{"size":843,"mtime":1726671907222,"results":"42","hashOfConfig":"27"},{"size":152,"mtime":1726671907222,"results":"43","hashOfConfig":"27"},{"size":286,"mtime":1726671907222,"results":"44","hashOfConfig":"27"},{"size":1243,"mtime":1726671907222,"results":"45","hashOfConfig":"27"},{"size":230,"mtime":1726671907222,"results":"46","hashOfConfig":"27"},{"size":2829,"mtime":1726671907222,"results":"47","hashOfConfig":"27"},{"size":2325,"mtime":1726671907222,"results":"48","hashOfConfig":"27"},{"size":1110,"mtime":1726671907222,"results":"49","hashOfConfig":"27"},{"size":2069,"mtime":1726671907222,"results":"50","hashOfConfig":"27"},{"size":1314,"mtime":1726671907222,"results":"51","hashOfConfig":"27"},{"filePath":"52","messages":"53","suppressedMessages":"54","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"b8g6oi",{"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":320,"column":38,"nodeType":"141","messageId":"142","endLine":320,"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":174,"column":24,"nodeType":"141","messageId":"142","endLine":174,"endColumn":27,"suggestions":"149","suppressions":"150"},{"ruleId":"139","severity":1,"message":"140","line":177,"column":4,"nodeType":"141","messageId":"142","endLine":177,"endColumn":7,"suggestions":"151","suppressions":"152"},{"ruleId":"139","severity":1,"message":"140","line":179,"column":30,"nodeType":"141","messageId":"142","endLine":179,"endColumn":33,"suggestions":"153","suppressions":"154"},{"ruleId":"139","severity":1,"message":"140","line":189,"column":24,"nodeType":"141","messageId":"142","endLine":189,"endColumn":27,"suggestions":"155","suppressions":"156"},{"ruleId":"139","severity":1,"message":"140","line":225,"column":9,"nodeType":"141","messageId":"142","endLine":225,"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"},[11748,11751],"unknown","never",[567,570],[2790,2793],[5868,5871],[5969,5972],[6069,6072],[6358,6361],[7422,7425],[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 Wed,
|
|
3
|
+
This log was last generated on Wed, 18 Sep 2024 15:11:09 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.2.0
|
|
8
|
+
|
|
9
|
+
Wed, 18 Sep 2024 15:11:09 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- add onCompleted callback to useMutation (Stanislaw.Wilczynski@microsoft.com)
|
|
14
|
+
|
|
7
15
|
## 1.1.5
|
|
8
16
|
|
|
9
|
-
Wed, 03 Jul 2024 17:33:
|
|
17
|
+
Wed, 03 Jul 2024 17:33:49 GMT
|
|
10
18
|
|
|
11
19
|
### Patches
|
|
12
20
|
|
package/lib/hooks.d.ts
CHANGED
|
@@ -99,6 +99,7 @@ export declare function useSubscription<TSubscriptionPayload extends OperationTy
|
|
|
99
99
|
interface IMutationCommitterOptions<TMutationPayload extends OperationType> {
|
|
100
100
|
variables: TMutationPayload["variables"];
|
|
101
101
|
optimisticResponse?: Partial<TMutationPayload["response"]> | null;
|
|
102
|
+
onCompleted?: (response: TMutationPayload["response"]) => void;
|
|
102
103
|
/**
|
|
103
104
|
* This version yields the ApolloCache instance, instead of the RelayStore,
|
|
104
105
|
* and usage of it will not be portable to Relay directly. However, it is a
|
package/lib/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAExB,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;AAM1C;;;;;;;;;;;;;;;GAeG;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,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,CAAA;CAAE,GACnE;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;CAAE,CA2B9C;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,IAAI,SAAS,OAAO,EAC9C,aAAa,EAAE,iBAAiB,EAChC,WAAW,EAAE,IAAI,GAChB,WAAW,CAAC,IAAI,CAAC,CAAC;AACrB,wBAAgB,WAAW,CACzB,aAAa,EAAE,iBAAiB,EAChC,WAAW,EAAE,SAAS,GACrB,SAAS,CAAC;AACb,wBAAgB,WAAW,CAAC,IAAI,SAAS,OAAO,EAC9C,aAAa,EAAE,iBAAiB,EAChC,WAAW,EAAE,IAAI,GAAG,SAAS,GAC5B,WAAW,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;AAkBjC;;;;;;;;;GASG;AACH,w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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,CAqC/C"}
|
package/lib/hooks.js
CHANGED
|
@@ -210,6 +210,7 @@ function useMutation(mutation) {
|
|
|
210
210
|
variables: options.variables || {},
|
|
211
211
|
context: options.context,
|
|
212
212
|
optimisticResponse: options.optimisticResponse,
|
|
213
|
+
onCompleted: options.onCompleted,
|
|
213
214
|
update: options.updater
|
|
214
215
|
});
|
|
215
216
|
if (apolloResult.errors) {
|
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 invariant from \"invariant\";\nimport {\n useSubscription as useApolloSubscription,\n useQuery as useApolloQuery,\n useMutation as useApolloMutation,\n SubscriptionHookOptions as ApolloSubscriptionHookOptions,\n ErrorPolicy as ApolloErrorPolicy,\n ApolloClient,\n ApolloCache,\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\";\nimport type { CompiledArtefactModule } from \"@graphitation/apollo-react-relay-duct-tape-compiler\";\nimport { FragmentReference } from \"./storeObservation/compiledHooks/types\";\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 * @param options.context The query context to pass along the apollo link chain. Should be avoided when possible as\n * it will not be compatible with Relay APIs.\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; context?: TQuery[\"context\"] },\n): { error?: Error; data?: TQuery[\"response\"] } {\n invariant(\n query?.__brand === undefined,\n \"useLazyLoadQuery: Document must be a valid runtime type.\",\n );\n const apolloOptions = options && {\n ...options,\n fetchPolicy: convertFetchPolicy(options.fetchPolicy),\n };\n if (query.watchQueryDocument) {\n return useCompiledLazyLoadQuery(query as CompiledArtefactModule, {\n variables,\n ...apolloOptions,\n });\n } else {\n const client = useOverridenOrDefaultApolloClient();\n return useApolloQuery(\n // Compiled documents without narrow observables should be treated like\n // normal queries.\n query.executionQueryDocument || query,\n {\n client,\n variables,\n ...apolloOptions,\n },\n );\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 migration purposes, this hook supports the notion that the fragment reference can be undefined. This is\n * to support cases where useFragment is used in a tree that is conditionally using fragments.\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>;\nexport function useFragment(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: undefined,\n): undefined;\nexport function useFragment<TKey extends KeyType>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey | undefined,\n): KeyTypeData<TKey> | undefined;\nexport function useFragment<TKey extends KeyType>(\n fragmentInput: GraphQLTaggedNode | undefined,\n fragmentRef: TKey,\n): KeyTypeData<TKey> {\n invariant(\n fragmentInput?.__brand === undefined,\n \"useFragment: fragmentInput must be a valid runtime type.\",\n );\n // If fragmentInput is undefined, it means the fragment is not compiled and we should just return the fragmentRef.\n // This is an implementation detail that should never surface to the user.\n if (fragmentInput && fragmentInput.watchQueryDocument) {\n return useCompiledFragment(fragmentInput, fragmentRef as FragmentReference);\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,\n \"useRefetchableFragment: Missing metadata; did you forget to use the @refetchable directive?\",\n );\n invariant(\n fragmentInput.__brand === undefined,\n \"useRefetchableFragment: fragmentInput must be a valid runtime type.\",\n );\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"useRefetchableFragment is only supported at this time when using compilation\",\n );\n return useCompiledRefetchableFragment(\n fragmentInput as CompiledArtefactModule,\n fragmentRef as FragmentReference,\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,\n \"usePaginationFragment: Missing metadata; did you forget to use the @refetchable directive?\",\n );\n invariant(\n fragmentInput.__brand === undefined,\n \"usePaginationFragment: fragmentInput must be a valid runtime type.\",\n );\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"usePaginationFragment is only supported at this time when using compilation\",\n );\n return useCompiledPaginationFragment(\n fragmentInput as CompiledArtefactModule,\n fragmentRef as FragmentReference,\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 be avoided when possible as it will not be compatible with Relay APIs.\n */\n context?: TSubscriptionPayload[\"context\"];\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 document = config.subscription;\n invariant(\n document?.__brand === undefined,\n \"useSubscription: Document must be a valid runtime type.\",\n );\n invariant(\n !document.watchQueryDocument,\n \"useSubscription: Did not expect a watch query document\",\n );\n const client = useOverridenOrDefaultApolloClient();\n const { error } = useApolloSubscription(\n document.executionQueryDocument || document,\n {\n client,\n variables: config.variables,\n context: config.context,\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 errorPolicy: \"ignore\",\n } as ApolloSubscriptionHookOptions & {\n errorPolicy: ApolloErrorPolicy;\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 * This version yields the ApolloCache instance, instead of the RelayStore,\n * and usage of it will not be portable to Relay directly. However, it is a\n * necessary evil for migration purposes.\n */\n updater?: (\n cache: ApolloCache<unknown>,\n data: TMutationPayload[\"response\"],\n ) => void;\n /**\n * @deprecated Should be avoided when possible as it will not be compatible with Relay APIs.\n */\n context?: TMutationPayload[\"context\"];\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 invariant(\n mutation?.__brand === undefined,\n \"useMutation: Document must be a valid runtime type.\",\n );\n invariant(\n !mutation.watchQueryDocument,\n \"useMutation: Did not expect a watch query document\",\n );\n const client = useOverridenOrDefaultApolloClient();\n const [apolloUpdater, { loading: mutationLoading }] = useApolloMutation(\n mutation.executionQueryDocument || mutation,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n { client: client as ApolloClient<any> },\n );\n\n return [\n async (options: IMutationCommitterOptions<TMutationPayload>) => {\n const apolloResult = await apolloUpdater({\n variables: options.variables || {},\n context: options.context,\n optimisticResponse: options.optimisticResponse,\n update: options.updater,\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;AAAA;AAAA,uBAAsB;AACtB,oBAQO;AASP,2BAOO;AACP,gCAAmC;AACnC,+CAAkD;AAoB3C,SAAS,iBACd,OACA,WACA,SAC8C;AAC9C,uBAAAA;AAAA,KACE,+BAAO,aAAY;AAAA,IACnB;AAAA,EACF;AACA,QAAM,gBAAgB,WAAW,iCAC5B,UAD4B;AAAA,IAE/B,iBAAa,8CAAmB,QAAQ,WAAW;AAAA,EACrD;AACA,MAAI,MAAM,oBAAoB;AAC5B,eAAO,+CAAyB,OAAiC;AAAA,MAC/D;AAAA,OACG,cACJ;AAAA,EACH,OAAO;AACL,UAAM,aAAS,4EAAkC;AACjD,eAAO,cAAAC;AAAA;AAAA;AAAA,MAGL,MAAM,0BAA0B;AAAA,MAChC;AAAA,QACE;AAAA,QACA;AAAA,SACG;AAAA,IAEP;AAAA,EACF;AACF;AAiCO,SAAS,YACd,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a;AAAA,IACf;AAAA,EAGF;AACA,MAAI,OAAO;AACT,QAAI,OAAO,SAAS;AAClB,aAAO,QAAQ,KAAK;AAAA,IACtB,OAAO;AACL,cAAQ;AAAA,QACN,qDAAqD,MAAM;AAAA,MAC7D;AAAA,IACF;AAAA,EACF;AACF;
|
|
4
|
+
"sourcesContent": ["import invariant from \"invariant\";\nimport {\n useSubscription as useApolloSubscription,\n useQuery as useApolloQuery,\n useMutation as useApolloMutation,\n SubscriptionHookOptions as ApolloSubscriptionHookOptions,\n ErrorPolicy as ApolloErrorPolicy,\n ApolloClient,\n ApolloCache,\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\";\nimport type { CompiledArtefactModule } from \"@graphitation/apollo-react-relay-duct-tape-compiler\";\nimport { FragmentReference } from \"./storeObservation/compiledHooks/types\";\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 * @param options.context The query context to pass along the apollo link chain. Should be avoided when possible as\n * it will not be compatible with Relay APIs.\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; context?: TQuery[\"context\"] },\n): { error?: Error; data?: TQuery[\"response\"] } {\n invariant(\n query?.__brand === undefined,\n \"useLazyLoadQuery: Document must be a valid runtime type.\",\n );\n const apolloOptions = options && {\n ...options,\n fetchPolicy: convertFetchPolicy(options.fetchPolicy),\n };\n if (query.watchQueryDocument) {\n return useCompiledLazyLoadQuery(query as CompiledArtefactModule, {\n variables,\n ...apolloOptions,\n });\n } else {\n const client = useOverridenOrDefaultApolloClient();\n return useApolloQuery(\n // Compiled documents without narrow observables should be treated like\n // normal queries.\n query.executionQueryDocument || query,\n {\n client,\n variables,\n ...apolloOptions,\n },\n );\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 migration purposes, this hook supports the notion that the fragment reference can be undefined. This is\n * to support cases where useFragment is used in a tree that is conditionally using fragments.\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>;\nexport function useFragment(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: undefined,\n): undefined;\nexport function useFragment<TKey extends KeyType>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey | undefined,\n): KeyTypeData<TKey> | undefined;\nexport function useFragment<TKey extends KeyType>(\n fragmentInput: GraphQLTaggedNode | undefined,\n fragmentRef: TKey,\n): KeyTypeData<TKey> {\n invariant(\n fragmentInput?.__brand === undefined,\n \"useFragment: fragmentInput must be a valid runtime type.\",\n );\n // If fragmentInput is undefined, it means the fragment is not compiled and we should just return the fragmentRef.\n // This is an implementation detail that should never surface to the user.\n if (fragmentInput && fragmentInput.watchQueryDocument) {\n return useCompiledFragment(fragmentInput, fragmentRef as FragmentReference);\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,\n \"useRefetchableFragment: Missing metadata; did you forget to use the @refetchable directive?\",\n );\n invariant(\n fragmentInput.__brand === undefined,\n \"useRefetchableFragment: fragmentInput must be a valid runtime type.\",\n );\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"useRefetchableFragment is only supported at this time when using compilation\",\n );\n return useCompiledRefetchableFragment(\n fragmentInput as CompiledArtefactModule,\n fragmentRef as FragmentReference,\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,\n \"usePaginationFragment: Missing metadata; did you forget to use the @refetchable directive?\",\n );\n invariant(\n fragmentInput.__brand === undefined,\n \"usePaginationFragment: fragmentInput must be a valid runtime type.\",\n );\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"usePaginationFragment is only supported at this time when using compilation\",\n );\n return useCompiledPaginationFragment(\n fragmentInput as CompiledArtefactModule,\n fragmentRef as FragmentReference,\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 be avoided when possible as it will not be compatible with Relay APIs.\n */\n context?: TSubscriptionPayload[\"context\"];\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 document = config.subscription;\n invariant(\n document?.__brand === undefined,\n \"useSubscription: Document must be a valid runtime type.\",\n );\n invariant(\n !document.watchQueryDocument,\n \"useSubscription: Did not expect a watch query document\",\n );\n const client = useOverridenOrDefaultApolloClient();\n const { error } = useApolloSubscription(\n document.executionQueryDocument || document,\n {\n client,\n variables: config.variables,\n context: config.context,\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 errorPolicy: \"ignore\",\n } as ApolloSubscriptionHookOptions & {\n errorPolicy: ApolloErrorPolicy;\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 onCompleted?: (response: TMutationPayload[\"response\"]) => void;\n /**\n * This version yields the ApolloCache instance, instead of the RelayStore,\n * and usage of it will not be portable to Relay directly. However, it is a\n * necessary evil for migration purposes.\n */\n updater?: (\n cache: ApolloCache<unknown>,\n data: TMutationPayload[\"response\"],\n ) => void;\n /**\n * @deprecated Should be avoided when possible as it will not be compatible with Relay APIs.\n */\n context?: TMutationPayload[\"context\"];\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 invariant(\n mutation?.__brand === undefined,\n \"useMutation: Document must be a valid runtime type.\",\n );\n invariant(\n !mutation.watchQueryDocument,\n \"useMutation: Did not expect a watch query document\",\n );\n const client = useOverridenOrDefaultApolloClient();\n const [apolloUpdater, { loading: mutationLoading }] = useApolloMutation(\n mutation.executionQueryDocument || mutation,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n { client: client as ApolloClient<any> },\n );\n\n return [\n async (options: IMutationCommitterOptions<TMutationPayload>) => {\n const apolloResult = await apolloUpdater({\n variables: options.variables || {},\n context: options.context,\n optimisticResponse: options.optimisticResponse,\n onCompleted: options.onCompleted,\n update: options.updater,\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;AAAA;AAAA,uBAAsB;AACtB,oBAQO;AASP,2BAOO;AACP,gCAAmC;AACnC,+CAAkD;AAoB3C,SAAS,iBACd,OACA,WACA,SAC8C;AAC9C,uBAAAA;AAAA,KACE,+BAAO,aAAY;AAAA,IACnB;AAAA,EACF;AACA,QAAM,gBAAgB,WAAW,iCAC5B,UAD4B;AAAA,IAE/B,iBAAa,8CAAmB,QAAQ,WAAW;AAAA,EACrD;AACA,MAAI,MAAM,oBAAoB;AAC5B,eAAO,+CAAyB,OAAiC;AAAA,MAC/D;AAAA,OACG,cACJ;AAAA,EACH,OAAO;AACL,UAAM,aAAS,4EAAkC;AACjD,eAAO,cAAAC;AAAA;AAAA;AAAA,MAGL,MAAM,0BAA0B;AAAA,MAChC;AAAA,QACE;AAAA,QACA;AAAA,SACG;AAAA,IAEP;AAAA,EACF;AACF;AAiCO,SAAS,YACd,eACA,aACmB;AACnB,uBAAAD;AAAA,KACE,+CAAe,aAAY;AAAA,IAC3B;AAAA,EACF;AAGA,MAAI,iBAAiB,cAAc,oBAAoB;AACrD,eAAO,0CAAoB,eAAe,WAAgC;AAAA,EAC5E,OAAO;AACL,WAAO;AAAA,EACT;AACF;AAYO,SAAS,uBAId,eACA,aACoE;AACpE,uBAAAA;AAAA,IACE;AAAA,IACA;AAAA,EACF;AACA,uBAAAA;AAAA,IACE,cAAc,YAAY;AAAA,IAC1B;AAAA,EACF;AACA,uBAAAA;AAAA,IACE,CAAC,CAAC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jD,QAAM,CAAC,eAAe,EAAE,SAAS,gBAAgB,CAAC,QAAI,cAAAG;AAAA,IACpD,SAAS,0BAA0B;AAAA;AAAA,IAEnC,EAAE,OAAoC;AAAA,EACxC;AAEA,SAAO;AAAA,IACL,CAAO,YAAyD;AAC9D,YAAM,eAAe,MAAM,cAAc;AAAA,QACvC,WAAW,QAAQ,aAAa,CAAC;AAAA,QACjC,SAAS,QAAQ;AAAA,QACjB,oBAAoB,QAAQ;AAAA,QAC5B,aAAa,QAAQ;AAAA,QACrB,QAAQ,QAAQ;AAAA,MAClB,CAAC;AACD,UAAI,aAAa,QAAQ;AACvB,eAAO;AAAA,UACL,QAAQ,MAAM,KAAK,OAAO,OAAO,aAAa,MAAM,CAAC;AAAA,UACrD,MAAM,aAAa;AAAA,QACrB;AAAA,MACF;AACA,aAAO;AAAA,QACL,MAAM,aAAa;AAAA,MACrB;AAAA,IACF;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["invariant", "useApolloQuery", "useApolloSubscription", "useApolloMutation"]
|
|
7
7
|
}
|
package/lib/hooks.mjs
CHANGED
|
@@ -185,6 +185,7 @@ function useMutation(mutation) {
|
|
|
185
185
|
variables: options.variables || {},
|
|
186
186
|
context: options.context,
|
|
187
187
|
optimisticResponse: options.optimisticResponse,
|
|
188
|
+
onCompleted: options.onCompleted,
|
|
188
189
|
update: options.updater
|
|
189
190
|
});
|
|
190
191
|
if (apolloResult.errors) {
|
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 invariant from \"invariant\";\nimport {\n useSubscription as useApolloSubscription,\n useQuery as useApolloQuery,\n useMutation as useApolloMutation,\n SubscriptionHookOptions as ApolloSubscriptionHookOptions,\n ErrorPolicy as ApolloErrorPolicy,\n ApolloClient,\n ApolloCache,\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\";\nimport type { CompiledArtefactModule } from \"@graphitation/apollo-react-relay-duct-tape-compiler\";\nimport { FragmentReference } from \"./storeObservation/compiledHooks/types\";\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 * @param options.context The query context to pass along the apollo link chain. Should be avoided when possible as\n * it will not be compatible with Relay APIs.\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; context?: TQuery[\"context\"] },\n): { error?: Error; data?: TQuery[\"response\"] } {\n invariant(\n query?.__brand === undefined,\n \"useLazyLoadQuery: Document must be a valid runtime type.\",\n );\n const apolloOptions = options && {\n ...options,\n fetchPolicy: convertFetchPolicy(options.fetchPolicy),\n };\n if (query.watchQueryDocument) {\n return useCompiledLazyLoadQuery(query as CompiledArtefactModule, {\n variables,\n ...apolloOptions,\n });\n } else {\n const client = useOverridenOrDefaultApolloClient();\n return useApolloQuery(\n // Compiled documents without narrow observables should be treated like\n // normal queries.\n query.executionQueryDocument || query,\n {\n client,\n variables,\n ...apolloOptions,\n },\n );\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 migration purposes, this hook supports the notion that the fragment reference can be undefined. This is\n * to support cases where useFragment is used in a tree that is conditionally using fragments.\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>;\nexport function useFragment(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: undefined,\n): undefined;\nexport function useFragment<TKey extends KeyType>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey | undefined,\n): KeyTypeData<TKey> | undefined;\nexport function useFragment<TKey extends KeyType>(\n fragmentInput: GraphQLTaggedNode | undefined,\n fragmentRef: TKey,\n): KeyTypeData<TKey> {\n invariant(\n fragmentInput?.__brand === undefined,\n \"useFragment: fragmentInput must be a valid runtime type.\",\n );\n // If fragmentInput is undefined, it means the fragment is not compiled and we should just return the fragmentRef.\n // This is an implementation detail that should never surface to the user.\n if (fragmentInput && fragmentInput.watchQueryDocument) {\n return useCompiledFragment(fragmentInput, fragmentRef as FragmentReference);\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,\n \"useRefetchableFragment: Missing metadata; did you forget to use the @refetchable directive?\",\n );\n invariant(\n fragmentInput.__brand === undefined,\n \"useRefetchableFragment: fragmentInput must be a valid runtime type.\",\n );\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"useRefetchableFragment is only supported at this time when using compilation\",\n );\n return useCompiledRefetchableFragment(\n fragmentInput as CompiledArtefactModule,\n fragmentRef as FragmentReference,\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,\n \"usePaginationFragment: Missing metadata; did you forget to use the @refetchable directive?\",\n );\n invariant(\n fragmentInput.__brand === undefined,\n \"usePaginationFragment: fragmentInput must be a valid runtime type.\",\n );\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"usePaginationFragment is only supported at this time when using compilation\",\n );\n return useCompiledPaginationFragment(\n fragmentInput as CompiledArtefactModule,\n fragmentRef as FragmentReference,\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 be avoided when possible as it will not be compatible with Relay APIs.\n */\n context?: TSubscriptionPayload[\"context\"];\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 document = config.subscription;\n invariant(\n document?.__brand === undefined,\n \"useSubscription: Document must be a valid runtime type.\",\n );\n invariant(\n !document.watchQueryDocument,\n \"useSubscription: Did not expect a watch query document\",\n );\n const client = useOverridenOrDefaultApolloClient();\n const { error } = useApolloSubscription(\n document.executionQueryDocument || document,\n {\n client,\n variables: config.variables,\n context: config.context,\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 errorPolicy: \"ignore\",\n } as ApolloSubscriptionHookOptions & {\n errorPolicy: ApolloErrorPolicy;\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 * This version yields the ApolloCache instance, instead of the RelayStore,\n * and usage of it will not be portable to Relay directly. However, it is a\n * necessary evil for migration purposes.\n */\n updater?: (\n cache: ApolloCache<unknown>,\n data: TMutationPayload[\"response\"],\n ) => void;\n /**\n * @deprecated Should be avoided when possible as it will not be compatible with Relay APIs.\n */\n context?: TMutationPayload[\"context\"];\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 invariant(\n mutation?.__brand === undefined,\n \"useMutation: Document must be a valid runtime type.\",\n );\n invariant(\n !mutation.watchQueryDocument,\n \"useMutation: Did not expect a watch query document\",\n );\n const client = useOverridenOrDefaultApolloClient();\n const [apolloUpdater, { loading: mutationLoading }] = useApolloMutation(\n mutation.executionQueryDocument || mutation,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n { client: client as ApolloClient<any> },\n );\n\n return [\n async (options: IMutationCommitterOptions<TMutationPayload>) => {\n const apolloResult = await apolloUpdater({\n variables: options.variables || {},\n context: options.context,\n optimisticResponse: options.optimisticResponse,\n update: options.updater,\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,OAAO,eAAe;AACtB;AAAA,EACE,mBAAmB;AAAA,EACnB,YAAY;AAAA,EACZ,eAAe;AAAA,OAKV;AASP;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;AACnC,SAAS,yCAAyC;AAoB3C,SAAS,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AAkC;AACjD,QAAM,EAAE,MAAM,IAAI;AAAA,IAChB,SAAS,0BAA0B;AAAA,IACnC;AAAA,MACE;AAAA,MACA,WAAW,OAAO;AAAA,MAClB,SAAS,OAAO;AAAA,MAChB,oBAAoB,CAAC,EAAE,iBAAiB,MAAM;AAG5C;AAAA,UACE,CAAC,iBAAiB;AAAA,UAClB;AAAA,QACF;AACA,YAAI,iBAAiB,QAAQ,OAAO,QAAQ;AAC1C,iBAAO,OAAO,iBAAiB,IAAI;AAAA,QACrC;AAAA,MACF;AAAA,MACA,aAAa;AAAA,IACf;AAAA,EAGF;AACA,MAAI,OAAO;AACT,QAAI,OAAO,SAAS;AAClB,aAAO,QAAQ,KAAK;AAAA,IACtB,OAAO;AACL,cAAQ;AAAA,QACN,qDAAqD,MAAM;AAAA,MAC7D;AAAA,IACF;AAAA,EACF;AACF;
|
|
4
|
+
"sourcesContent": ["import invariant from \"invariant\";\nimport {\n useSubscription as useApolloSubscription,\n useQuery as useApolloQuery,\n useMutation as useApolloMutation,\n SubscriptionHookOptions as ApolloSubscriptionHookOptions,\n ErrorPolicy as ApolloErrorPolicy,\n ApolloClient,\n ApolloCache,\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\";\nimport type { CompiledArtefactModule } from \"@graphitation/apollo-react-relay-duct-tape-compiler\";\nimport { FragmentReference } from \"./storeObservation/compiledHooks/types\";\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 * @param options.context The query context to pass along the apollo link chain. Should be avoided when possible as\n * it will not be compatible with Relay APIs.\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; context?: TQuery[\"context\"] },\n): { error?: Error; data?: TQuery[\"response\"] } {\n invariant(\n query?.__brand === undefined,\n \"useLazyLoadQuery: Document must be a valid runtime type.\",\n );\n const apolloOptions = options && {\n ...options,\n fetchPolicy: convertFetchPolicy(options.fetchPolicy),\n };\n if (query.watchQueryDocument) {\n return useCompiledLazyLoadQuery(query as CompiledArtefactModule, {\n variables,\n ...apolloOptions,\n });\n } else {\n const client = useOverridenOrDefaultApolloClient();\n return useApolloQuery(\n // Compiled documents without narrow observables should be treated like\n // normal queries.\n query.executionQueryDocument || query,\n {\n client,\n variables,\n ...apolloOptions,\n },\n );\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 migration purposes, this hook supports the notion that the fragment reference can be undefined. This is\n * to support cases where useFragment is used in a tree that is conditionally using fragments.\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>;\nexport function useFragment(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: undefined,\n): undefined;\nexport function useFragment<TKey extends KeyType>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey | undefined,\n): KeyTypeData<TKey> | undefined;\nexport function useFragment<TKey extends KeyType>(\n fragmentInput: GraphQLTaggedNode | undefined,\n fragmentRef: TKey,\n): KeyTypeData<TKey> {\n invariant(\n fragmentInput?.__brand === undefined,\n \"useFragment: fragmentInput must be a valid runtime type.\",\n );\n // If fragmentInput is undefined, it means the fragment is not compiled and we should just return the fragmentRef.\n // This is an implementation detail that should never surface to the user.\n if (fragmentInput && fragmentInput.watchQueryDocument) {\n return useCompiledFragment(fragmentInput, fragmentRef as FragmentReference);\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,\n \"useRefetchableFragment: Missing metadata; did you forget to use the @refetchable directive?\",\n );\n invariant(\n fragmentInput.__brand === undefined,\n \"useRefetchableFragment: fragmentInput must be a valid runtime type.\",\n );\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"useRefetchableFragment is only supported at this time when using compilation\",\n );\n return useCompiledRefetchableFragment(\n fragmentInput as CompiledArtefactModule,\n fragmentRef as FragmentReference,\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,\n \"usePaginationFragment: Missing metadata; did you forget to use the @refetchable directive?\",\n );\n invariant(\n fragmentInput.__brand === undefined,\n \"usePaginationFragment: fragmentInput must be a valid runtime type.\",\n );\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"usePaginationFragment is only supported at this time when using compilation\",\n );\n return useCompiledPaginationFragment(\n fragmentInput as CompiledArtefactModule,\n fragmentRef as FragmentReference,\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 be avoided when possible as it will not be compatible with Relay APIs.\n */\n context?: TSubscriptionPayload[\"context\"];\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 document = config.subscription;\n invariant(\n document?.__brand === undefined,\n \"useSubscription: Document must be a valid runtime type.\",\n );\n invariant(\n !document.watchQueryDocument,\n \"useSubscription: Did not expect a watch query document\",\n );\n const client = useOverridenOrDefaultApolloClient();\n const { error } = useApolloSubscription(\n document.executionQueryDocument || document,\n {\n client,\n variables: config.variables,\n context: config.context,\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 errorPolicy: \"ignore\",\n } as ApolloSubscriptionHookOptions & {\n errorPolicy: ApolloErrorPolicy;\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 onCompleted?: (response: TMutationPayload[\"response\"]) => void;\n /**\n * This version yields the ApolloCache instance, instead of the RelayStore,\n * and usage of it will not be portable to Relay directly. However, it is a\n * necessary evil for migration purposes.\n */\n updater?: (\n cache: ApolloCache<unknown>,\n data: TMutationPayload[\"response\"],\n ) => void;\n /**\n * @deprecated Should be avoided when possible as it will not be compatible with Relay APIs.\n */\n context?: TMutationPayload[\"context\"];\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 invariant(\n mutation?.__brand === undefined,\n \"useMutation: Document must be a valid runtime type.\",\n );\n invariant(\n !mutation.watchQueryDocument,\n \"useMutation: Did not expect a watch query document\",\n );\n const client = useOverridenOrDefaultApolloClient();\n const [apolloUpdater, { loading: mutationLoading }] = useApolloMutation(\n mutation.executionQueryDocument || mutation,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n { client: client as ApolloClient<any> },\n );\n\n return [\n async (options: IMutationCommitterOptions<TMutationPayload>) => {\n const apolloResult = await apolloUpdater({\n variables: options.variables || {},\n context: options.context,\n optimisticResponse: options.optimisticResponse,\n onCompleted: options.onCompleted,\n update: options.updater,\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,OAAO,eAAe;AACtB;AAAA,EACE,mBAAmB;AAAA,EACnB,YAAY;AAAA,EACZ,eAAe;AAAA,OAKV;AASP;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;AACnC,SAAS,yCAAyC;AAoB3C,SAAS,iBACd,OACA,WACA,SAC8C;AAC9C;AAAA,KACE,+BAAO,aAAY;AAAA,IACnB;AAAA,EACF;AACA,QAAM,gBAAgB,WAAW,iCAC5B,UAD4B;AAAA,IAE/B,aAAa,mBAAmB,QAAQ,WAAW;AAAA,EACrD;AACA,MAAI,MAAM,oBAAoB;AAC5B,WAAO,yBAAyB,OAAiC;AAAA,MAC/D;AAAA,OACG,cACJ;AAAA,EACH,OAAO;AACL,UAAM,SAAS,kCAAkC;AACjD,WAAO;AAAA;AAAA;AAAA,MAGL,MAAM,0BAA0B;AAAA,MAChC;AAAA,QACE;AAAA,QACA;AAAA,SACG;AAAA,IAEP;AAAA,EACF;AACF;AAiCO,SAAS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AAK;AAAA,IACtB,OAAO;AACL,cAAQ;AAAA,QACN,qDAAqD,MAAM;AAAA,MAC7D;AAAA,IACF;AAAA,EACF;AACF;AA+BO,SAAS,YACd,UAC+C;AAC/C;AAAA,KACE,qCAAU,aAAY;AAAA,IACtB;AAAA,EACF;AACA;AAAA,IACE,CAAC,SAAS;AAAA,IACV;AAAA,EACF;AACA,QAAM,SAAS,kCAAkC;AACjD,QAAM,CAAC,eAAe,EAAE,SAAS,gBAAgB,CAAC,IAAI;AAAA,IACpD,SAAS,0BAA0B;AAAA;AAAA,IAEnC,EAAE,OAAoC;AAAA,EACxC;AAEA,SAAO;AAAA,IACL,CAAO,YAAyD;AAC9D,YAAM,eAAe,MAAM,cAAc;AAAA,QACvC,WAAW,QAAQ,aAAa,CAAC;AAAA,QACjC,SAAS,QAAQ;AAAA,QACjB,oBAAoB,QAAQ;AAAA,QAC5B,aAAa,QAAQ;AAAA,QACrB,QAAQ,QAAQ;AAAA,MAClB,CAAC;AACD,UAAI,aAAa,QAAQ;AACvB,eAAO;AAAA,UACL,QAAQ,MAAM,KAAK,OAAO,OAAO,aAAa,MAAM,CAAC;AAAA,UACrD,MAAM,aAAa;AAAA,QACrB;AAAA,MACF;AACA,aAAO;AAAA,QACL,MAAM,aAAa;AAAA,MACrB;AAAA,IACF;AAAA,IACA;AAAA,EACF;AACF;",
|
|
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.
|
|
5
|
+
"version": "1.2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/microsoft/graphitation.git",
|