@cachecontrol

官网:https://www.apollographql.com/docs/apollo-server/migration/#cachecontrol

Apollo Server 2 中,@cacheControl指令的定义(以及它使用的CacheControlScope枚举)有时会自动插入到你的schema中。(特别是,如果您使用typeDefsresolvers选项定义schema,则会添加它们,但是,如果您使用modulesshema optionsfederated gateway,则不会添加它们。传递cacheControl: false不会阻止插入定义!)

ApolloServer 3 中,这些定义永远不会自动插入。

In Apollo Server 2, definitions of the @cacheControl directive (and the CacheControlScope enum that it uses) were sometimes automatically inserted into your schema. (Specifically, they were added if you defined your schema with the typeDefs and resolvers options, but not if you used the modules or schema options or if you were a federated gateway. Passing cacheControl: false did not stop the definitions from being inserted!) In Apollo Server 3, these definitions are never automatically inserted.

  1. enum CacheControlScope {
  2. PUBLIC
  3. PRIVATE
  4. }
  5. directive @cacheControl(
  6. maxAge: Int
  7. scope: CacheControlScope
  8. inheritMaxAge: Boolean
  9. ) on FIELD_DEFINITION | OBJECT | INTERFACE | UNION

参考资料:
https://www.thinbug.com/q/55077039