Skip to content

Commit

Permalink
disable response caching and log request
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-watson committed Mar 28, 2024
1 parent c4db610 commit bb99371
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 78 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ node_modules/
# Intellij Configuration Files
.idea/

generated-schema.graphql
generated-schema.graphql

undefined.json
target.list
144 changes: 71 additions & 73 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"test": "jest"
},
"dependencies": {
"@apollo/server": "^4.0.0",
"@apollo/server-plugin-response-cache": "^4.1.2",
"@apollo/subgraph": "^2.5.0",
"@apollo/server": "^4.10.2",
"@apollo/server-plugin-response-cache": "^4.1.3",
"@apollo/subgraph": "^2.7.2",
"graphql": "latest",
"graphql-tag": "latest",
"lodash": "^4.17.21",
Expand Down
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ async function main() {
introspection: true,
plugins: [
ApolloServerPluginCacheControl({ defaultMaxAge: 86400 }),
responseCachePlugin(),
responseCachePlugin({
shouldWriteToCache: async (requestContext) => {
console.log(JSON.stringify(requestContext));
return false;
},
}),
{
async serverWillStart() {
return {
Expand Down

0 comments on commit bb99371

Please sign in to comment.