Skip to content

Commit 76d0c03

Browse files
committed
Fixed Apollo typePolicy to include Faust and relay pagination.
1 parent 45addfc commit 76d0c03

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

faust.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@ class PostTypePolicyPlugin {
99
"apolloClientInMemoryCacheOptions",
1010
"faust",
1111
(inMemoryCacheObject) => {
12+
// Merge existing Faust typePolicies with with relayStylePagination for Posts
13+
const existingPolicies = inMemoryCacheObject.typePolicies || {};
14+
1215
return {
1316
...inMemoryCacheObject,
1417
typePolicies: {
18+
...existingPolicies,
1519
Query: {
20+
...existingPolicies.Query,
1621
fields: {
1722
posts: relayStylePagination(),
1823
},

0 commit comments

Comments
 (0)