Skip to content

Commit

Permalink
Use graphql response cache for root queries (#1248)
Browse files Browse the repository at this point in the history
  • Loading branch information
nygrenh committed Oct 12, 2023
1 parent 2394a13 commit 00a263a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/middlewares/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export const cachePlugin = () =>
} /* else if (context.req?.connection) {
rawToken = context.req?.connection.context["Authorization"]
}*/
if (root || info.parentType.toString() !== "Query" || rawToken) {
if (info.parentType.toString() !== "Query" || rawToken) {
// Not using the response cache for mutations or authenticated queries
return next(root, args, context, info)
}

Expand Down

0 comments on commit 00a263a

Please sign in to comment.