@cedarjs/web 6.0.0-canary.2652 → 6.0.0-canary.2654
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/dist/apollo/fragmentRegistry.d.ts +23 -6
- package/dist/apollo/fragmentRegistry.d.ts.map +1 -1
- package/dist/apollo/fragmentRegistry.js +2 -2
- package/dist/apollo/index.d.ts +0 -1
- package/dist/apollo/index.d.ts.map +1 -1
- package/dist/apollo/index.js +2 -25
- package/dist/apollo/suspense.d.ts +0 -1
- package/dist/apollo/suspense.d.ts.map +1 -1
- package/dist/apollo/suspense.js +2 -24
- package/dist/cjs/apollo/fragmentRegistry.d.ts +23 -6
- package/dist/cjs/apollo/fragmentRegistry.d.ts.map +1 -1
- package/dist/cjs/apollo/fragmentRegistry.js +3 -3
- package/dist/cjs/apollo/index.d.ts +0 -1
- package/dist/cjs/apollo/index.d.ts.map +1 -1
- package/dist/cjs/apollo/index.js +1 -16
- package/dist/cjs/apollo/suspense.d.ts +0 -1
- package/dist/cjs/apollo/suspense.d.ts.map +1 -1
- package/dist/cjs/apollo/suspense.js +1 -16
- package/dist/cjs/components/cell/CellErrorBoundary.d.ts +3 -2
- package/dist/cjs/components/cell/CellErrorBoundary.d.ts.map +1 -1
- package/dist/cjs/components/cell/cellTypes.d.ts +3 -3
- package/dist/cjs/components/cell/cellTypes.d.ts.map +1 -1
- package/dist/cjs/components/cell/createCell.d.ts.map +1 -1
- package/dist/cjs/components/cell/createCell.js +2 -2
- package/dist/cjs/components/cell/createCell.test.js +69 -83
- package/dist/cjs/components/cell/createFragmentCell.d.ts.map +1 -1
- package/dist/cjs/components/cell/createFragmentCell.js +1 -2
- package/dist/cjs/components/cell/createFragmentCell.test.js +48 -55
- package/dist/cjs/components/cell/createSuspendingCell.d.ts.map +1 -1
- package/dist/cjs/components/cell/createSuspendingCell.js +2 -3
- package/dist/cjs/components/cell/createSuspendingCell.test.js +18 -37
- package/dist/cjs/global.web-auto-imports.d.ts +0 -16
- package/dist/cjs/global.web-auto-imports.d.ts.map +1 -1
- package/dist/cjs/global.web-auto-imports.js +0 -15
- package/dist/cjs/index.d.ts +4 -3
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +6 -7
- package/dist/components/cell/CellErrorBoundary.d.ts +3 -2
- package/dist/components/cell/CellErrorBoundary.d.ts.map +1 -1
- package/dist/components/cell/cellTypes.d.ts +3 -3
- package/dist/components/cell/cellTypes.d.ts.map +1 -1
- package/dist/components/cell/createCell.d.ts.map +1 -1
- package/dist/components/cell/createCell.js +1 -1
- package/dist/components/cell/createCell.test.js +70 -84
- package/dist/components/cell/createFragmentCell.d.ts.map +1 -1
- package/dist/components/cell/createFragmentCell.js +1 -2
- package/dist/components/cell/createFragmentCell.test.js +49 -56
- package/dist/components/cell/createSuspendingCell.d.ts.map +1 -1
- package/dist/components/cell/createSuspendingCell.js +5 -2
- package/dist/components/cell/createSuspendingCell.test.js +22 -38
- package/dist/global.web-auto-imports.d.ts +0 -16
- package/dist/global.web-auto-imports.d.ts.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -5
- package/package.json +5 -5
- package/dist/apollo/typeOverride.d.ts +0 -21
- package/dist/apollo/typeOverride.d.ts.map +0 -1
- package/dist/apollo/typeOverride.js +0 -0
- package/dist/cjs/apollo/typeOverride.d.ts +0 -21
- package/dist/cjs/apollo/typeOverride.d.ts.map +0 -1
- package/dist/cjs/apollo/typeOverride.js +0 -16
- package/dist/cjs/components/GraphQLHooksProvider.d.ts +0 -77
- package/dist/cjs/components/GraphQLHooksProvider.d.ts.map +0 -1
- package/dist/cjs/components/GraphQLHooksProvider.js +0 -147
- package/dist/components/GraphQLHooksProvider.d.ts +0 -77
- package/dist/components/GraphQLHooksProvider.d.ts.map +0 -1
- package/dist/components/GraphQLHooksProvider.js +0 -105
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
import type { UseFragmentResult } from '@apollo/client';
|
|
2
2
|
import type { FragmentRegistryAPI } from '@apollo/client/cache/index.js';
|
|
3
3
|
import type { DocumentNode } from 'graphql';
|
|
4
|
-
|
|
4
|
+
export interface FragmentHookOptions {
|
|
5
|
+
fragment: DocumentNode;
|
|
6
|
+
fragmentName?: string;
|
|
7
|
+
/**
|
|
8
|
+
* The object to read the fragment data for. Usually a cache reference like
|
|
9
|
+
* `{ __typename: 'User', id: 1 }`, but any object that Apollo Client can
|
|
10
|
+
* identify works.
|
|
11
|
+
*/
|
|
12
|
+
from: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
export interface FragmentHookResult<TData = any> {
|
|
15
|
+
/**
|
|
16
|
+
* The fragment data read from Apollo Client's cache, or `undefined` if the
|
|
17
|
+
* cache doesn't (yet) contain complete data for the fragment.
|
|
18
|
+
*/
|
|
19
|
+
data: TData | undefined;
|
|
20
|
+
complete: boolean;
|
|
21
|
+
}
|
|
5
22
|
export type FragmentIdentifier = string | number;
|
|
6
23
|
export type CacheKey = {
|
|
7
24
|
__typename: string;
|
|
@@ -14,12 +31,12 @@ export type RegisterFragmentResult = {
|
|
|
14
31
|
useRegisteredFragment: <TData = any>(id: FragmentIdentifier) => UseFragmentResult<TData>;
|
|
15
32
|
};
|
|
16
33
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* surface `data: undefined` so that fragment Cells
|
|
20
|
-
* snapshot passed via their data prop.
|
|
34
|
+
* Read fragment data from Apollo Client's cache without firing a network
|
|
35
|
+
* request. Used by fragment Cells (Cells that export `FRAGMENT` instead of
|
|
36
|
+
* `QUERY`). Incomplete reads surface `data: undefined` so that fragment Cells
|
|
37
|
+
* fall back to the data snapshot passed via their data prop.
|
|
21
38
|
*/
|
|
22
|
-
export declare function
|
|
39
|
+
export declare function useFragment<TData = any>(options: FragmentHookOptions): FragmentHookResult<TData>;
|
|
23
40
|
/**
|
|
24
41
|
* Creates a fragment registry for Apollo Client's InMemoryCache so that they
|
|
25
42
|
* can be referred to by name in any query or InMemoryCache operation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fragmentRegistry.d.ts","sourceRoot":"","sources":["../../src/apollo/fragmentRegistry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAEvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C,OAAO,
|
|
1
|
+
{"version":3,"file":"fragmentRegistry.d.ts","sourceRoot":"","sources":["../../src/apollo/fragmentRegistry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAEvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,YAAY,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B;AAED,MAAM,WAAW,kBAAkB,CAAC,KAAK,GAAG,GAAG;IAC7C;;;OAGG;IACH,IAAI,EAAE,KAAK,GAAG,SAAS,CAAA;IACvB,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,CAAA;AAEhD,MAAM,MAAM,QAAQ,GAAG;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,EAAE,EAAE,kBAAkB,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,YAAY,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,QAAQ,CAAA;IACjD,qBAAqB,EAAE,CAAC,KAAK,GAAG,GAAG,EACjC,EAAE,EAAE,kBAAkB,KACnB,iBAAiB,CAAC,KAAK,CAAC,CAAA;CAC9B,CAAA;AA8CD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,GAAG,GAAG,EACrC,OAAO,EAAE,mBAAmB,GAC3B,kBAAkB,CAAC,KAAK,CAAC,CAsB3B;AAED;;;;;;;IAOI;AACJ,eAAO,MAAM,gBAAgB,EAAE,mBAA8C,CAAA;AAE7E;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,WAAW,YAAY,EAAE,6BAE1D,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,GAC3B,UAAU,YAAY,KACrB,sBAqBF,CAAA"}
|
|
@@ -13,7 +13,7 @@ const useRegisteredFragmentHook = (fragment, id) => {
|
|
|
13
13
|
});
|
|
14
14
|
};
|
|
15
15
|
const UNIDENTIFIABLE_FRAGMENT_REF = "CedarUnidentifiableFragmentRef:_";
|
|
16
|
-
function
|
|
16
|
+
function useFragment(options) {
|
|
17
17
|
const client = apolloClient.useApolloClient();
|
|
18
18
|
const { from, ...restOptions } = options;
|
|
19
19
|
const cacheId = client.cache.identify(from);
|
|
@@ -53,5 +53,5 @@ export {
|
|
|
53
53
|
fragmentRegistry,
|
|
54
54
|
registerFragment,
|
|
55
55
|
registerFragments,
|
|
56
|
-
|
|
56
|
+
useFragment
|
|
57
57
|
};
|
package/dist/apollo/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import type { ApolloClientOptions, setLogVerbosity, ApolloCache, InMemoryCacheConfig, HttpOptions, DocumentNode, HttpLink } from '@apollo/client';
|
|
3
3
|
import { ApolloLink } from '@apollo/client/link/core/core.cjs';
|
|
4
4
|
import type { UseAuth } from '@cedarjs/auth';
|
|
5
|
-
import './typeOverride.js';
|
|
6
5
|
import { fragmentRegistry, registerFragment, registerFragments } from './fragmentRegistry.js';
|
|
7
6
|
import { useCache } from './useCache.js';
|
|
8
7
|
export type { CacheKey, FragmentIdentifier, RegisterFragmentResult, } from './fragmentRegistry.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apollo/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,QAAQ,EACT,MAAM,gBAAgB,CAAA;AAOvB,OAAO,EAAE,UAAU,EAAS,MAAM,mCAAmC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apollo/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,QAAQ,EACT,MAAM,gBAAgB,CAAA;AAOvB,OAAO,EAAE,UAAU,EAAS,MAAM,mCAAmC,CAAA;AAMrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAS5C,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAKxC,YAAY,EACV,QAAQ,EACR,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,QAAQ,EAAE,CAAA;AAEnB,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAA;AAEhE,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,CAAA;AAEzD,MAAM,MAAM,qBAAqB,GAC7B,WAAW,GACX,gBAAgB,GAChB,sBAAsB,GACtB,UAAU,CAAA;AAE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
8
|
import { ApolloLink, split } from "@apollo/client/link/core/core.cjs";
|
|
9
9
|
import { createPersistedQueryLink } from "@apollo/client/link/persisted-queries/persisted-queries.cjs";
|
|
10
|
-
import {
|
|
11
|
-
useQuery,
|
|
12
|
-
useMutation,
|
|
13
|
-
useSubscription,
|
|
14
|
-
useBackgroundQuery,
|
|
15
|
-
useReadQuery,
|
|
16
|
-
useSuspenseQuery
|
|
17
|
-
} from "@apollo/client/react/hooks/hooks.cjs";
|
|
18
10
|
import { ApolloProvider } from "@apollo/client/react/react.cjs";
|
|
19
11
|
import { getMainDefinition } from "@apollo/client/utilities/utilities.cjs";
|
|
20
12
|
import { print } from "graphql/language/printer.js";
|
|
21
13
|
import { useNoAuth } from "@cedarjs/auth";
|
|
22
|
-
import "./typeOverride.js";
|
|
23
14
|
import { createUploadLink } from "../bundled/apollo-upload-client.js";
|
|
24
15
|
import {
|
|
25
16
|
FetchConfigProvider,
|
|
26
17
|
useFetchConfig
|
|
27
18
|
} from "../components/FetchConfigProvider.js";
|
|
28
|
-
import { GraphQLHooksProvider } from "../components/GraphQLHooksProvider.js";
|
|
29
19
|
import {
|
|
30
20
|
fragmentRegistry,
|
|
31
21
|
registerFragment,
|
|
32
|
-
registerFragments
|
|
33
|
-
useCellFragment
|
|
22
|
+
registerFragments
|
|
34
23
|
} from "./fragmentRegistry.js";
|
|
35
24
|
import * as SSELinkExports from "./sseLink.js";
|
|
36
25
|
import { useCache } from "./useCache.js";
|
|
@@ -175,19 +164,7 @@ const RedwoodApolloProvider = ({
|
|
|
175
164
|
useAuth,
|
|
176
165
|
logLevel
|
|
177
166
|
},
|
|
178
|
-
|
|
179
|
-
GraphQLHooksProvider,
|
|
180
|
-
{
|
|
181
|
-
useQuery,
|
|
182
|
-
useMutation,
|
|
183
|
-
useSubscription,
|
|
184
|
-
useBackgroundQuery,
|
|
185
|
-
useReadQuery,
|
|
186
|
-
useSuspenseQuery,
|
|
187
|
-
useFragment: useCellFragment
|
|
188
|
-
},
|
|
189
|
-
children
|
|
190
|
-
)
|
|
167
|
+
children
|
|
191
168
|
));
|
|
192
169
|
};
|
|
193
170
|
export {
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import type { ApolloClientOptions, ApolloLink, HttpOptions, InMemoryCacheConfig, setLogVerbosity } from '@apollo/client';
|
|
3
3
|
import { InMemoryCache } from '@apollo/client-react-streaming';
|
|
4
4
|
import type { UseAuth } from '@cedarjs/auth';
|
|
5
|
-
import './typeOverride.js';
|
|
6
5
|
import type { RedwoodApolloLink, RedwoodApolloLinkFactory, RedwoodApolloLinkName, RedwoodApolloLinks } from './links.js';
|
|
7
6
|
export type ApolloClientCacheConfig = InMemoryCacheConfig;
|
|
8
7
|
export type { RedwoodApolloLink, RedwoodApolloLinkFactory, RedwoodApolloLinkName, RedwoodApolloLinks, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suspense.d.ts","sourceRoot":"","sources":["../../src/apollo/suspense.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,KAAK,EACV,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,eAAe,EAChB,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"suspense.d.ts","sourceRoot":"","sources":["../../src/apollo/suspense.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,KAAK,EACV,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,eAAe,EAChB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAEL,aAAa,EAEd,MAAM,gCAAgC,CAAA;AAGvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAW5C,OAAO,KAAK,EACV,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,YAAY,CAAA;AASnB,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,CAAA;AAEzD,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,GACnB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,mBAAmB,CAAC,OAAO,CAAC,EAC5B,OAAO,GAAG,MAAM,CACjB,GAAG;IACF,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,uBAAuB,CAAA;IACrC;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,WAAW,CAAA;IAC5B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,wBAAwB,CAAA;CAC7C,CAAA;AAkFD,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAC1D,mBAAmB,CAAC,EAAE,uBAAuB,CAAA;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;IAC7C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CA4BA,CAAA"}
|
package/dist/apollo/suspense.js
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import React, { useContext } from "react";
|
|
3
3
|
import { setLogVerbosity as apolloSetLogVerbosity } from "@apollo/client/core/index.js";
|
|
4
|
-
import {
|
|
5
|
-
useMutation,
|
|
6
|
-
useSubscription,
|
|
7
|
-
useBackgroundQuery,
|
|
8
|
-
useQuery,
|
|
9
|
-
useReadQuery,
|
|
10
|
-
useSuspenseQuery
|
|
11
|
-
} from "@apollo/client/react/hooks/index.js";
|
|
12
4
|
import {
|
|
13
5
|
ApolloClient,
|
|
14
6
|
InMemoryCache,
|
|
@@ -17,14 +9,12 @@ import {
|
|
|
17
9
|
import { buildManualDataTransport } from "@apollo/client-react-streaming/manual-transport";
|
|
18
10
|
import { useNoAuth } from "@cedarjs/auth";
|
|
19
11
|
import { ServerAuthContext } from "@cedarjs/auth/dist/AuthProvider/ServerAuthProvider.js";
|
|
20
|
-
import "./typeOverride.js";
|
|
21
12
|
import {
|
|
22
13
|
FetchConfigProvider,
|
|
23
14
|
useFetchConfig
|
|
24
15
|
} from "../components/FetchConfigProvider.js";
|
|
25
|
-
import { GraphQLHooksProvider } from "../components/GraphQLHooksProvider.js";
|
|
26
16
|
import { ServerHtmlContext } from "../components/ServerInject.js";
|
|
27
|
-
import { fragmentRegistry
|
|
17
|
+
import { fragmentRegistry } from "./fragmentRegistry.js";
|
|
28
18
|
import {
|
|
29
19
|
createAuthApolloLink,
|
|
30
20
|
createFinalLink,
|
|
@@ -96,19 +86,7 @@ const RedwoodApolloProvider = ({
|
|
|
96
86
|
useAuth,
|
|
97
87
|
logLevel
|
|
98
88
|
},
|
|
99
|
-
|
|
100
|
-
GraphQLHooksProvider,
|
|
101
|
-
{
|
|
102
|
-
useQuery,
|
|
103
|
-
useMutation,
|
|
104
|
-
useSubscription,
|
|
105
|
-
useSuspenseQuery,
|
|
106
|
-
useBackgroundQuery,
|
|
107
|
-
useReadQuery,
|
|
108
|
-
useFragment: useCellFragment
|
|
109
|
-
},
|
|
110
|
-
children
|
|
111
|
-
)
|
|
89
|
+
children
|
|
112
90
|
));
|
|
113
91
|
};
|
|
114
92
|
export {
|
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
import type { UseFragmentResult } from '@apollo/client';
|
|
2
2
|
import type { FragmentRegistryAPI } from '@apollo/client/cache/index.js';
|
|
3
3
|
import type { DocumentNode } from 'graphql';
|
|
4
|
-
|
|
4
|
+
export interface FragmentHookOptions {
|
|
5
|
+
fragment: DocumentNode;
|
|
6
|
+
fragmentName?: string;
|
|
7
|
+
/**
|
|
8
|
+
* The object to read the fragment data for. Usually a cache reference like
|
|
9
|
+
* `{ __typename: 'User', id: 1 }`, but any object that Apollo Client can
|
|
10
|
+
* identify works.
|
|
11
|
+
*/
|
|
12
|
+
from: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
export interface FragmentHookResult<TData = any> {
|
|
15
|
+
/**
|
|
16
|
+
* The fragment data read from Apollo Client's cache, or `undefined` if the
|
|
17
|
+
* cache doesn't (yet) contain complete data for the fragment.
|
|
18
|
+
*/
|
|
19
|
+
data: TData | undefined;
|
|
20
|
+
complete: boolean;
|
|
21
|
+
}
|
|
5
22
|
export type FragmentIdentifier = string | number;
|
|
6
23
|
export type CacheKey = {
|
|
7
24
|
__typename: string;
|
|
@@ -14,12 +31,12 @@ export type RegisterFragmentResult = {
|
|
|
14
31
|
useRegisteredFragment: <TData = any>(id: FragmentIdentifier) => UseFragmentResult<TData>;
|
|
15
32
|
};
|
|
16
33
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* surface `data: undefined` so that fragment Cells
|
|
20
|
-
* snapshot passed via their data prop.
|
|
34
|
+
* Read fragment data from Apollo Client's cache without firing a network
|
|
35
|
+
* request. Used by fragment Cells (Cells that export `FRAGMENT` instead of
|
|
36
|
+
* `QUERY`). Incomplete reads surface `data: undefined` so that fragment Cells
|
|
37
|
+
* fall back to the data snapshot passed via their data prop.
|
|
21
38
|
*/
|
|
22
|
-
export declare function
|
|
39
|
+
export declare function useFragment<TData = any>(options: FragmentHookOptions): FragmentHookResult<TData>;
|
|
23
40
|
/**
|
|
24
41
|
* Creates a fragment registry for Apollo Client's InMemoryCache so that they
|
|
25
42
|
* can be referred to by name in any query or InMemoryCache operation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fragmentRegistry.d.ts","sourceRoot":"","sources":["../../../src/apollo/fragmentRegistry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAEvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C,OAAO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7E;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,WAAW,YAAY,EAAE,6BAE1D,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,GAC3B,UAAU,YAAY,KACrB,sBAqBF,CAAA"}
|
|
@@ -31,7 +31,7 @@ __export(fragmentRegistry_exports, {
|
|
|
31
31
|
fragmentRegistry: () => fragmentRegistry,
|
|
32
32
|
registerFragment: () => registerFragment,
|
|
33
33
|
registerFragments: () => registerFragments,
|
|
34
|
-
|
|
34
|
+
useFragment: () => useFragment
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(fragmentRegistry_exports);
|
|
37
37
|
var apolloClient = __toESM(require("@apollo/client"), 1);
|
|
@@ -49,7 +49,7 @@ const useRegisteredFragmentHook = (fragment, id) => {
|
|
|
49
49
|
});
|
|
50
50
|
};
|
|
51
51
|
const UNIDENTIFIABLE_FRAGMENT_REF = "CedarUnidentifiableFragmentRef:_";
|
|
52
|
-
function
|
|
52
|
+
function useFragment(options) {
|
|
53
53
|
const client = apolloClient.useApolloClient();
|
|
54
54
|
const { from, ...restOptions } = options;
|
|
55
55
|
const cacheId = client.cache.identify(from);
|
|
@@ -90,5 +90,5 @@ const registerFragment = (fragment) => {
|
|
|
90
90
|
fragmentRegistry,
|
|
91
91
|
registerFragment,
|
|
92
92
|
registerFragments,
|
|
93
|
-
|
|
93
|
+
useFragment
|
|
94
94
|
});
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import type { ApolloClientOptions, setLogVerbosity, ApolloCache, InMemoryCacheConfig, HttpOptions, DocumentNode, HttpLink } from '@apollo/client';
|
|
3
3
|
import { ApolloLink } from '@apollo/client/link/core/core.cjs';
|
|
4
4
|
import type { UseAuth } from '@cedarjs/auth';
|
|
5
|
-
import './typeOverride.js';
|
|
6
5
|
import { fragmentRegistry, registerFragment, registerFragments } from './fragmentRegistry.js';
|
|
7
6
|
import { useCache } from './useCache.js';
|
|
8
7
|
export type { CacheKey, FragmentIdentifier, RegisterFragmentResult, } from './fragmentRegistry.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/apollo/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,QAAQ,EACT,MAAM,gBAAgB,CAAA;AAOvB,OAAO,EAAE,UAAU,EAAS,MAAM,mCAAmC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/apollo/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,QAAQ,EACT,MAAM,gBAAgB,CAAA;AAOvB,OAAO,EAAE,UAAU,EAAS,MAAM,mCAAmC,CAAA;AAMrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAS5C,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAKxC,YAAY,EACV,QAAQ,EACR,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,QAAQ,EAAE,CAAA;AAEnB,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAA;AAEhE,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,CAAA;AAEzD,MAAM,MAAM,qBAAqB,GAC7B,WAAW,GACX,gBAAgB,GAChB,sBAAsB,GACtB,UAAU,CAAA;AAEd,MAAM,MAAM,iBAAiB,CAC3B,IAAI,SAAS,qBAAqB,EAClC,IAAI,SAAS,UAAU,GAAG,UAAU,IAClC;IACF,IAAI,EAAE,IAAI,CAAA;IACV,IAAI,EAAE,IAAI,CAAA;CACX,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,iBAAiB,CAAC,WAAW,CAAC;IAC9B,iBAAiB,CAAC,gBAAgB,CAAC;IACnC,iBAAiB,CAAC,sBAAsB,CAAC;IACzC,iBAAiB,CAAC,UAAU,EAAE,UAAU,GAAG,QAAQ,CAAC;CACrD,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,CAAC,KAAK,EAAE,kBAAkB,KAAK,UAAU,CAAA;AAEhF,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,mBAAmB,CAAC,OAAO,CAAC,EAC5B,OAAO,GAAG,MAAM,CACjB,GAAG;IACF,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,uBAAuB,CAAA;IACrC;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,WAAW,CAAA;IAC5B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,wBAAwB,CAAA;CAC7C,CAAA;AAqND,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAC1D,mBAAmB,CAAC,EAAE,uBAAuB,CAAA;IAC7C,SAAS,CAAC,EAAE,YAAY,EAAE,CAAA;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;IAC7C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CAkCA,CAAA"}
|
package/dist/cjs/apollo/index.js
CHANGED
|
@@ -41,15 +41,12 @@ var import_core = require("@apollo/client/core/core.cjs");
|
|
|
41
41
|
var import_context = require("@apollo/client/link/context/context.cjs");
|
|
42
42
|
var import_core2 = require("@apollo/client/link/core/core.cjs");
|
|
43
43
|
var import_persisted_queries = require("@apollo/client/link/persisted-queries/persisted-queries.cjs");
|
|
44
|
-
var import_hooks = require("@apollo/client/react/hooks/hooks.cjs");
|
|
45
44
|
var import_react2 = require("@apollo/client/react/react.cjs");
|
|
46
45
|
var import_utilities = require("@apollo/client/utilities/utilities.cjs");
|
|
47
46
|
var import_printer = require("graphql/language/printer.js");
|
|
48
47
|
var import_auth = require("@cedarjs/auth");
|
|
49
|
-
var import_typeOverride = require("./typeOverride.js");
|
|
50
48
|
var import_apollo_upload_client = require("../bundled/apollo-upload-client.js");
|
|
51
49
|
var import_FetchConfigProvider = require("../components/FetchConfigProvider.js");
|
|
52
|
-
var import_GraphQLHooksProvider = require("../components/GraphQLHooksProvider.js");
|
|
53
50
|
var import_fragmentRegistry = require("./fragmentRegistry.js");
|
|
54
51
|
var SSELinkExports = __toESM(require("./sseLink.js"), 1);
|
|
55
52
|
var import_useCache = require("./useCache.js");
|
|
@@ -194,19 +191,7 @@ const RedwoodApolloProvider = ({
|
|
|
194
191
|
useAuth,
|
|
195
192
|
logLevel
|
|
196
193
|
},
|
|
197
|
-
|
|
198
|
-
import_GraphQLHooksProvider.GraphQLHooksProvider,
|
|
199
|
-
{
|
|
200
|
-
useQuery: import_hooks.useQuery,
|
|
201
|
-
useMutation: import_hooks.useMutation,
|
|
202
|
-
useSubscription: import_hooks.useSubscription,
|
|
203
|
-
useBackgroundQuery: import_hooks.useBackgroundQuery,
|
|
204
|
-
useReadQuery: import_hooks.useReadQuery,
|
|
205
|
-
useSuspenseQuery: import_hooks.useSuspenseQuery,
|
|
206
|
-
useFragment: import_fragmentRegistry.useCellFragment
|
|
207
|
-
},
|
|
208
|
-
children
|
|
209
|
-
)
|
|
194
|
+
children
|
|
210
195
|
));
|
|
211
196
|
};
|
|
212
197
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import type { ApolloClientOptions, ApolloLink, HttpOptions, InMemoryCacheConfig, setLogVerbosity } from '@apollo/client';
|
|
3
3
|
import { InMemoryCache } from '@apollo/client-react-streaming';
|
|
4
4
|
import type { UseAuth } from '@cedarjs/auth';
|
|
5
|
-
import './typeOverride.js';
|
|
6
5
|
import type { RedwoodApolloLink, RedwoodApolloLinkFactory, RedwoodApolloLinkName, RedwoodApolloLinks } from './links.js';
|
|
7
6
|
export type ApolloClientCacheConfig = InMemoryCacheConfig;
|
|
8
7
|
export type { RedwoodApolloLink, RedwoodApolloLinkFactory, RedwoodApolloLinkName, RedwoodApolloLinks, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suspense.d.ts","sourceRoot":"","sources":["../../../src/apollo/suspense.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,KAAK,EACV,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,eAAe,EAChB,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"suspense.d.ts","sourceRoot":"","sources":["../../../src/apollo/suspense.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,KAAK,EACV,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,eAAe,EAChB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAEL,aAAa,EAEd,MAAM,gCAAgC,CAAA;AAGvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAW5C,OAAO,KAAK,EACV,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,YAAY,CAAA;AASnB,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,CAAA;AAEzD,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,GACnB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,mBAAmB,CAAC,OAAO,CAAC,EAC5B,OAAO,GAAG,MAAM,CACjB,GAAG;IACF,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,uBAAuB,CAAA;IACrC;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,WAAW,CAAA;IAC5B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,wBAAwB,CAAA;CAC7C,CAAA;AAkFD,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAC1D,mBAAmB,CAAC,EAAE,uBAAuB,CAAA;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;IAC7C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CA4BA,CAAA"}
|
|
@@ -34,14 +34,11 @@ __export(suspense_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(suspense_exports);
|
|
35
35
|
var import_react = __toESM(require("react"), 1);
|
|
36
36
|
var import_core = require("@apollo/client/core/index.js");
|
|
37
|
-
var import_hooks = require("@apollo/client/react/hooks/index.js");
|
|
38
37
|
var import_client_react_streaming = require("@apollo/client-react-streaming");
|
|
39
38
|
var import_manual_transport = require("@apollo/client-react-streaming/manual-transport");
|
|
40
39
|
var import_auth = require("@cedarjs/auth");
|
|
41
40
|
var import_ServerAuthProvider = require("@cedarjs/auth/dist/AuthProvider/ServerAuthProvider.js");
|
|
42
|
-
var import_typeOverride = require("./typeOverride.js");
|
|
43
41
|
var import_FetchConfigProvider = require("../components/FetchConfigProvider.js");
|
|
44
|
-
var import_GraphQLHooksProvider = require("../components/GraphQLHooksProvider.js");
|
|
45
42
|
var import_ServerInject = require("../components/ServerInject.js");
|
|
46
43
|
var import_fragmentRegistry = require("./fragmentRegistry.js");
|
|
47
44
|
var import_links = require("./links.js");
|
|
@@ -109,19 +106,7 @@ const RedwoodApolloProvider = ({
|
|
|
109
106
|
useAuth,
|
|
110
107
|
logLevel
|
|
111
108
|
},
|
|
112
|
-
|
|
113
|
-
import_GraphQLHooksProvider.GraphQLHooksProvider,
|
|
114
|
-
{
|
|
115
|
-
useQuery: import_hooks.useQuery,
|
|
116
|
-
useMutation: import_hooks.useMutation,
|
|
117
|
-
useSubscription: import_hooks.useSubscription,
|
|
118
|
-
useSuspenseQuery: import_hooks.useSuspenseQuery,
|
|
119
|
-
useBackgroundQuery: import_hooks.useBackgroundQuery,
|
|
120
|
-
useReadQuery: import_hooks.useReadQuery,
|
|
121
|
-
useFragment: import_fragmentRegistry.useCellFragment
|
|
122
|
-
},
|
|
123
|
-
children
|
|
124
|
-
)
|
|
109
|
+
children
|
|
125
110
|
));
|
|
126
111
|
};
|
|
127
112
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { QueryResult } from '@apollo/client';
|
|
2
3
|
import type { CellFailureProps } from './cellTypes.js';
|
|
3
4
|
export type FallbackProps = {
|
|
4
|
-
error:
|
|
5
|
+
error: QueryResult['error'];
|
|
5
6
|
resetErrorBoundary: () => void;
|
|
6
7
|
};
|
|
7
8
|
export type CellErrorBoundaryProps = {
|
|
@@ -10,7 +11,7 @@ export type CellErrorBoundaryProps = {
|
|
|
10
11
|
};
|
|
11
12
|
interface ErrState {
|
|
12
13
|
hasError: boolean;
|
|
13
|
-
error?:
|
|
14
|
+
error?: QueryResult['error'];
|
|
14
15
|
}
|
|
15
16
|
export declare class CellErrorBoundary extends React.Component<CellErrorBoundaryProps, ErrState> {
|
|
16
17
|
constructor(props: CellErrorBoundaryProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../src/components/cell/CellErrorBoundary.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtD,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"CellErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../src/components/cell/CellErrorBoundary.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtD,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAC3B,kBAAkB,EAAE,MAAM,IAAI,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IAGnC,cAAc,EAAE,CACd,OAAO,EAAE,aAAa,KACnB,KAAK,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAA;IACzC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CAAA;AAED,UAAU,QAAQ;IAChB,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;CAC7B;AAED,qBAAa,iBAAkB,SAAQ,KAAK,CAAC,SAAS,CACpD,sBAAsB,EACtB,QAAQ,CACT;gBACa,KAAK,EAAE,sBAAsB;IAKzC,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK;;;;IAI5C,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS;IAQ1D,MAAM;CAgBP"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentProps, JSXElementConstructor } from 'react';
|
|
2
|
-
import type { ApolloClient, NetworkStatus, OperationVariables, QueryRef, UseBackgroundQueryResult } from '@apollo/client';
|
|
2
|
+
import type { ApolloClient, NetworkStatus, OperationVariables, QueryRef, QueryResult, UseBackgroundQueryResult } from '@apollo/client';
|
|
3
3
|
import type { DocumentNode } from 'graphql';
|
|
4
4
|
import type { A, L, O, U } from 'ts-toolbelt';
|
|
5
5
|
/**
|
|
@@ -27,7 +27,7 @@ export type CellLoadingProps<TVariables extends OperationVariables = any> = {
|
|
|
27
27
|
} & InputVarProps<TVariables>;
|
|
28
28
|
export type CellFailureProps<TVariables extends OperationVariables = any> = {
|
|
29
29
|
queryResult?: NonSuspenseCellQueryResult<TVariables, any> | SuspenseCellQueryResult;
|
|
30
|
-
error?:
|
|
30
|
+
error?: QueryResult['error'] | Error;
|
|
31
31
|
/**
|
|
32
32
|
* @see {@link https://www.apollographql.com/docs/apollo-server/data/errors/#error-codes}
|
|
33
33
|
*/
|
|
@@ -155,7 +155,7 @@ export type SuspendingSuccessProps = React.PropsWithChildren<Record<string, unkn
|
|
|
155
155
|
suspenseQueryResult: SuspenseCellQueryResult<DataObject, any>;
|
|
156
156
|
userProps: Record<string, any>;
|
|
157
157
|
};
|
|
158
|
-
export type NonSuspenseCellQueryResult<TVariables extends OperationVariables = any, TData = any> = Partial<Omit<
|
|
158
|
+
export type NonSuspenseCellQueryResult<TVariables extends OperationVariables = any, TData = any> = Partial<Omit<QueryResult<TData, TVariables>, 'loading' | 'error' | 'data'>>;
|
|
159
159
|
export interface SuspenseCellQueryResult<_TData = any, _TVariables extends OperationVariables = any> extends UseBackgroundQueryResult {
|
|
160
160
|
client: ApolloClient<any>;
|
|
161
161
|
networkStatus?: NetworkStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cellTypes.d.ts","sourceRoot":"","sources":["../../../../src/components/cell/cellTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAA;AAElE,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,wBAAwB,EACzB,MA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S,kBAAkB,GAAG,GAAG,CAC5C,SAAQ,wBAAwB;IAChC,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC,CAAA;IAEzB,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,MAAM,EAAE,OAAO,CAAA;CAChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCell.d.ts","sourceRoot":"","sources":["../../../../src/components/cell/createCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"createCell.d.ts","sourceRoot":"","sources":["../../../../src/components/cell/createCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAKrD,wBAAgB,UAAU,CACxB,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACzC,aAAa,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAE7C,eAAe,EAAE,eAAe,CAAC,SAAS,EAAE,aAAa,CAAC,GACzD,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,CAiCrB"}
|
|
@@ -32,9 +32,9 @@ __export(createCell_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(createCell_exports);
|
|
34
34
|
var import_react = __toESM(require("react"), 1);
|
|
35
|
+
var import_hooks = require("@apollo/client/react/hooks/hooks.cjs");
|
|
35
36
|
var import_fragmentRegistry = require("../../apollo/fragmentRegistry.js");
|
|
36
37
|
var import_graphql = require("../../graphql.js");
|
|
37
|
-
var import_GraphQLHooksProvider = require("../GraphQLHooksProvider.js");
|
|
38
38
|
var import_CellCacheContext = require("./CellCacheContext.js");
|
|
39
39
|
var import_createFragmentCell = require("./createFragmentCell.js");
|
|
40
40
|
var import_createSuspendingCell = require("./createSuspendingCell.js");
|
|
@@ -90,7 +90,7 @@ function createNonSuspendingCell({
|
|
|
90
90
|
loading,
|
|
91
91
|
data,
|
|
92
92
|
...queryResult
|
|
93
|
-
} = (0,
|
|
93
|
+
} = (0, import_hooks.useQuery)(query, options);
|
|
94
94
|
if (globalThis.__REDWOOD__PRERENDERING) {
|
|
95
95
|
const { queryCache } = (0, import_CellCacheContext.useCellCacheContext)();
|
|
96
96
|
const operationName = (0, import_graphql.getOperationName)(query);
|