mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Graphql: Prevent store response with errors in cache (#16926)
* Prevent cache response with errors * Fix failing test * mock env in notifications service test * Use res.locals.cache = false instead Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com> Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
This commit is contained in:
@@ -18,6 +18,10 @@ router.use(
|
||||
|
||||
res.locals.payload = await service.execute(res.locals.graphqlParams);
|
||||
|
||||
if (res.locals.payload?.errors?.length > 0) {
|
||||
res.locals.cache = false;
|
||||
}
|
||||
|
||||
return next();
|
||||
}),
|
||||
respond
|
||||
@@ -35,6 +39,10 @@ router.use(
|
||||
|
||||
res.locals.payload = await service.execute(res.locals.graphqlParams);
|
||||
|
||||
if (res.locals.payload?.errors?.length > 0) {
|
||||
res.locals.cache = false;
|
||||
}
|
||||
|
||||
return next();
|
||||
}),
|
||||
respond
|
||||
|
||||
Reference in New Issue
Block a user