Skip to content

Commit 0ee6b5f

Browse files
committed
Enable fragments for prerendering
1 parent 1671888 commit 0ee6b5f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/web/src/components/cell/createCell.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { fragmentRegistry } from '../../apollo'
12
import { getOperationName } from '../../graphql'
23
/**
34
* This is part of how we let users swap out their GraphQL client while staying compatible with Cells.
@@ -67,6 +68,7 @@ function createNonSuspendingCell<
6768
/* eslint-disable-next-line react-hooks/rules-of-hooks */
6869
const { queryCache } = useCellCacheContext()
6970
const operationName = getOperationName(query)
71+
const transformedQuery = fragmentRegistry.transform(query)
7072

7173
let cacheKey
7274

@@ -99,7 +101,7 @@ function createNonSuspendingCell<
99101
} else {
100102
queryCache[cacheKey] ||
101103
(queryCache[cacheKey] = {
102-
query,
104+
query: transformedQuery,
103105
variables: options.variables,
104106
hasProcessed: false,
105107
})

0 commit comments

Comments
 (0)