Comments (4)
Follow up on this. We dug some more and uncovered this section of the documentation which mentions:
Instead, @apollo/cache-control-types provides a GraphQLResolveInfoWithCacheControl interface that you can cast info to (if you don't want run-time validation), or if you do want runtime validation, you can use the maybeCacheControlFromInfo and cacheControlFromInfo functions.
import { cacheControlFromInfo } from '@apollo/cache-control-types';
// ...
someField(parent, args, context, info) {
cacheControlFromInfo(info).setCacheHint({ maxAge: 100 });
}
So I guess my request would be that the other locations in the Apollo documentation that mention info.cacheControl
could hopefully be updated to instead use examples with cacheControlFromInfo
.
If the docs are open source, I could also propose a PR that does that if needed.
from apollo-server.
Good catch — the TS-specific improvements from AS4 didn't make it to that page. If you'd like to submit a PR, the file is https://github.com/apollographql/apollo-server/blob/main/docs/source/performance/caching.md
from apollo-server.
Good catch — the TS-specific improvements from AS4 didn't make it to that page. If you'd like to submit a PR, the file is https://github.com/apollographql/apollo-server/blob/main/docs/source/performance/caching.md
Created the following docs PR,
from apollo-server.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
For general questions, we recommend using StackOverflow or our discord server.
from apollo-server.
Related Issues (20)
- Document known mitigated security issue in `@koa/cors` for AS3 users HOT 1
- Update `@koa/cors` dependency for AS3 (or why we don't intend to) HOT 2
- Share and modify variables between Express and the GraphQL/Apollo server HOT 1
- Error: ApolloServer<BaseContext>' is not assignable to type 'ApolloServer<ExpressContext> HOT 3
- callback function for onSchemaLoadOrUpdate when upgrading from AS v3 to AS v4 HOT 3
- Allow plugins to throw meaningful GraphQL errors
- Getting started tutorial has typescript issues...
- Delay when subscription is closed on client side of the router when using callback
- Disabling introspection should also disable "Did you mean ...?" HOT 3
- Undefined 'code' TypeError within errorNormalize HOT 2
- Link broken for plugin
- The server crashes if a promise with deferred handling rejects while another promise is trying to resolve HOT 8
- Upgrade Express version to mitigate the Open Redirect Vulnerability in Express.js for malformed URLs, specifically targeting versions below 4.19.2. HOT 1
- Marking text works unreliable HOT 3
- CodeSandbox setup is failing HOT 1
- Passing context to datasource loses it's reference, meaning, we cannot mutate the context between the resolver and datasources. HOT 2
- Provide basic CSS formatting for markdown rendered in description fields for the sandbox
- Redirect in Context HOT 2
- API Mass Assignment Mitigation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apollo-server.