@graphitation/apollo-react-relay-duct-tape 1.0.1-alpha.1 → 1.0.1-alpha.4
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 -0
- package/CHANGELOG.md +27 -1
- package/lib/hooks.d.ts +31 -122
- package/lib/hooks.d.ts.map +1 -1
- package/lib/hooks.js.map +2 -2
- package/lib/hooks.mjs +1 -1
- package/lib/hooks.mjs.map +2 -2
- package/lib/index.mjs +1 -1
- package/lib/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment.graphql.d.ts +1 -1
- package/lib/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment.graphql.d.ts.map +1 -1
- package/lib/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment.graphql.js.map +1 -1
- package/lib/storeObservation/__generated__/compiledHooks_ChildFragment.graphql.d.ts +1 -1
- package/lib/storeObservation/__generated__/compiledHooks_ChildFragment.graphql.d.ts.map +1 -1
- package/lib/storeObservation/__generated__/compiledHooks_ChildFragment.graphql.js.map +1 -1
- package/lib/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment.graphql.d.ts +1 -1
- package/lib/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment.graphql.d.ts.map +1 -1
- package/lib/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment.graphql.js.map +1 -1
- package/lib/storeObservation/__generated__/compiledHooks_QueryTypeFragment.graphql.d.ts +1 -1
- package/lib/storeObservation/__generated__/compiledHooks_QueryTypeFragment.graphql.d.ts.map +1 -1
- package/lib/storeObservation/__generated__/compiledHooks_QueryTypeFragment.graphql.js.map +1 -1
- package/lib/storeObservation/__generated__/compiledHooks_RefetchableFragment.graphql.d.ts +1 -1
- package/lib/storeObservation/__generated__/compiledHooks_RefetchableFragment.graphql.d.ts.map +1 -1
- package/lib/storeObservation/__generated__/compiledHooks_RefetchableFragment.graphql.js.map +1 -1
- package/lib/storeObservation/__generated__/compiledHooks_Root_executionQuery.graphql.d.ts +1 -1
- package/lib/storeObservation/__generated__/compiledHooks_Root_executionQuery.graphql.d.ts.map +1 -1
- package/lib/storeObservation/__generated__/compiledHooks_Root_executionQuery.graphql.js.map +1 -1
- package/lib/storeObservation/__generated__/compiledHooks_Root_executionQuery.graphql.mjs.map +1 -1
- package/lib/storeObservation/compiledHooks/useCompiledPaginationFragment.d.ts.map +1 -1
- package/lib/storeObservation/compiledHooks/useCompiledPaginationFragment.js +5 -1
- package/lib/storeObservation/compiledHooks/useCompiledPaginationFragment.js.map +2 -2
- package/lib/storeObservation/compiledHooks/useCompiledPaginationFragment.mjs +8 -2
- package/lib/storeObservation/compiledHooks/useCompiledPaginationFragment.mjs.map +2 -2
- package/lib/storeObservation/compiledHooks.test.js +26 -144
- package/lib/storeObservation/compiledHooks.test.js.map +2 -2
- package/lib/storeObservation/compiledHooks.test.mjs +34 -146
- package/lib/storeObservation/compiledHooks.test.mjs.map +2 -2
- package/lib/storeObservation/createImportDocumentsTransform.d.ts +1 -0
- package/lib/storeObservation/createImportDocumentsTransform.d.ts.map +1 -1
- package/lib/storeObservation/createImportDocumentsTransform.js +28 -17
- package/lib/storeObservation/createImportDocumentsTransform.js.map +2 -2
- package/lib/storeObservation/createImportDocumentsTransform.mjs +29 -17
- package/lib/storeObservation/createImportDocumentsTransform.mjs.map +2 -2
- package/lib/storeObservation/createImportDocumentsTransform.test.js +55 -27
- package/lib/storeObservation/createImportDocumentsTransform.test.js.map +2 -2
- package/lib/storeObservation/createImportDocumentsTransform.test.mjs +57 -30
- package/lib/storeObservation/createImportDocumentsTransform.test.mjs.map +2 -2
- package/lib/storeObservation/nodeFromCacheFieldPolicy.d.ts +31 -1
- package/lib/storeObservation/nodeFromCacheFieldPolicy.d.ts.map +1 -1
- package/lib/storeObservation/nodeFromCacheFieldPolicy.js +12 -13
- package/lib/storeObservation/nodeFromCacheFieldPolicy.js.map +2 -2
- package/lib/storeObservation/nodeFromCacheFieldPolicy.mjs +12 -13
- package/lib/storeObservation/nodeFromCacheFieldPolicy.mjs.map +2 -2
- package/lib/storeObservation/nodeFromCacheFieldPolicy.test.js +70 -35
- package/lib/storeObservation/nodeFromCacheFieldPolicy.test.js.map +2 -2
- package/lib/storeObservation/nodeFromCacheFieldPolicy.test.mjs +79 -37
- package/lib/storeObservation/nodeFromCacheFieldPolicy.test.mjs.map +2 -2
- package/lib/storeObservation/typePolicies.d.ts +2 -1
- package/lib/storeObservation/typePolicies.d.ts.map +1 -1
- package/lib/storeObservation/typePolicies.js +22 -17
- package/lib/storeObservation/typePolicies.js.map +2 -2
- package/lib/storeObservation/typePolicies.mjs +26 -18
- package/lib/storeObservation/typePolicies.mjs.map +2 -2
- package/package.json +21 -17
- package/graphitation-apollo-react-relay-duct-tape-0.5.0-store-observation.8.tgz +0 -0
package/.eslintcache
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestFragment.graphql.ts":"1","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestMutation.graphql.ts":"2","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestQuery.graphql.ts":"3","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestSubscription.graphql.ts":"4","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestWatchNodeQuery.graphql.ts":"5","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/hooks.test.tsx":"6","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/convertFetchPolicy.ts":"7","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/hooks.ts":"8","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/index.ts":"9","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment.graphql.ts":"10","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment_PaginationQuery.graphql.ts":"11","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ChildFragment.graphql.ts":"12","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ChildWatchNodeQuery.graphql.ts":"13","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment.graphql.ts":"14","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment_PaginationQuery.graphql.ts":"15","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_QueryTypeFragment.graphql.ts":"16","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_QueryTypeWatchNodeQuery.graphql.ts":"17","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_RefetchableFragment.graphql.ts":"18","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_RefetchableFragment_RefetchQuery.graphql.ts":"19","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_Root_executionQuery.graphql.ts":"20","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/index.ts":"21","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/types.ts":"22","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledFragment.ts":"23","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledLazyLoadQuery.ts":"24","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledPaginationFragment.ts":"25","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledRefetchableFragment.ts":"26","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useDeepCompareMemoize.ts":"27","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useForceUpdate.ts":"28","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks.test.tsx":"29","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/createImportDocumentsTransform.test.ts":"30","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/createImportDocumentsTransform.ts":"31","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/fragmentReferencesFieldPolicy.test.ts":"32","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/fragmentReferencesFieldPolicy.ts":"33","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/index.ts":"34","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/nodeFromCacheFieldPolicy.test.ts":"35","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/nodeFromCacheFieldPolicy.ts":"36","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/shallowCompareFragmentReferences.ts":"37","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/typePolicies.ts":"38","/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/types.ts":"39"},{"size":527,"mtime":1653524951758,"results":"40","hashOfConfig":"41"},{"size":8845,"mtime":1653524951758,"results":"42","hashOfConfig":"41"},{"size":6838,"mtime":1653524951758,"results":"43","hashOfConfig":"41"},{"size":6980,"mtime":1653524951758,"results":"44","hashOfConfig":"41"},{"size":4869,"mtime":1653524951758,"results":"45","hashOfConfig":"41"},{"size":9970,"mtime":1653524951758,"results":"46","hashOfConfig":"41"},{"size":689,"mtime":1653524951758,"results":"47","hashOfConfig":"41"},{"size":8678,"mtime":1653524951758,"results":"48","hashOfConfig":"41"},{"size":86,"mtime":1653524951758,"results":"49","hashOfConfig":"41"},{"size":795,"mtime":1653524951758,"results":"50","hashOfConfig":"41"},{"size":21245,"mtime":1653524951758,"results":"51","hashOfConfig":"41"},{"size":542,"mtime":1653524951758,"results":"52","hashOfConfig":"41"},{"size":4762,"mtime":1653524951758,"results":"53","hashOfConfig":"41"},{"size":957,"mtime":1653524951758,"results":"54","hashOfConfig":"41"},{"size":34594,"mtime":1653524951758,"results":"55","hashOfConfig":"41"},{"size":607,"mtime":1653524951758,"results":"56","hashOfConfig":"41"},{"size":2420,"mtime":1653524951758,"results":"57","hashOfConfig":"41"},{"size":641,"mtime":1653524951758,"results":"58","hashOfConfig":"41"},{"size":11175,"mtime":1653524951758,"results":"59","hashOfConfig":"41"},{"size":27253,"mtime":1653524951758,"results":"60","hashOfConfig":"41"},{"size":445,"mtime":1653524951758,"results":"61","hashOfConfig":"41"},{"size":518,"mtime":1653524951758,"results":"62","hashOfConfig":"41"},{"size":2329,"mtime":1653524951758,"results":"63","hashOfConfig":"41"},{"size":3332,"mtime":1653524951758,"results":"64","hashOfConfig":"41"},{"size":8799,"mtime":1653524951758,"results":"65","hashOfConfig":"41"},{"size":5149,"mtime":1653524951758,"results":"66","hashOfConfig":"41"},{"size":843,"mtime":1653524951758,"results":"67","hashOfConfig":"41"},{"size":152,"mtime":1653524951758,"results":"68","hashOfConfig":"41"},{"size":33457,"mtime":1653524951758,"results":"69","hashOfConfig":"41"},{"size":2108,"mtime":1653524951758,"results":"70","hashOfConfig":"41"},{"size":5887,"mtime":1653524951758,"results":"71","hashOfConfig":"41"},{"size":1838,"mtime":1653524951758,"results":"72","hashOfConfig":"41"},{"size":285,"mtime":1653524951758,"results":"73","hashOfConfig":"41"},{"size":342,"mtime":1653524951758,"results":"74","hashOfConfig":"41"},{"size":3040,"mtime":1653524951758,"results":"75","hashOfConfig":"41"},{"size":2765,"mtime":1653524951758,"results":"76","hashOfConfig":"41"},{"size":2092,"mtime":1653524951758,"results":"77","hashOfConfig":"41"},{"size":1102,"mtime":1653524951758,"results":"78","hashOfConfig":"41"},{"size":1674,"mtime":1653524951758,"results":"79","hashOfConfig":"41"},{"filePath":"80","messages":"81","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1vsqegx",{"filePath":"82","messages":"83","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"84","messages":"85","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"86","messages":"87","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"88","messages":"89","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"90","messages":"91","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"92","messages":"93","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"94","messages":"95","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"96","messages":"97","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"98","messages":"99","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"100","messages":"101","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"102","messages":"103","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"104","messages":"105","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"106","messages":"107","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"108","messages":"109","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"110","messages":"111","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"112","messages":"113","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"114","messages":"115","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"116","messages":"117","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"118","messages":"119","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"120","messages":"121","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"122","messages":"123","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"124","messages":"125","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"126","messages":"127","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"128","messages":"129","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"130","messages":"131","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"132","messages":"133","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"134","messages":"135","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"136","messages":"137","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"138","messages":"139","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"140","messages":"141","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"142","messages":"143","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"144","messages":"145","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"146","messages":"147","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"148","messages":"149","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"150","messages":"151","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"152","messages":"153","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"154","messages":"155","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"156","messages":"157","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestFragment.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestMutation.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestSubscription.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/__generated__/hooksTestWatchNodeQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/__tests__/hooks.test.tsx",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/convertFetchPolicy.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/hooks.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/index.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment_PaginationQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ChildFragment.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ChildWatchNodeQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment_PaginationQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_QueryTypeFragment.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_QueryTypeWatchNodeQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_RefetchableFragment.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_RefetchableFragment_RefetchQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/__generated__/compiledHooks_Root_executionQuery.graphql.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/index.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/types.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledFragment.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledLazyLoadQuery.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledPaginationFragment.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useCompiledRefetchableFragment.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useDeepCompareMemoize.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks/useForceUpdate.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/compiledHooks.test.tsx",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/createImportDocumentsTransform.test.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/createImportDocumentsTransform.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/fragmentReferencesFieldPolicy.test.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/fragmentReferencesFieldPolicy.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/index.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/nodeFromCacheFieldPolicy.test.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/nodeFromCacheFieldPolicy.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/shallowCompareFragmentReferences.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/storeObservation/typePolicies.ts",[],"/mnt/vss/_work/1/s/packages/apollo-react-relay-duct-tape/src/types.ts",[]]
|
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,35 @@
|
|
|
1
1
|
# Change Log - @graphitation/apollo-react-relay-duct-tape
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 26 May 2022 00:34:23 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.0.1-alpha.4
|
|
8
|
+
|
|
9
|
+
Thu, 26 May 2022 00:34:23 GMT
|
|
10
|
+
|
|
11
|
+
### Changes
|
|
12
|
+
|
|
13
|
+
- [duct-tape] Export import transform for ts-jest (eloy.de.enige@gmail.com)
|
|
14
|
+
- [duct-tape] Make artefact import transform work for es5 modules (eloy.de.enige@gmail.com)
|
|
15
|
+
|
|
16
|
+
## 1.0.1-alpha.3
|
|
17
|
+
|
|
18
|
+
Thu, 07 Apr 2022 17:44:14 GMT
|
|
19
|
+
|
|
20
|
+
### Changes
|
|
21
|
+
|
|
22
|
+
- [object Object] (eloy.de.enige@gmail.com)
|
|
23
|
+
|
|
24
|
+
## 1.0.1-alpha.2
|
|
25
|
+
|
|
26
|
+
Fri, 01 Apr 2022 14:32:44 GMT
|
|
27
|
+
|
|
28
|
+
### Changes
|
|
29
|
+
|
|
30
|
+
- Support strict Global Object Identification setup (eloy.de.enige@gmail.com)
|
|
31
|
+
- Bump relay-compiler-language-graphitation to v1.0.0-alpha.3
|
|
32
|
+
|
|
7
33
|
## 0.7.4
|
|
8
34
|
|
|
9
35
|
Fri, 14 Jan 2022 11:15:34 GMT
|
package/lib/hooks.d.ts
CHANGED
|
@@ -6,38 +6,7 @@ import { RefetchFn, PaginationFn } from "./storeObservation/compiledHooks";
|
|
|
6
6
|
* This hook is called 'lazy' as it is used to fetch a GraphQL query _during_ render. This hook can trigger multiple
|
|
7
7
|
* round trips, one for loading and one for resolving.
|
|
8
8
|
*
|
|
9
|
-
* @see {
|
|
10
|
-
* GraphQL operation and thus does not take in any props such as opaque fragment references.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
```typescript
|
|
14
|
-
import { graphql, useLazyLoadQuery } from "@nova-facade/react-graphql";
|
|
15
|
-
import { SomeReactComponent, fragment as SomeReactComponent_someGraphQLType } from "./SomeReactComponent";
|
|
16
|
-
import { SomeRootReactComponentQuery } from "./__generated__/SomeRootReactComponentQuery.graphql";
|
|
17
|
-
|
|
18
|
-
const query = graphql`
|
|
19
|
-
query SomeRootReactComponentQuery {
|
|
20
|
-
someGraphQLType {
|
|
21
|
-
...SomeReactComponent_someGraphQLType
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
${SomeReactComponent_someGraphQLType}
|
|
25
|
-
`;
|
|
26
|
-
|
|
27
|
-
export const SomeRootReactComponent: React.FC = () => {
|
|
28
|
-
const result = useLazyLoadQuery<SomeRootReactComponentQuery>(query);
|
|
29
|
-
if (result.error) {
|
|
30
|
-
throw result.error;
|
|
31
|
-
} else if (!result.data) {
|
|
32
|
-
// Loading
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<SomeReactComponent someGraphQLType={result.data.someGraphQLType} />
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
```
|
|
9
|
+
* @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-lazy-load-query}
|
|
41
10
|
*
|
|
42
11
|
* @param query The query operation to perform.
|
|
43
12
|
* @param variables Object containing the variable values to fetch the query. These variables need to match GraphQL
|
|
@@ -60,63 +29,39 @@ export declare function useLazyLoadQuery<TQuery extends OperationType>(query: Gr
|
|
|
60
29
|
* For children that *do* have their own data requirements expressed using GraphQL, the fragment should ensure to
|
|
61
30
|
* spread in the child's fragment.
|
|
62
31
|
*
|
|
63
|
-
*
|
|
64
|
-
* TypeScript typings that correspond to the selected fields and referenced child component fragments. These typings
|
|
65
|
-
* live in files in the sibling `./__generated__/` directory and are called after the fragment name. The compiler will
|
|
66
|
-
* enforce some constraints about the fragment name, such that it starts with the name of the file it is defined in
|
|
67
|
-
* (i.e. the name of the component) and ends with the name of the fragment reference prop that this component takes in
|
|
68
|
-
* (which typically will be named after the GraphQL type that the fragment is defined on).
|
|
69
|
-
*
|
|
70
|
-
* The typing that has a `$key` suffix is meant to be used for the opaque fragment reference prop, whereas the typing
|
|
71
|
-
* without a suffix describes the actual data and is only meant for usage internally to the file. When the opaque
|
|
72
|
-
* fragment reference prop is passed to a `useFragment` call, the returned data will be unmasked and be typed according
|
|
73
|
-
* to the typing without a suffix. As such, the unmasked typing is only ever needed when extracting pieces of the
|
|
74
|
-
* component to the file scope. For functions extracted to different files, however, you should type those separately
|
|
75
|
-
* and *not* use the emitted typings.
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
```typescript
|
|
79
|
-
import { graphql, useFragment } from "@nova-facade/react-graphql";
|
|
80
|
-
import { SomeChildReactComponent, fragment as SomeChildReactComponent_someGraphQLType } from "./SomeChildReactComponent";
|
|
81
|
-
import { SomeReactComponent_someGraphQLType$key } from "./__generated__/SomeReactComponent_someGraphQLType.graphql";
|
|
82
|
-
|
|
83
|
-
export const fragment = graphql`
|
|
84
|
-
fragment SomeReactComponent_someGraphQLType on SomeGraphQLType {
|
|
85
|
-
someDataThatThisComponentNeeds
|
|
86
|
-
...SomeChildReactComponent_someGraphQLType
|
|
87
|
-
}
|
|
88
|
-
${SomeChildReactComponent_someGraphQLType}
|
|
89
|
-
`;
|
|
90
|
-
|
|
91
|
-
export interface SomeReactComponentProps {
|
|
92
|
-
someGraphQLType: SomeReactComponent_someGraphQLType$key;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export const SomeReactComponent: React.FunctionComponent<SomeReactComponentProps> = props => {
|
|
96
|
-
const someGraphQLType = useFragment(fragment, props.someGraphQLType);
|
|
97
|
-
return (
|
|
98
|
-
<div>
|
|
99
|
-
<span>{someGraphQLType.someDataThatThisComponentNeeds}</span>
|
|
100
|
-
<SomeChildReactComponent someGraphQLType={someGraphQLType} />
|
|
101
|
-
</div>
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
```
|
|
32
|
+
* @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-fragment}
|
|
105
33
|
*
|
|
106
34
|
* @note For now, the fragment objects should be exported such that parent's can interpolate them into their own
|
|
107
35
|
* GraphQL documents. This may change in the future when/if we entirely switch to static compilation and will
|
|
108
36
|
* allow us to also move the usage of the graphql tagged template function inline at the `useFragment` call-site.
|
|
109
37
|
*
|
|
110
|
-
* @
|
|
111
|
-
* is simply unmasked at compile-time but otherwise passed through from the parent at run-time.
|
|
112
|
-
*
|
|
113
|
-
* @param _fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.
|
|
38
|
+
* @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.
|
|
114
39
|
* @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's
|
|
115
40
|
* fragment.
|
|
116
41
|
* @returns The data corresponding to the field selections.
|
|
117
42
|
*/
|
|
118
43
|
export declare function useFragment<TKey extends KeyType>(fragmentInput: GraphQLTaggedNode, fragmentRef: TKey): KeyTypeData<TKey>;
|
|
44
|
+
/**
|
|
45
|
+
* Equivalent to `useFragment`, but allows refetching of its subtree of the overall query.
|
|
46
|
+
*
|
|
47
|
+
* @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-refetchable-fragment}
|
|
48
|
+
*
|
|
49
|
+
* @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.
|
|
50
|
+
* @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's
|
|
51
|
+
* fragment.
|
|
52
|
+
* @returns The data corresponding to the field selections and a function to perform the refetch.
|
|
53
|
+
*/
|
|
119
54
|
export declare function useRefetchableFragment<TQuery extends OperationType, TKey extends KeyType>(fragmentInput: GraphQLTaggedNode, fragmentRef: TKey): [data: KeyTypeData<TKey>, refetch: RefetchFn<TQuery["variables"]>];
|
|
55
|
+
/**
|
|
56
|
+
* Equivalent to `useFragment`, but allows pagination of its subtree of the overall query.
|
|
57
|
+
*
|
|
58
|
+
* @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-pagination-fragment}
|
|
59
|
+
*
|
|
60
|
+
* @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.
|
|
61
|
+
* @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's
|
|
62
|
+
* fragment.
|
|
63
|
+
* @returns The data corresponding to the field selections and functions to deal with pagination.
|
|
64
|
+
*/
|
|
120
65
|
export declare function usePaginationFragment<TQuery extends OperationType, TKey extends KeyType>(fragmentInput: GraphQLTaggedNode, fragmentRef: TKey): {
|
|
121
66
|
data: KeyTypeData<TKey>;
|
|
122
67
|
loadNext: PaginationFn;
|
|
@@ -136,6 +81,11 @@ interface GraphQLSubscriptionConfig<TSubscriptionPayload extends OperationType>
|
|
|
136
81
|
onNext?: (response: TSubscriptionPayload["response"]) => void;
|
|
137
82
|
onError?: (error: Error) => void;
|
|
138
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-subscription}
|
|
86
|
+
*
|
|
87
|
+
* @param config
|
|
88
|
+
*/
|
|
139
89
|
export declare function useSubscription<TSubscriptionPayload extends OperationType>(config: GraphQLSubscriptionConfig<TSubscriptionPayload>): void;
|
|
140
90
|
interface IMutationCommitterOptions<TMutationPayload extends OperationType> {
|
|
141
91
|
variables: TMutationPayload["variables"];
|
|
@@ -146,51 +96,10 @@ declare type MutationCommiter<TMutationPayload extends OperationType> = (options
|
|
|
146
96
|
data?: TMutationPayload["response"];
|
|
147
97
|
}>;
|
|
148
98
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
* Returned function can be called to perform the actual mutation with provided variables.
|
|
152
|
-
*
|
|
153
|
-
* @param mutation Mutation document
|
|
154
|
-
* @returns [commitMutationFn, isInFlight]
|
|
155
|
-
*
|
|
156
|
-
* commitMutationFn
|
|
157
|
-
* @param options.variables map of variables to pass to mutation
|
|
158
|
-
* @param options.optimisticResponse proposed response to apply to the store while mutation is in flight
|
|
159
|
-
* @returns A Promise to an object with either errors or/and the result data
|
|
99
|
+
* @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-mutation}
|
|
160
100
|
*
|
|
161
|
-
*
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
const mutation = graphql`
|
|
165
|
-
mutation SomeReactComponentMutation($newName: String!) {
|
|
166
|
-
someMutation(newName: $newName) {
|
|
167
|
-
__typeName
|
|
168
|
-
id
|
|
169
|
-
newName
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
`
|
|
173
|
-
|
|
174
|
-
export const SomeReactComponent: React.FunctionComponent<SomeReactComponentProps> = props => {
|
|
175
|
-
const [commitMutation, isInFlight] = useMutation(mutation);
|
|
176
|
-
return (
|
|
177
|
-
<div>
|
|
178
|
-
<button onClick={() => commitMutation({
|
|
179
|
-
variables: {
|
|
180
|
-
newName: "foo"
|
|
181
|
-
},
|
|
182
|
-
optimisticResponse: {
|
|
183
|
-
someMutation: {
|
|
184
|
-
__typename: "SomeMutationPayload",
|
|
185
|
-
id: "1",
|
|
186
|
-
newName: "foo",
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
})} disabled={isInFlight}/>
|
|
190
|
-
</div>
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
```
|
|
101
|
+
* @param mutation
|
|
102
|
+
* @returns
|
|
194
103
|
*/
|
|
195
104
|
export declare function useMutation<TMutationPayload extends OperationType>(mutation: GraphQLTaggedNode): [MutationCommiter<TMutationPayload>, boolean];
|
|
196
105
|
export {};
|
package/lib/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,WAAW,EACX,aAAa,EACd,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,SAAS,EACT,YAAY,EAKb,MAAM,kCAAkC,CAAC;AAG1C
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,WAAW,EACX,aAAa,EACd,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,SAAS,EACT,YAAY,EAKb,MAAM,kCAAkC,CAAC;AAG1C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,SAAS,aAAa,EAC3D,KAAK,EAAE,iBAAiB,EACxB,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,EAC9B,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,WAAW,CAAA;CAAE,GACtC;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;CAAE,CAa9C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CAAC,IAAI,SAAS,OAAO,EAC9C,aAAa,EAAE,iBAAiB,EAChC,WAAW,EAAE,IAAI,GAChB,WAAW,CAAC,IAAI,CAAC,CAMnB;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,SAAS,aAAa,EAC5B,IAAI,SAAS,OAAO,EAEpB,aAAa,EAAE,iBAAiB,EAChC,WAAW,EAAE,IAAI,GAChB,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CASpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,SAAS,aAAa,EAC5B,IAAI,SAAS,OAAO,EAEpB,aAAa,EAAE,iBAAiB,EAChC,WAAW,EAAE,IAAI,GAChB;IACD,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IACxB,QAAQ,EAAE,YAAY,CAAC;IACvB,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;CACzC,CASA;AAGD,UAAU,yBAAyB,CACjC,oBAAoB,SAAS,aAAa;IAE1C,YAAY,EAAE,iBAAiB,CAAC;IAChC,SAAS,EAAE,oBAAoB,CAAC,WAAW,CAAC,CAAC;IAC7C;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,oBAAoB,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IAC9D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,oBAAoB,SAAS,aAAa,EACxE,MAAM,EAAE,yBAAyB,CAAC,oBAAoB,CAAC,GACtD,IAAI,CA4BN;AAED,UAAU,yBAAyB,CAAC,gBAAgB,SAAS,aAAa;IACxE,SAAS,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;IACzC,kBAAkB,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,GAAG,IAAI,CAAC;CACnE;AAED,aAAK,gBAAgB,CAAC,gBAAgB,SAAS,aAAa,IAAI,CAC9D,OAAO,EAAE,yBAAyB,CAAC,gBAAgB,CAAC,KACjD,OAAO,CAAC;IAAE,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAA;CAAE,CAAC,CAAC;AAExE;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,gBAAgB,SAAS,aAAa,EAChE,QAAQ,EAAE,iBAAiB,GAC1B,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,CAwB/C"}
|
package/lib/hooks.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/hooks.ts"],
|
|
4
|
-
"sourcesContent": ["import { DocumentNode } from \"graphql\";\nimport invariant from \"invariant\";\nimport {\n useSubscription as useApolloSubscription,\n useQuery as useApolloQuery,\n useMutation as useApolloMutation,\n} from \"@apollo/client\";\n\nimport {\n FetchPolicy,\n GraphQLTaggedNode,\n KeyType,\n KeyTypeData,\n OperationType,\n} from \"./types\";\nimport {\n RefetchFn,\n PaginationFn,\n useCompiledLazyLoadQuery,\n useCompiledFragment,\n useCompiledRefetchableFragment,\n useCompiledPaginationFragment,\n} from \"./storeObservation/compiledHooks\";\nimport { convertFetchPolicy } from \"./convertFetchPolicy\";\n\n/**\n * Executes a GraphQL query.\n *\n * This hook is called 'lazy' as it is used to fetch a GraphQL query _during_ render. This hook can trigger multiple\n * round trips, one for loading and one for resolving.\n *\n * @see {useFragment} This function largely follows the documentation of `useFragment`, except that this is a root of a\n * GraphQL operation and thus does not take in any props such as opaque fragment references.\n *\n * @example\n ```typescript\n import { graphql, useLazyLoadQuery } from \"@nova-facade/react-graphql\";\n import { SomeReactComponent, fragment as SomeReactComponent_someGraphQLType } from \"./SomeReactComponent\";\n import { SomeRootReactComponentQuery } from \"./__generated__/SomeRootReactComponentQuery.graphql\";\n\n const query = graphql`\n query SomeRootReactComponentQuery {\n someGraphQLType {\n ...SomeReactComponent_someGraphQLType\n }\n }\n ${SomeReactComponent_someGraphQLType}\n `;\n\n export const SomeRootReactComponent: React.FC = () => {\n const result = useLazyLoadQuery<SomeRootReactComponentQuery>(query);\n if (result.error) {\n throw result.error;\n } else if (!result.data) {\n // Loading\n return null;\n }\n\n return (\n <SomeReactComponent someGraphQLType={result.data.someGraphQLType} />\n );\n };\n ```\n *\n * @param query The query operation to perform.\n * @param variables Object containing the variable values to fetch the query. These variables need to match GraphQL\n * variables declared inside the query.\n * @param options Options passed on to the underlying implementation.\n * @returns An object with either an error, the result data, or neither while loading.\n */\nexport function useLazyLoadQuery<TQuery extends OperationType>(\n query: GraphQLTaggedNode,\n variables: TQuery[\"variables\"],\n options?: { fetchPolicy?: FetchPolicy }\n): { error?: Error; data?: TQuery[\"response\"] } {\n const apolloOptions = options && {\n ...options,\n fetchPolicy: convertFetchPolicy(options.fetchPolicy),\n };\n if (query.watchQueryDocument) {\n return useCompiledLazyLoadQuery(query as any, {\n variables,\n ...apolloOptions,\n });\n } else {\n return useApolloQuery(query, { variables, ...apolloOptions });\n }\n}\n\n/**\n * A first-class way for an individual component to express its direct data requirements using GraphQL. The fragment\n * should select all the fields that the component directly uses in its rendering or needs to pass to external\n * functions. It should *not* select data that its children need, unless those children are intended to remain their\n * pure React props as data inputs.\n *\n * For children that *do* have their own data requirements expressed using GraphQL, the fragment should ensure to\n * spread in the child's fragment.\n *\n * For each fragment defined using the `graphql` tagged template function, the Nova graphql-compiler will emit\n * TypeScript typings that correspond to the selected fields and referenced child component fragments. These typings\n * live in files in the sibling `./__generated__/` directory and are called after the fragment name. The compiler will\n * enforce some constraints about the fragment name, such that it starts with the name of the file it is defined in\n * (i.e. the name of the component) and ends with the name of the fragment reference prop that this component takes in\n * (which typically will be named after the GraphQL type that the fragment is defined on).\n *\n * The typing that has a `$key` suffix is meant to be used for the opaque fragment reference prop, whereas the typing\n * without a suffix describes the actual data and is only meant for usage internally to the file. When the opaque\n * fragment reference prop is passed to a `useFragment` call, the returned data will be unmasked and be typed according\n * to the typing without a suffix. As such, the unmasked typing is only ever needed when extracting pieces of the\n * component to the file scope. For functions extracted to different files, however, you should type those separately\n * and *not* use the emitted typings.\n *\n * @example\n ```typescript\n import { graphql, useFragment } from \"@nova-facade/react-graphql\";\n import { SomeChildReactComponent, fragment as SomeChildReactComponent_someGraphQLType } from \"./SomeChildReactComponent\";\n import { SomeReactComponent_someGraphQLType$key } from \"./__generated__/SomeReactComponent_someGraphQLType.graphql\";\n\n export const fragment = graphql`\n fragment SomeReactComponent_someGraphQLType on SomeGraphQLType {\n someDataThatThisComponentNeeds\n ...SomeChildReactComponent_someGraphQLType\n }\n ${SomeChildReactComponent_someGraphQLType}\n `;\n\n export interface SomeReactComponentProps {\n someGraphQLType: SomeReactComponent_someGraphQLType$key;\n }\n\n export const SomeReactComponent: React.FunctionComponent<SomeReactComponentProps> = props => {\n const someGraphQLType = useFragment(fragment, props.someGraphQLType);\n return (\n <div>\n <span>{someGraphQLType.someDataThatThisComponentNeeds}</span>\n <SomeChildReactComponent someGraphQLType={someGraphQLType} />\n </div>\n );\n }\n ```\n *\n * @note For now, the fragment objects should be exported such that parent's can interpolate them into their own\n * GraphQL documents. This may change in the future when/if we entirely switch to static compilation and will\n * allow us to also move the usage of the graphql tagged template function inline at the `useFragment` call-site.\n *\n * @todo 1613321: Connect useFragment hooks directly to a GraphQL client store for targeted updates. Currently the data\n * is simply unmasked at compile-time but otherwise passed through from the parent at run-time.\n *\n * @param _fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections.\n */\nexport function useFragment<TKey extends KeyType>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): KeyTypeData<TKey> {\n if (fragmentInput.watchQueryDocument) {\n return useCompiledFragment(fragmentInput, fragmentRef as any);\n } else {\n return fragmentRef as unknown;\n }\n}\n\nexport function useRefetchableFragment<\n TQuery extends OperationType,\n TKey extends KeyType\n>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): [data: KeyTypeData<TKey>, refetch: RefetchFn<TQuery[\"variables\"]>] {\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"useRefetchableFragment is only supported at this time when using compilation\"\n );\n return useCompiledRefetchableFragment(\n fragmentInput as any,\n fragmentRef as any\n );\n}\n\nexport function usePaginationFragment<\n TQuery extends OperationType,\n TKey extends KeyType\n>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): {\n data: KeyTypeData<TKey>;\n loadNext: PaginationFn;\n loadPrevious: PaginationFn;\n hasNext: boolean;\n hasPrevious: boolean;\n isLoadingNext: boolean;\n isLoadingPrevious: boolean;\n refetch: RefetchFn<TQuery[\"variables\"]>;\n} {\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"usePaginationFragment is only supported at this time when using compilation\"\n );\n return useCompiledPaginationFragment(\n fragmentInput as any,\n fragmentRef as any\n );\n}\n\n// https://github.com/facebook/relay/blob/master/website/docs/api-reference/types/GraphQLSubscriptionConfig.md\ninterface GraphQLSubscriptionConfig<\n TSubscriptionPayload extends OperationType\n> {\n subscription: GraphQLTaggedNode;\n variables: TSubscriptionPayload[\"variables\"];\n /**\n * Should response be nullable?\n */\n onNext?: (response: TSubscriptionPayload[\"response\"]) => void;\n onError?: (error: Error) => void;\n}\n\nexport function useSubscription<TSubscriptionPayload extends OperationType>(\n config: GraphQLSubscriptionConfig<TSubscriptionPayload>\n): void {\n const { error } = useApolloSubscription(\n // TODO: Right now we don't replace mutation documents with imported artefacts.\n config.subscription as DocumentNode,\n {\n variables: config.variables,\n onSubscriptionData: ({ subscriptionData }) => {\n // Supposedly this never gets triggered for an error by design:\n // https://github.com/apollographql/react-apollo/issues/3177#issuecomment-506758144\n invariant(\n !subscriptionData.error,\n \"Did not expect to receive an error here\"\n );\n if (subscriptionData.data && config.onNext) {\n config.onNext(subscriptionData.data);\n }\n },\n }\n );\n if (error) {\n if (config.onError) {\n config.onError(error);\n } else {\n console.warn(\n `An unhandled GraphQL subscription error occurred: ${error.message}`\n );\n }\n }\n}\n\ninterface IMutationCommitterOptions<TMutationPayload extends OperationType> {\n variables: TMutationPayload[\"variables\"];\n optimisticResponse?: Partial<TMutationPayload[\"response\"]> | null;\n}\n\ntype MutationCommiter<TMutationPayload extends OperationType> = (\n options: IMutationCommitterOptions<TMutationPayload>\n) => Promise<{ errors?: Error[]; data?: TMutationPayload[\"response\"] }>;\n\n/**\n * Declare use of a mutation within component. Returns an array of a function and loading state boolean.\n *\n * Returned function can be called to perform the actual mutation with provided variables.\n *\n * @param mutation Mutation document\n * @returns [commitMutationFn, isInFlight]\n *\n * commitMutationFn\n * @param options.variables map of variables to pass to mutation\n * @param options.optimisticResponse proposed response to apply to the store while mutation is in flight\n * @returns A Promise to an object with either errors or/and the result data\n * \n * Example\n ```\n\n const mutation = graphql`\n mutation SomeReactComponentMutation($newName: String!) {\n someMutation(newName: $newName) {\n __typeName\n id\n newName\n }\n }\n `\n\n export const SomeReactComponent: React.FunctionComponent<SomeReactComponentProps> = props => {\n const [commitMutation, isInFlight] = useMutation(mutation);\n return (\n <div>\n <button onClick={() => commitMutation({\n variables: {\n newName: \"foo\"\n },\n optimisticResponse: {\n someMutation: {\n __typename: \"SomeMutationPayload\",\n id: \"1\",\n newName: \"foo\",\n }\n }\n })} disabled={isInFlight}/>\n </div>\n );\n }\n ```\n */\nexport function useMutation<TMutationPayload extends OperationType>(\n mutation: GraphQLTaggedNode\n): [MutationCommiter<TMutationPayload>, boolean] {\n const [apolloUpdater, { loading: mutationLoading }] = useApolloMutation(\n // TODO: Right now we don't replace mutation documents with imported artefacts.\n mutation as DocumentNode\n );\n\n return [\n async (options: IMutationCommitterOptions<TMutationPayload>) => {\n const apolloResult = await apolloUpdater({\n variables: options.variables || {},\n optimisticResponse: options.optimisticResponse,\n });\n if (apolloResult.errors) {\n return {\n errors: Array.from(Object.values(apolloResult.errors)),\n data: apolloResult.data,\n };\n }\n return {\n data: apolloResult.data,\n };\n },\n mutationLoading,\n ];\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,uBAAsB;AACtB,oBAIO;AASP,2BAOO;AACP,gCAAmC;
|
|
4
|
+
"sourcesContent": ["import { DocumentNode } from \"graphql\";\nimport invariant from \"invariant\";\nimport {\n useSubscription as useApolloSubscription,\n useQuery as useApolloQuery,\n useMutation as useApolloMutation,\n} from \"@apollo/client\";\n\nimport {\n FetchPolicy,\n GraphQLTaggedNode,\n KeyType,\n KeyTypeData,\n OperationType,\n} from \"./types\";\nimport {\n RefetchFn,\n PaginationFn,\n useCompiledLazyLoadQuery,\n useCompiledFragment,\n useCompiledRefetchableFragment,\n useCompiledPaginationFragment,\n} from \"./storeObservation/compiledHooks\";\nimport { convertFetchPolicy } from \"./convertFetchPolicy\";\n\n/**\n * Executes a GraphQL query.\n *\n * This hook is called 'lazy' as it is used to fetch a GraphQL query _during_ render. This hook can trigger multiple\n * round trips, one for loading and one for resolving.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-lazy-load-query}\n *\n * @param query The query operation to perform.\n * @param variables Object containing the variable values to fetch the query. These variables need to match GraphQL\n * variables declared inside the query.\n * @param options Options passed on to the underlying implementation.\n * @returns An object with either an error, the result data, or neither while loading.\n */\nexport function useLazyLoadQuery<TQuery extends OperationType>(\n query: GraphQLTaggedNode,\n variables: TQuery[\"variables\"],\n options?: { fetchPolicy?: FetchPolicy }\n): { error?: Error; data?: TQuery[\"response\"] } {\n const apolloOptions = options && {\n ...options,\n fetchPolicy: convertFetchPolicy(options.fetchPolicy),\n };\n if (query.watchQueryDocument) {\n return useCompiledLazyLoadQuery(query as any, {\n variables,\n ...apolloOptions,\n });\n } else {\n return useApolloQuery(query, { variables, ...apolloOptions });\n }\n}\n\n/**\n * A first-class way for an individual component to express its direct data requirements using GraphQL. The fragment\n * should select all the fields that the component directly uses in its rendering or needs to pass to external\n * functions. It should *not* select data that its children need, unless those children are intended to remain their\n * pure React props as data inputs.\n *\n * For children that *do* have their own data requirements expressed using GraphQL, the fragment should ensure to\n * spread in the child's fragment.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-fragment}\n *\n * @note For now, the fragment objects should be exported such that parent's can interpolate them into their own\n * GraphQL documents. This may change in the future when/if we entirely switch to static compilation and will\n * allow us to also move the usage of the graphql tagged template function inline at the `useFragment` call-site.\n *\n * @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections.\n */\nexport function useFragment<TKey extends KeyType>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): KeyTypeData<TKey> {\n if (fragmentInput.watchQueryDocument) {\n return useCompiledFragment(fragmentInput, fragmentRef as any);\n } else {\n return fragmentRef as unknown;\n }\n}\n\n/**\n * Equivalent to `useFragment`, but allows refetching of its subtree of the overall query.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-refetchable-fragment}\n *\n * @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections and a function to perform the refetch.\n */\nexport function useRefetchableFragment<\n TQuery extends OperationType,\n TKey extends KeyType\n>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): [data: KeyTypeData<TKey>, refetch: RefetchFn<TQuery[\"variables\"]>] {\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"useRefetchableFragment is only supported at this time when using compilation\"\n );\n return useCompiledRefetchableFragment(\n fragmentInput as any,\n fragmentRef as any\n );\n}\n\n/**\n * Equivalent to `useFragment`, but allows pagination of its subtree of the overall query.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-pagination-fragment}\n *\n * @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections and functions to deal with pagination.\n */\nexport function usePaginationFragment<\n TQuery extends OperationType,\n TKey extends KeyType\n>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): {\n data: KeyTypeData<TKey>;\n loadNext: PaginationFn;\n loadPrevious: PaginationFn;\n hasNext: boolean;\n hasPrevious: boolean;\n isLoadingNext: boolean;\n isLoadingPrevious: boolean;\n refetch: RefetchFn<TQuery[\"variables\"]>;\n} {\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"usePaginationFragment is only supported at this time when using compilation\"\n );\n return useCompiledPaginationFragment(\n fragmentInput as any,\n fragmentRef as any\n );\n}\n\n// https://github.com/facebook/relay/blob/master/website/docs/api-reference/types/GraphQLSubscriptionConfig.md\ninterface GraphQLSubscriptionConfig<\n TSubscriptionPayload extends OperationType\n> {\n subscription: GraphQLTaggedNode;\n variables: TSubscriptionPayload[\"variables\"];\n /**\n * Should response be nullable?\n */\n onNext?: (response: TSubscriptionPayload[\"response\"]) => void;\n onError?: (error: Error) => void;\n}\n\n/**\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-subscription}\n *\n * @param config\n */\nexport function useSubscription<TSubscriptionPayload extends OperationType>(\n config: GraphQLSubscriptionConfig<TSubscriptionPayload>\n): void {\n const { error } = useApolloSubscription(\n // TODO: Right now we don't replace mutation documents with imported artefacts.\n config.subscription as DocumentNode,\n {\n variables: config.variables,\n onSubscriptionData: ({ subscriptionData }) => {\n // Supposedly this never gets triggered for an error by design:\n // https://github.com/apollographql/react-apollo/issues/3177#issuecomment-506758144\n invariant(\n !subscriptionData.error,\n \"Did not expect to receive an error here\"\n );\n if (subscriptionData.data && config.onNext) {\n config.onNext(subscriptionData.data);\n }\n },\n }\n );\n if (error) {\n if (config.onError) {\n config.onError(error);\n } else {\n console.warn(\n `An unhandled GraphQL subscription error occurred: ${error.message}`\n );\n }\n }\n}\n\ninterface IMutationCommitterOptions<TMutationPayload extends OperationType> {\n variables: TMutationPayload[\"variables\"];\n optimisticResponse?: Partial<TMutationPayload[\"response\"]> | null;\n}\n\ntype MutationCommiter<TMutationPayload extends OperationType> = (\n options: IMutationCommitterOptions<TMutationPayload>\n) => Promise<{ errors?: Error[]; data?: TMutationPayload[\"response\"] }>;\n\n/**\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-mutation}\n *\n * @param mutation\n * @returns\n */\nexport function useMutation<TMutationPayload extends OperationType>(\n mutation: GraphQLTaggedNode\n): [MutationCommiter<TMutationPayload>, boolean] {\n const [apolloUpdater, { loading: mutationLoading }] = useApolloMutation(\n // TODO: Right now we don't replace mutation documents with imported artefacts.\n mutation as DocumentNode\n );\n\n return [\n async (options: IMutationCommitterOptions<TMutationPayload>) => {\n const apolloResult = await apolloUpdater({\n variables: options.variables || {},\n optimisticResponse: options.optimisticResponse,\n });\n if (apolloResult.errors) {\n return {\n errors: Array.from(Object.values(apolloResult.errors)),\n data: apolloResult.data,\n };\n }\n return {\n data: apolloResult.data,\n };\n },\n mutationLoading,\n ];\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,uBAAsB;AACtB,oBAIO;AASP,2BAOO;AACP,gCAAmC;AAgB5B,0BACL,OACA,WACA,SAC8C;AAC9C,QAAM,gBAAgB,WAAW,4BAC5B,UAD4B;AAAA,IAE/B,aAAa,kDAAmB,QAAQ;AAAA;AAE1C,MAAI,MAAM,oBAAoB;AAC5B,WAAO,mDAAyB,OAAc;AAAA,MAC5C;AAAA,OACG;AAAA,SAEA;AACL,WAAO,4BAAe,OAAO,aAAE,YAAc;AAAA;AAAA;AAwB1C,qBACL,eACA,aACmB;AACnB,MAAI,cAAc,oBAAoB;AACpC,WAAO,8CAAoB,eAAe;AAAA,SACrC;AACL,WAAO;AAAA;AAAA;AAcJ,gCAIL,eACA,aACoE;AACpE,gCACE,CAAC,CAAC,cAAc,oBAChB;AAEF,SAAO,yDACL,eACA;AAAA;AAcG,+BAIL,eACA,aAUA;AACA,gCACE,CAAC,CAAC,cAAc,oBAChB;AAEF,SAAO,wDACL,eACA;AAAA;AAsBG,yBACL,QACM;AACN,QAAM,CAAE,SAAU,mCAEhB,OAAO,cACP;AAAA,IACE,WAAW,OAAO;AAAA,IAClB,oBAAoB,CAAC,CAAE,sBAAuB;AAG5C,oCACE,CAAC,iBAAiB,OAClB;AAEF,UAAI,iBAAiB,QAAQ,OAAO,QAAQ;AAC1C,eAAO,OAAO,iBAAiB;AAAA;AAAA;AAAA;AAKvC,MAAI,OAAO;AACT,QAAI,OAAO,SAAS;AAClB,aAAO,QAAQ;AAAA,WACV;AACL,cAAQ,KACN,qDAAqD,MAAM;AAAA;AAAA;AAAA;AAqB5D,qBACL,UAC+C;AAC/C,QAAM,CAAC,eAAe,CAAE,SAAS,oBAAqB,+BAEpD;AAGF,SAAO;AAAA,IACL,CAAO,YAAyD;AAC9D,YAAM,eAAe,MAAM,cAAc;AAAA,QACvC,WAAW,QAAQ,aAAa;AAAA,QAChC,oBAAoB,QAAQ;AAAA;AAE9B,UAAI,aAAa,QAAQ;AACvB,eAAO;AAAA,UACL,QAAQ,MAAM,KAAK,OAAO,OAAO,aAAa;AAAA,UAC9C,MAAM,aAAa;AAAA;AAAA;AAGvB,aAAO;AAAA,QACL,MAAM,aAAa;AAAA;AAAA;AAAA,IAGvB;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/lib/hooks.mjs
CHANGED
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
useCompiledFragment,
|
|
48
48
|
useCompiledRefetchableFragment,
|
|
49
49
|
useCompiledPaginationFragment
|
|
50
|
-
} from "./storeObservation/compiledHooks.mjs";
|
|
50
|
+
} from "./storeObservation/compiledHooks/index.mjs";
|
|
51
51
|
import {convertFetchPolicy} from "./convertFetchPolicy.mjs";
|
|
52
52
|
function useLazyLoadQuery(query, variables, options) {
|
|
53
53
|
const apolloOptions = options && __objSpread(__objSpread({}, options), {
|
package/lib/hooks.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/hooks.ts"],
|
|
4
|
-
"sourcesContent": ["import { DocumentNode } from \"graphql\";\nimport invariant from \"invariant\";\nimport {\n useSubscription as useApolloSubscription,\n useQuery as useApolloQuery,\n useMutation as useApolloMutation,\n} from \"@apollo/client\";\n\nimport {\n FetchPolicy,\n GraphQLTaggedNode,\n KeyType,\n KeyTypeData,\n OperationType,\n} from \"./types\";\nimport {\n RefetchFn,\n PaginationFn,\n useCompiledLazyLoadQuery,\n useCompiledFragment,\n useCompiledRefetchableFragment,\n useCompiledPaginationFragment,\n} from \"./storeObservation/compiledHooks\";\nimport { convertFetchPolicy } from \"./convertFetchPolicy\";\n\n/**\n * Executes a GraphQL query.\n *\n * This hook is called 'lazy' as it is used to fetch a GraphQL query _during_ render. This hook can trigger multiple\n * round trips, one for loading and one for resolving.\n *\n * @see {useFragment} This function largely follows the documentation of `useFragment`, except that this is a root of a\n * GraphQL operation and thus does not take in any props such as opaque fragment references.\n *\n * @example\n ```typescript\n import { graphql, useLazyLoadQuery } from \"@nova-facade/react-graphql\";\n import { SomeReactComponent, fragment as SomeReactComponent_someGraphQLType } from \"./SomeReactComponent\";\n import { SomeRootReactComponentQuery } from \"./__generated__/SomeRootReactComponentQuery.graphql\";\n\n const query = graphql`\n query SomeRootReactComponentQuery {\n someGraphQLType {\n ...SomeReactComponent_someGraphQLType\n }\n }\n ${SomeReactComponent_someGraphQLType}\n `;\n\n export const SomeRootReactComponent: React.FC = () => {\n const result = useLazyLoadQuery<SomeRootReactComponentQuery>(query);\n if (result.error) {\n throw result.error;\n } else if (!result.data) {\n // Loading\n return null;\n }\n\n return (\n <SomeReactComponent someGraphQLType={result.data.someGraphQLType} />\n );\n };\n ```\n *\n * @param query The query operation to perform.\n * @param variables Object containing the variable values to fetch the query. These variables need to match GraphQL\n * variables declared inside the query.\n * @param options Options passed on to the underlying implementation.\n * @returns An object with either an error, the result data, or neither while loading.\n */\nexport function useLazyLoadQuery<TQuery extends OperationType>(\n query: GraphQLTaggedNode,\n variables: TQuery[\"variables\"],\n options?: { fetchPolicy?: FetchPolicy }\n): { error?: Error; data?: TQuery[\"response\"] } {\n const apolloOptions = options && {\n ...options,\n fetchPolicy: convertFetchPolicy(options.fetchPolicy),\n };\n if (query.watchQueryDocument) {\n return useCompiledLazyLoadQuery(query as any, {\n variables,\n ...apolloOptions,\n });\n } else {\n return useApolloQuery(query, { variables, ...apolloOptions });\n }\n}\n\n/**\n * A first-class way for an individual component to express its direct data requirements using GraphQL. The fragment\n * should select all the fields that the component directly uses in its rendering or needs to pass to external\n * functions. It should *not* select data that its children need, unless those children are intended to remain their\n * pure React props as data inputs.\n *\n * For children that *do* have their own data requirements expressed using GraphQL, the fragment should ensure to\n * spread in the child's fragment.\n *\n * For each fragment defined using the `graphql` tagged template function, the Nova graphql-compiler will emit\n * TypeScript typings that correspond to the selected fields and referenced child component fragments. These typings\n * live in files in the sibling `./__generated__/` directory and are called after the fragment name. The compiler will\n * enforce some constraints about the fragment name, such that it starts with the name of the file it is defined in\n * (i.e. the name of the component) and ends with the name of the fragment reference prop that this component takes in\n * (which typically will be named after the GraphQL type that the fragment is defined on).\n *\n * The typing that has a `$key` suffix is meant to be used for the opaque fragment reference prop, whereas the typing\n * without a suffix describes the actual data and is only meant for usage internally to the file. When the opaque\n * fragment reference prop is passed to a `useFragment` call, the returned data will be unmasked and be typed according\n * to the typing without a suffix. As such, the unmasked typing is only ever needed when extracting pieces of the\n * component to the file scope. For functions extracted to different files, however, you should type those separately\n * and *not* use the emitted typings.\n *\n * @example\n ```typescript\n import { graphql, useFragment } from \"@nova-facade/react-graphql\";\n import { SomeChildReactComponent, fragment as SomeChildReactComponent_someGraphQLType } from \"./SomeChildReactComponent\";\n import { SomeReactComponent_someGraphQLType$key } from \"./__generated__/SomeReactComponent_someGraphQLType.graphql\";\n\n export const fragment = graphql`\n fragment SomeReactComponent_someGraphQLType on SomeGraphQLType {\n someDataThatThisComponentNeeds\n ...SomeChildReactComponent_someGraphQLType\n }\n ${SomeChildReactComponent_someGraphQLType}\n `;\n\n export interface SomeReactComponentProps {\n someGraphQLType: SomeReactComponent_someGraphQLType$key;\n }\n\n export const SomeReactComponent: React.FunctionComponent<SomeReactComponentProps> = props => {\n const someGraphQLType = useFragment(fragment, props.someGraphQLType);\n return (\n <div>\n <span>{someGraphQLType.someDataThatThisComponentNeeds}</span>\n <SomeChildReactComponent someGraphQLType={someGraphQLType} />\n </div>\n );\n }\n ```\n *\n * @note For now, the fragment objects should be exported such that parent's can interpolate them into their own\n * GraphQL documents. This may change in the future when/if we entirely switch to static compilation and will\n * allow us to also move the usage of the graphql tagged template function inline at the `useFragment` call-site.\n *\n * @todo 1613321: Connect useFragment hooks directly to a GraphQL client store for targeted updates. Currently the data\n * is simply unmasked at compile-time but otherwise passed through from the parent at run-time.\n *\n * @param _fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections.\n */\nexport function useFragment<TKey extends KeyType>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): KeyTypeData<TKey> {\n if (fragmentInput.watchQueryDocument) {\n return useCompiledFragment(fragmentInput, fragmentRef as any);\n } else {\n return fragmentRef as unknown;\n }\n}\n\nexport function useRefetchableFragment<\n TQuery extends OperationType,\n TKey extends KeyType\n>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): [data: KeyTypeData<TKey>, refetch: RefetchFn<TQuery[\"variables\"]>] {\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"useRefetchableFragment is only supported at this time when using compilation\"\n );\n return useCompiledRefetchableFragment(\n fragmentInput as any,\n fragmentRef as any\n );\n}\n\nexport function usePaginationFragment<\n TQuery extends OperationType,\n TKey extends KeyType\n>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): {\n data: KeyTypeData<TKey>;\n loadNext: PaginationFn;\n loadPrevious: PaginationFn;\n hasNext: boolean;\n hasPrevious: boolean;\n isLoadingNext: boolean;\n isLoadingPrevious: boolean;\n refetch: RefetchFn<TQuery[\"variables\"]>;\n} {\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"usePaginationFragment is only supported at this time when using compilation\"\n );\n return useCompiledPaginationFragment(\n fragmentInput as any,\n fragmentRef as any\n );\n}\n\n// https://github.com/facebook/relay/blob/master/website/docs/api-reference/types/GraphQLSubscriptionConfig.md\ninterface GraphQLSubscriptionConfig<\n TSubscriptionPayload extends OperationType\n> {\n subscription: GraphQLTaggedNode;\n variables: TSubscriptionPayload[\"variables\"];\n /**\n * Should response be nullable?\n */\n onNext?: (response: TSubscriptionPayload[\"response\"]) => void;\n onError?: (error: Error) => void;\n}\n\nexport function useSubscription<TSubscriptionPayload extends OperationType>(\n config: GraphQLSubscriptionConfig<TSubscriptionPayload>\n): void {\n const { error } = useApolloSubscription(\n // TODO: Right now we don't replace mutation documents with imported artefacts.\n config.subscription as DocumentNode,\n {\n variables: config.variables,\n onSubscriptionData: ({ subscriptionData }) => {\n // Supposedly this never gets triggered for an error by design:\n // https://github.com/apollographql/react-apollo/issues/3177#issuecomment-506758144\n invariant(\n !subscriptionData.error,\n \"Did not expect to receive an error here\"\n );\n if (subscriptionData.data && config.onNext) {\n config.onNext(subscriptionData.data);\n }\n },\n }\n );\n if (error) {\n if (config.onError) {\n config.onError(error);\n } else {\n console.warn(\n `An unhandled GraphQL subscription error occurred: ${error.message}`\n );\n }\n }\n}\n\ninterface IMutationCommitterOptions<TMutationPayload extends OperationType> {\n variables: TMutationPayload[\"variables\"];\n optimisticResponse?: Partial<TMutationPayload[\"response\"]> | null;\n}\n\ntype MutationCommiter<TMutationPayload extends OperationType> = (\n options: IMutationCommitterOptions<TMutationPayload>\n) => Promise<{ errors?: Error[]; data?: TMutationPayload[\"response\"] }>;\n\n/**\n * Declare use of a mutation within component. Returns an array of a function and loading state boolean.\n *\n * Returned function can be called to perform the actual mutation with provided variables.\n *\n * @param mutation Mutation document\n * @returns [commitMutationFn, isInFlight]\n *\n * commitMutationFn\n * @param options.variables map of variables to pass to mutation\n * @param options.optimisticResponse proposed response to apply to the store while mutation is in flight\n * @returns A Promise to an object with either errors or/and the result data\n * \n * Example\n ```\n\n const mutation = graphql`\n mutation SomeReactComponentMutation($newName: String!) {\n someMutation(newName: $newName) {\n __typeName\n id\n newName\n }\n }\n `\n\n export const SomeReactComponent: React.FunctionComponent<SomeReactComponentProps> = props => {\n const [commitMutation, isInFlight] = useMutation(mutation);\n return (\n <div>\n <button onClick={() => commitMutation({\n variables: {\n newName: \"foo\"\n },\n optimisticResponse: {\n someMutation: {\n __typename: \"SomeMutationPayload\",\n id: \"1\",\n newName: \"foo\",\n }\n }\n })} disabled={isInFlight}/>\n </div>\n );\n }\n ```\n */\nexport function useMutation<TMutationPayload extends OperationType>(\n mutation: GraphQLTaggedNode\n): [MutationCommiter<TMutationPayload>, boolean] {\n const [apolloUpdater, { loading: mutationLoading }] = useApolloMutation(\n // TODO: Right now we don't replace mutation documents with imported artefacts.\n mutation as DocumentNode\n );\n\n return [\n async (options: IMutationCommitterOptions<TMutationPayload>) => {\n const apolloResult = await apolloUpdater({\n variables: options.variables || {},\n optimisticResponse: options.optimisticResponse,\n });\n if (apolloResult.errors) {\n return {\n errors: Array.from(Object.values(apolloResult.errors)),\n data: apolloResult.data,\n };\n }\n return {\n data: apolloResult.data,\n };\n },\n mutationLoading,\n ];\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAaA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;
|
|
4
|
+
"sourcesContent": ["import { DocumentNode } from \"graphql\";\nimport invariant from \"invariant\";\nimport {\n useSubscription as useApolloSubscription,\n useQuery as useApolloQuery,\n useMutation as useApolloMutation,\n} from \"@apollo/client\";\n\nimport {\n FetchPolicy,\n GraphQLTaggedNode,\n KeyType,\n KeyTypeData,\n OperationType,\n} from \"./types\";\nimport {\n RefetchFn,\n PaginationFn,\n useCompiledLazyLoadQuery,\n useCompiledFragment,\n useCompiledRefetchableFragment,\n useCompiledPaginationFragment,\n} from \"./storeObservation/compiledHooks\";\nimport { convertFetchPolicy } from \"./convertFetchPolicy\";\n\n/**\n * Executes a GraphQL query.\n *\n * This hook is called 'lazy' as it is used to fetch a GraphQL query _during_ render. This hook can trigger multiple\n * round trips, one for loading and one for resolving.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-lazy-load-query}\n *\n * @param query The query operation to perform.\n * @param variables Object containing the variable values to fetch the query. These variables need to match GraphQL\n * variables declared inside the query.\n * @param options Options passed on to the underlying implementation.\n * @returns An object with either an error, the result data, or neither while loading.\n */\nexport function useLazyLoadQuery<TQuery extends OperationType>(\n query: GraphQLTaggedNode,\n variables: TQuery[\"variables\"],\n options?: { fetchPolicy?: FetchPolicy }\n): { error?: Error; data?: TQuery[\"response\"] } {\n const apolloOptions = options && {\n ...options,\n fetchPolicy: convertFetchPolicy(options.fetchPolicy),\n };\n if (query.watchQueryDocument) {\n return useCompiledLazyLoadQuery(query as any, {\n variables,\n ...apolloOptions,\n });\n } else {\n return useApolloQuery(query, { variables, ...apolloOptions });\n }\n}\n\n/**\n * A first-class way for an individual component to express its direct data requirements using GraphQL. The fragment\n * should select all the fields that the component directly uses in its rendering or needs to pass to external\n * functions. It should *not* select data that its children need, unless those children are intended to remain their\n * pure React props as data inputs.\n *\n * For children that *do* have their own data requirements expressed using GraphQL, the fragment should ensure to\n * spread in the child's fragment.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-fragment}\n *\n * @note For now, the fragment objects should be exported such that parent's can interpolate them into their own\n * GraphQL documents. This may change in the future when/if we entirely switch to static compilation and will\n * allow us to also move the usage of the graphql tagged template function inline at the `useFragment` call-site.\n *\n * @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections.\n */\nexport function useFragment<TKey extends KeyType>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): KeyTypeData<TKey> {\n if (fragmentInput.watchQueryDocument) {\n return useCompiledFragment(fragmentInput, fragmentRef as any);\n } else {\n return fragmentRef as unknown;\n }\n}\n\n/**\n * Equivalent to `useFragment`, but allows refetching of its subtree of the overall query.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-refetchable-fragment}\n *\n * @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections and a function to perform the refetch.\n */\nexport function useRefetchableFragment<\n TQuery extends OperationType,\n TKey extends KeyType\n>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): [data: KeyTypeData<TKey>, refetch: RefetchFn<TQuery[\"variables\"]>] {\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"useRefetchableFragment is only supported at this time when using compilation\"\n );\n return useCompiledRefetchableFragment(\n fragmentInput as any,\n fragmentRef as any\n );\n}\n\n/**\n * Equivalent to `useFragment`, but allows pagination of its subtree of the overall query.\n *\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-pagination-fragment}\n *\n * @param fragmentInput The GraphQL fragment document created using the `graphql` tagged template function.\n * @param fragmentRef The opaque fragment reference passed in by a parent component that has spread in this component's\n * fragment.\n * @returns The data corresponding to the field selections and functions to deal with pagination.\n */\nexport function usePaginationFragment<\n TQuery extends OperationType,\n TKey extends KeyType\n>(\n fragmentInput: GraphQLTaggedNode,\n fragmentRef: TKey\n): {\n data: KeyTypeData<TKey>;\n loadNext: PaginationFn;\n loadPrevious: PaginationFn;\n hasNext: boolean;\n hasPrevious: boolean;\n isLoadingNext: boolean;\n isLoadingPrevious: boolean;\n refetch: RefetchFn<TQuery[\"variables\"]>;\n} {\n invariant(\n !!fragmentInput.watchQueryDocument,\n \"usePaginationFragment is only supported at this time when using compilation\"\n );\n return useCompiledPaginationFragment(\n fragmentInput as any,\n fragmentRef as any\n );\n}\n\n// https://github.com/facebook/relay/blob/master/website/docs/api-reference/types/GraphQLSubscriptionConfig.md\ninterface GraphQLSubscriptionConfig<\n TSubscriptionPayload extends OperationType\n> {\n subscription: GraphQLTaggedNode;\n variables: TSubscriptionPayload[\"variables\"];\n /**\n * Should response be nullable?\n */\n onNext?: (response: TSubscriptionPayload[\"response\"]) => void;\n onError?: (error: Error) => void;\n}\n\n/**\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-subscription}\n *\n * @param config\n */\nexport function useSubscription<TSubscriptionPayload extends OperationType>(\n config: GraphQLSubscriptionConfig<TSubscriptionPayload>\n): void {\n const { error } = useApolloSubscription(\n // TODO: Right now we don't replace mutation documents with imported artefacts.\n config.subscription as DocumentNode,\n {\n variables: config.variables,\n onSubscriptionData: ({ subscriptionData }) => {\n // Supposedly this never gets triggered for an error by design:\n // https://github.com/apollographql/react-apollo/issues/3177#issuecomment-506758144\n invariant(\n !subscriptionData.error,\n \"Did not expect to receive an error here\"\n );\n if (subscriptionData.data && config.onNext) {\n config.onNext(subscriptionData.data);\n }\n },\n }\n );\n if (error) {\n if (config.onError) {\n config.onError(error);\n } else {\n console.warn(\n `An unhandled GraphQL subscription error occurred: ${error.message}`\n );\n }\n }\n}\n\ninterface IMutationCommitterOptions<TMutationPayload extends OperationType> {\n variables: TMutationPayload[\"variables\"];\n optimisticResponse?: Partial<TMutationPayload[\"response\"]> | null;\n}\n\ntype MutationCommiter<TMutationPayload extends OperationType> = (\n options: IMutationCommitterOptions<TMutationPayload>\n) => Promise<{ errors?: Error[]; data?: TMutationPayload[\"response\"] }>;\n\n/**\n * @see {@link https://microsoft.github.io/graphitation/docs/apollo-react-relay-duct-tape/use-mutation}\n *\n * @param mutation\n * @returns\n */\nexport function useMutation<TMutationPayload extends OperationType>(\n mutation: GraphQLTaggedNode\n): [MutationCommiter<TMutationPayload>, boolean] {\n const [apolloUpdater, { loading: mutationLoading }] = useApolloMutation(\n // TODO: Right now we don't replace mutation documents with imported artefacts.\n mutation as DocumentNode\n );\n\n return [\n async (options: IMutationCommitterOptions<TMutationPayload>) => {\n const apolloResult = await apolloUpdater({\n variables: options.variables || {},\n optimisticResponse: options.optimisticResponse,\n });\n if (apolloResult.errors) {\n return {\n errors: Array.from(Object.values(apolloResult.errors)),\n data: apolloResult.data,\n };\n }\n return {\n data: apolloResult.data,\n };\n },\n mutationLoading,\n ];\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAaA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAgBO,0BACL,OACA,WACA,SAC8C;AAC9C,QAAM,gBAAgB,WAAW,4BAC5B,UAD4B;AAAA,IAE/B,aAAa,mBAAmB,QAAQ;AAAA;AAE1C,MAAI,MAAM,oBAAoB;AAC5B,WAAO,yBAAyB,OAAc;AAAA,MAC5C;AAAA,OACG;AAAA,SAEA;AACL,WAAO,eAAe,OAAO,aAAE,YAAc;AAAA;AAAA;AAwB1C,qBACL,eACA,aACmB;AACnB,MAAI,cAAc,oBAAoB;AACpC,WAAO,oBAAoB,eAAe;AAAA,SACrC;AACL,WAAO;AAAA;AAAA;AAcJ,gCAIL,eACA,aACoE;AACpE,YACE,CAAC,CAAC,cAAc,oBAChB;AAEF,SAAO,+BACL,eACA;AAAA;AAcG,+BAIL,eACA,aAUA;AACA,YACE,CAAC,CAAC,cAAc,oBAChB;AAEF,SAAO,8BACL,eACA;AAAA;AAsBG,yBACL,QACM;AACN,QAAM,CAAE,SAAU,sBAEhB,OAAO,cACP;AAAA,IACE,WAAW,OAAO;AAAA,IAClB,oBAAoB,CAAC,CAAE,sBAAuB;AAG5C,gBACE,CAAC,iBAAiB,OAClB;AAEF,UAAI,iBAAiB,QAAQ,OAAO,QAAQ;AAC1C,eAAO,OAAO,iBAAiB;AAAA;AAAA;AAAA;AAKvC,MAAI,OAAO;AACT,QAAI,OAAO,SAAS;AAClB,aAAO,QAAQ;AAAA,WACV;AACL,cAAQ,KACN,qDAAqD,MAAM;AAAA;AAAA;AAAA;AAqB5D,qBACL,UAC+C;AAC/C,QAAM,CAAC,eAAe,CAAE,SAAS,oBAAqB,kBAEpD;AAGF,SAAO;AAAA,IACL,CAAO,YAAyD;AAC9D,YAAM,eAAe,MAAM,cAAc;AAAA,QACvC,WAAW,QAAQ,aAAa;AAAA,QAChC,oBAAoB,QAAQ;AAAA;AAE9B,UAAI,aAAa,QAAQ;AACvB,eAAO;AAAA,UACL,QAAQ,MAAM,KAAK,OAAO,OAAO,aAAa;AAAA,UAC9C,MAAM,aAAa;AAAA;AAAA;AAGvB,aAAO;AAAA,QACL,MAAM,aAAa;AAAA;AAAA;AAAA,IAGvB;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/lib/index.mjs
CHANGED
package/lib/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment.graphql.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare type compiledHooks_BackwardPaginationFragment = {
|
|
|
12
12
|
};
|
|
13
13
|
export declare type compiledHooks_BackwardPaginationFragment$data = compiledHooks_BackwardPaginationFragment;
|
|
14
14
|
export declare type compiledHooks_BackwardPaginationFragment$key = {
|
|
15
|
-
readonly " $data"?: compiledHooks_BackwardPaginationFragment$data;
|
|
15
|
+
readonly " $data"?: compiledHooks_BackwardPaginationFragment$data | undefined;
|
|
16
16
|
readonly " $fragmentRefs": FragmentRefs<"compiledHooks_BackwardPaginationFragment">;
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=compiledHooks_BackwardPaginationFragment.graphql.d.ts.map
|
package/lib/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment.graphql.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiledHooks_BackwardPaginationFragment.graphql.d.ts","sourceRoot":"","sources":["../../../src/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment.graphql.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,oBAAY,wCAAwC,GAAG;IACnD,QAAQ,CAAC,QAAQ,EAAE;QACf,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;YAC1B,QAAQ,CAAC,IAAI,EAAE;gBACX,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;aACzB,CAAC;SACL,CAAC,CAAC;KACN,CAAC;IACF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,0CAA0C,CAAC;CACpE,CAAC;AACF,oBAAY,6CAA6C,GAAG,wCAAwC,CAAC;AACrG,oBAAY,4CAA4C,GAAG;IACvD,QAAQ,CAAC,QAAQ,CAAC,EAAE,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"compiledHooks_BackwardPaginationFragment.graphql.d.ts","sourceRoot":"","sources":["../../../src/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment.graphql.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,oBAAY,wCAAwC,GAAG;IACnD,QAAQ,CAAC,QAAQ,EAAE;QACf,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;YAC1B,QAAQ,CAAC,IAAI,EAAE;gBACX,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;aACzB,CAAC;SACL,CAAC,CAAC;KACN,CAAC;IACF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,0CAA0C,CAAC;CACpE,CAAC;AACF,oBAAY,6CAA6C,GAAG,wCAAwC,CAAC;AACrG,oBAAY,4CAA4C,GAAG;IACvD,QAAQ,CAAC,QAAQ,CAAC,EAAE,6CAA6C,GAAG,SAAS,CAAC;IAC9E,QAAQ,CAAC,gBAAgB,EAAE,YAAY,CAAC,0CAA0C,CAAC,CAAC;CACvF,CAAC"}
|
package/lib/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment.graphql.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/storeObservation/__generated__/compiledHooks_BackwardPaginationFragment.graphql.ts"],
|
|
4
|
-
"sourcesContent": ["/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n;\n\nimport { FragmentRefs } from \"@graphitation/apollo-react-relay-duct-tape\";\nexport type compiledHooks_BackwardPaginationFragment = {\n readonly messages: {\n readonly edges: ReadonlyArray<{\n readonly node: {\n readonly text: string;\n };\n }>;\n };\n readonly id: string;\n readonly \" $refType\": \"compiledHooks_BackwardPaginationFragment\";\n};\nexport type compiledHooks_BackwardPaginationFragment$data = compiledHooks_BackwardPaginationFragment;\nexport type compiledHooks_BackwardPaginationFragment$key = {\n readonly \" $data\"?: compiledHooks_BackwardPaginationFragment$data;\n readonly \" $fragmentRefs\": FragmentRefs<\"compiledHooks_BackwardPaginationFragment\">;\n};\n"],
|
|
4
|
+
"sourcesContent": ["/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n;\n\nimport { FragmentRefs } from \"@graphitation/apollo-react-relay-duct-tape\";\nexport type compiledHooks_BackwardPaginationFragment = {\n readonly messages: {\n readonly edges: ReadonlyArray<{\n readonly node: {\n readonly text: string;\n };\n }>;\n };\n readonly id: string;\n readonly \" $refType\": \"compiledHooks_BackwardPaginationFragment\";\n};\nexport type compiledHooks_BackwardPaginationFragment$data = compiledHooks_BackwardPaginationFragment;\nexport type compiledHooks_BackwardPaginationFragment$key = {\n readonly \" $data\"?: compiledHooks_BackwardPaginationFragment$data | undefined;\n readonly \" $fragmentRefs\": FragmentRefs<\"compiledHooks_BackwardPaginationFragment\">;\n};\n"],
|
|
5
5
|
"mappings": ";;AAAA;AAGA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -5,7 +5,7 @@ export declare type compiledHooks_ChildFragment = {
|
|
|
5
5
|
};
|
|
6
6
|
export declare type compiledHooks_ChildFragment$data = compiledHooks_ChildFragment;
|
|
7
7
|
export declare type compiledHooks_ChildFragment$key = {
|
|
8
|
-
readonly " $data"?: compiledHooks_ChildFragment$data;
|
|
8
|
+
readonly " $data"?: compiledHooks_ChildFragment$data | undefined;
|
|
9
9
|
readonly " $fragmentRefs": FragmentRefs<"compiledHooks_ChildFragment">;
|
|
10
10
|
};
|
|
11
11
|
//# sourceMappingURL=compiledHooks_ChildFragment.graphql.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiledHooks_ChildFragment.graphql.d.ts","sourceRoot":"","sources":["../../../src/storeObservation/__generated__/compiledHooks_ChildFragment.graphql.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,oBAAY,2BAA2B,GAAG;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,6BAA6B,CAAC;CACvD,CAAC;AACF,oBAAY,gCAAgC,GAAG,2BAA2B,CAAC;AAC3E,oBAAY,+BAA+B,GAAG;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"compiledHooks_ChildFragment.graphql.d.ts","sourceRoot":"","sources":["../../../src/storeObservation/__generated__/compiledHooks_ChildFragment.graphql.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,oBAAY,2BAA2B,GAAG;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,6BAA6B,CAAC;CACvD,CAAC;AACF,oBAAY,gCAAgC,GAAG,2BAA2B,CAAC;AAC3E,oBAAY,+BAA+B,GAAG;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,gCAAgC,GAAG,SAAS,CAAC;IACjE,QAAQ,CAAC,gBAAgB,EAAE,YAAY,CAAC,6BAA6B,CAAC,CAAC;CAC1E,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/storeObservation/__generated__/compiledHooks_ChildFragment.graphql.ts"],
|
|
4
|
-
"sourcesContent": ["/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n;\n\nimport { FragmentRefs } from \"@graphitation/apollo-react-relay-duct-tape\";\nexport type compiledHooks_ChildFragment = {\n readonly petName: string;\n readonly \" $refType\": \"compiledHooks_ChildFragment\";\n};\nexport type compiledHooks_ChildFragment$data = compiledHooks_ChildFragment;\nexport type compiledHooks_ChildFragment$key = {\n readonly \" $data\"?: compiledHooks_ChildFragment$data;\n readonly \" $fragmentRefs\": FragmentRefs<\"compiledHooks_ChildFragment\">;\n};\n"],
|
|
4
|
+
"sourcesContent": ["/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n;\n\nimport { FragmentRefs } from \"@graphitation/apollo-react-relay-duct-tape\";\nexport type compiledHooks_ChildFragment = {\n readonly petName: string;\n readonly \" $refType\": \"compiledHooks_ChildFragment\";\n};\nexport type compiledHooks_ChildFragment$data = compiledHooks_ChildFragment;\nexport type compiledHooks_ChildFragment$key = {\n readonly \" $data\"?: compiledHooks_ChildFragment$data | undefined;\n readonly \" $fragmentRefs\": FragmentRefs<\"compiledHooks_ChildFragment\">;\n};\n"],
|
|
5
5
|
"mappings": ";;AAAA;AAGA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/lib/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment.graphql.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare type compiledHooks_ForwardPaginationFragment = {
|
|
|
15
15
|
};
|
|
16
16
|
export declare type compiledHooks_ForwardPaginationFragment$data = compiledHooks_ForwardPaginationFragment;
|
|
17
17
|
export declare type compiledHooks_ForwardPaginationFragment$key = {
|
|
18
|
-
readonly " $data"?: compiledHooks_ForwardPaginationFragment$data;
|
|
18
|
+
readonly " $data"?: compiledHooks_ForwardPaginationFragment$data | undefined;
|
|
19
19
|
readonly " $fragmentRefs": FragmentRefs<"compiledHooks_ForwardPaginationFragment">;
|
|
20
20
|
};
|
|
21
21
|
//# sourceMappingURL=compiledHooks_ForwardPaginationFragment.graphql.d.ts.map
|
package/lib/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment.graphql.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiledHooks_ForwardPaginationFragment.graphql.d.ts","sourceRoot":"","sources":["../../../src/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment.graphql.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,oBAAY,uCAAuC,GAAG;IAClD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE;QACpB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;YAC1B,QAAQ,CAAC,IAAI,EAAE;gBACX,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;gBACvB,QAAQ,CAAC,gBAAgB,EAAE,YAAY,CAAC,0CAA0C,CAAC,CAAC;aACvF,CAAC;SACL,CAAC,CAAC;KACN,CAAC;IACF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,yCAAyC,CAAC;CACnE,CAAC;AACF,oBAAY,4CAA4C,GAAG,uCAAuC,CAAC;AACnG,oBAAY,2CAA2C,GAAG;IACtD,QAAQ,CAAC,QAAQ,CAAC,EAAE,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"compiledHooks_ForwardPaginationFragment.graphql.d.ts","sourceRoot":"","sources":["../../../src/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment.graphql.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,oBAAY,uCAAuC,GAAG;IAClD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE;QACpB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;YAC1B,QAAQ,CAAC,IAAI,EAAE;gBACX,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;gBACvB,QAAQ,CAAC,gBAAgB,EAAE,YAAY,CAAC,0CAA0C,CAAC,CAAC;aACvF,CAAC;SACL,CAAC,CAAC;KACN,CAAC;IACF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,yCAAyC,CAAC;CACnE,CAAC;AACF,oBAAY,4CAA4C,GAAG,uCAAuC,CAAC;AACnG,oBAAY,2CAA2C,GAAG;IACtD,QAAQ,CAAC,QAAQ,CAAC,EAAE,4CAA4C,GAAG,SAAS,CAAC;IAC7E,QAAQ,CAAC,gBAAgB,EAAE,YAAY,CAAC,yCAAyC,CAAC,CAAC;CACtF,CAAC"}
|
package/lib/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment.graphql.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/storeObservation/__generated__/compiledHooks_ForwardPaginationFragment.graphql.ts"],
|
|
4
|
-
"sourcesContent": ["/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n;\n\nimport { FragmentRefs } from \"@graphitation/apollo-react-relay-duct-tape\";\nexport type compiledHooks_ForwardPaginationFragment = {\n readonly petName: string;\n readonly avatarUrl: string;\n readonly conversations: {\n readonly edges: ReadonlyArray<{\n readonly node: {\n readonly title: string;\n readonly \" $fragmentRefs\": FragmentRefs<\"compiledHooks_BackwardPaginationFragment\">;\n };\n }>;\n };\n readonly id: string;\n readonly \" $refType\": \"compiledHooks_ForwardPaginationFragment\";\n};\nexport type compiledHooks_ForwardPaginationFragment$data = compiledHooks_ForwardPaginationFragment;\nexport type compiledHooks_ForwardPaginationFragment$key = {\n readonly \" $data\"?: compiledHooks_ForwardPaginationFragment$data;\n readonly \" $fragmentRefs\": FragmentRefs<\"compiledHooks_ForwardPaginationFragment\">;\n};\n"],
|
|
4
|
+
"sourcesContent": ["/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n;\n\nimport { FragmentRefs } from \"@graphitation/apollo-react-relay-duct-tape\";\nexport type compiledHooks_ForwardPaginationFragment = {\n readonly petName: string;\n readonly avatarUrl: string;\n readonly conversations: {\n readonly edges: ReadonlyArray<{\n readonly node: {\n readonly title: string;\n readonly \" $fragmentRefs\": FragmentRefs<\"compiledHooks_BackwardPaginationFragment\">;\n };\n }>;\n };\n readonly id: string;\n readonly \" $refType\": \"compiledHooks_ForwardPaginationFragment\";\n};\nexport type compiledHooks_ForwardPaginationFragment$data = compiledHooks_ForwardPaginationFragment;\nexport type compiledHooks_ForwardPaginationFragment$key = {\n readonly \" $data\"?: compiledHooks_ForwardPaginationFragment$data | undefined;\n readonly \" $fragmentRefs\": FragmentRefs<\"compiledHooks_ForwardPaginationFragment\">;\n};\n"],
|
|
5
5
|
"mappings": ";;AAAA;AAGA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -7,7 +7,7 @@ export declare type compiledHooks_QueryTypeFragment = {
|
|
|
7
7
|
};
|
|
8
8
|
export declare type compiledHooks_QueryTypeFragment$data = compiledHooks_QueryTypeFragment;
|
|
9
9
|
export declare type compiledHooks_QueryTypeFragment$key = {
|
|
10
|
-
readonly " $data"?: compiledHooks_QueryTypeFragment$data;
|
|
10
|
+
readonly " $data"?: compiledHooks_QueryTypeFragment$data | undefined;
|
|
11
11
|
readonly " $fragmentRefs": FragmentRefs<"compiledHooks_QueryTypeFragment">;
|
|
12
12
|
};
|
|
13
13
|
//# sourceMappingURL=compiledHooks_QueryTypeFragment.graphql.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiledHooks_QueryTypeFragment.graphql.d.ts","sourceRoot":"","sources":["../../../src/storeObservation/__generated__/compiledHooks_QueryTypeFragment.graphql.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,oBAAY,+BAA+B,GAAG;IAC1C,QAAQ,CAAC,OAAO,EAAE;QACd,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;KAC9B,CAAC;IACF,QAAQ,CAAC,WAAW,EAAE,iCAAiC,CAAC;CAC3D,CAAC;AACF,oBAAY,oCAAoC,GAAG,+BAA+B,CAAC;AACnF,oBAAY,mCAAmC,GAAG;IAC9C,QAAQ,CAAC,QAAQ,CAAC,EAAE,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"compiledHooks_QueryTypeFragment.graphql.d.ts","sourceRoot":"","sources":["../../../src/storeObservation/__generated__/compiledHooks_QueryTypeFragment.graphql.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,oBAAY,+BAA+B,GAAG;IAC1C,QAAQ,CAAC,OAAO,EAAE;QACd,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;KAC9B,CAAC;IACF,QAAQ,CAAC,WAAW,EAAE,iCAAiC,CAAC;CAC3D,CAAC;AACF,oBAAY,oCAAoC,GAAG,+BAA+B,CAAC;AACnF,oBAAY,mCAAmC,GAAG;IAC9C,QAAQ,CAAC,QAAQ,CAAC,EAAE,oCAAoC,GAAG,SAAS,CAAC;IACrE,QAAQ,CAAC,gBAAgB,EAAE,YAAY,CAAC,iCAAiC,CAAC,CAAC;CAC9E,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/storeObservation/__generated__/compiledHooks_QueryTypeFragment.graphql.ts"],
|
|
4
|
-
"sourcesContent": ["/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n;\n\nimport { FragmentRefs } from \"@graphitation/apollo-react-relay-duct-tape\";\nexport type compiledHooks_QueryTypeFragment = {\n readonly nonNode: {\n readonly id: string | null;\n };\n readonly \" $refType\": \"compiledHooks_QueryTypeFragment\";\n};\nexport type compiledHooks_QueryTypeFragment$data = compiledHooks_QueryTypeFragment;\nexport type compiledHooks_QueryTypeFragment$key = {\n readonly \" $data\"?: compiledHooks_QueryTypeFragment$data;\n readonly \" $fragmentRefs\": FragmentRefs<\"compiledHooks_QueryTypeFragment\">;\n};\n"],
|
|
4
|
+
"sourcesContent": ["/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n;\n\nimport { FragmentRefs } from \"@graphitation/apollo-react-relay-duct-tape\";\nexport type compiledHooks_QueryTypeFragment = {\n readonly nonNode: {\n readonly id: string | null;\n };\n readonly \" $refType\": \"compiledHooks_QueryTypeFragment\";\n};\nexport type compiledHooks_QueryTypeFragment$data = compiledHooks_QueryTypeFragment;\nexport type compiledHooks_QueryTypeFragment$key = {\n readonly \" $data\"?: compiledHooks_QueryTypeFragment$data | undefined;\n readonly \" $fragmentRefs\": FragmentRefs<\"compiledHooks_QueryTypeFragment\">;\n};\n"],
|
|
5
5
|
"mappings": ";;AAAA;AAGA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -7,7 +7,7 @@ export declare type compiledHooks_RefetchableFragment = {
|
|
|
7
7
|
};
|
|
8
8
|
export declare type compiledHooks_RefetchableFragment$data = compiledHooks_RefetchableFragment;
|
|
9
9
|
export declare type compiledHooks_RefetchableFragment$key = {
|
|
10
|
-
readonly " $data"?: compiledHooks_RefetchableFragment$data;
|
|
10
|
+
readonly " $data"?: compiledHooks_RefetchableFragment$data | undefined;
|
|
11
11
|
readonly " $fragmentRefs": FragmentRefs<"compiledHooks_RefetchableFragment">;
|
|
12
12
|
};
|
|
13
13
|
//# sourceMappingURL=compiledHooks_RefetchableFragment.graphql.d.ts.map
|
package/lib/storeObservation/__generated__/compiledHooks_RefetchableFragment.graphql.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiledHooks_RefetchableFragment.graphql.d.ts","sourceRoot":"","sources":["../../../src/storeObservation/__generated__/compiledHooks_RefetchableFragment.graphql.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,oBAAY,iCAAiC,GAAG;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,mCAAmC,CAAC;CAC7D,CAAC;AACF,oBAAY,sCAAsC,GAAG,iCAAiC,CAAC;AACvF,oBAAY,qCAAqC,GAAG;IAChD,QAAQ,CAAC,QAAQ,CAAC,EAAE,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"compiledHooks_RefetchableFragment.graphql.d.ts","sourceRoot":"","sources":["../../../src/storeObservation/__generated__/compiledHooks_RefetchableFragment.graphql.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,oBAAY,iCAAiC,GAAG;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,mCAAmC,CAAC;CAC7D,CAAC;AACF,oBAAY,sCAAsC,GAAG,iCAAiC,CAAC;AACvF,oBAAY,qCAAqC,GAAG;IAChD,QAAQ,CAAC,QAAQ,CAAC,EAAE,sCAAsC,GAAG,SAAS,CAAC;IACvE,QAAQ,CAAC,gBAAgB,EAAE,YAAY,CAAC,mCAAmC,CAAC,CAAC;CAChF,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/storeObservation/__generated__/compiledHooks_RefetchableFragment.graphql.ts"],
|
|
4
|
-
"sourcesContent": ["/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n;\n\nimport { FragmentRefs } from \"@graphitation/apollo-react-relay-duct-tape\";\nexport type compiledHooks_RefetchableFragment = {\n readonly petName: string;\n readonly avatarUrl: string;\n readonly id: string;\n readonly \" $refType\": \"compiledHooks_RefetchableFragment\";\n};\nexport type compiledHooks_RefetchableFragment$data = compiledHooks_RefetchableFragment;\nexport type compiledHooks_RefetchableFragment$key = {\n readonly \" $data\"?: compiledHooks_RefetchableFragment$data;\n readonly \" $fragmentRefs\": FragmentRefs<\"compiledHooks_RefetchableFragment\">;\n};\n"],
|
|
4
|
+
"sourcesContent": ["/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n;\n\nimport { FragmentRefs } from \"@graphitation/apollo-react-relay-duct-tape\";\nexport type compiledHooks_RefetchableFragment = {\n readonly petName: string;\n readonly avatarUrl: string;\n readonly id: string;\n readonly \" $refType\": \"compiledHooks_RefetchableFragment\";\n};\nexport type compiledHooks_RefetchableFragment$data = compiledHooks_RefetchableFragment;\nexport type compiledHooks_RefetchableFragment$key = {\n readonly \" $data\"?: compiledHooks_RefetchableFragment$data | undefined;\n readonly \" $fragmentRefs\": FragmentRefs<\"compiledHooks_RefetchableFragment\">;\n};\n"],
|
|
5
5
|
"mappings": ";;AAAA;AAGA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|