Skip to content

Commit

Permalink
Enable fragments for prerendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Jan 6, 2024
1 parent 1671888 commit 0ee6b5f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/web/src/components/cell/createCell.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { fragmentRegistry } from '../../apollo'
import { getOperationName } from '../../graphql'
/**
* This is part of how we let users swap out their GraphQL client while staying compatible with Cells.
Expand Down Expand Up @@ -67,6 +68,7 @@ function createNonSuspendingCell<
/* eslint-disable-next-line react-hooks/rules-of-hooks */
const { queryCache } = useCellCacheContext()
const operationName = getOperationName(query)
const transformedQuery = fragmentRegistry.transform(query)

let cacheKey

Expand Down Expand Up @@ -99,7 +101,7 @@ function createNonSuspendingCell<
} else {
queryCache[cacheKey] ||
(queryCache[cacheKey] = {
query,
query: transformedQuery,
variables: options.variables,
hasProcessed: false,
})
Expand Down

0 comments on commit 0ee6b5f

Please sign in to comment.