Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@apollo/cache-control-types

apollographql6.1mMIT1.0.3TypeScript support: included

TypeScript types for Apollo Server info.cacheControl

apollo, graphql, typescript, node

readme

Cache Control types

This package exports various TypeScript types related to Apollo Server's cache policy calculation.

Specifically, it gives a type-safe way to get the info.cacheControl field in resolvers. Either declare your resolver's info argument to be of type GraphQLResolveInfoWithCacheControl (perhaps with the graphql-code-generator typescript-resolvers customResolveInfo option), or use the maybeCacheControlFromInfo or cacheControlFromInfo functions to extract info.cacheControl in a type-safe way.