Strapi v4 with plugin-graphQL: use @cacheControl custom directives for apollo

Hi all!
I’m struggling using the Apollo Server-side caching features. I just want to use the static way defining cache control directly in the graphQL Schema (see the v3 documentation of server-side caching of apollo).

It uses a custom directive named @cacheControl, but it seems that the graphQL strapi plugin totally skip this directive when it builds the nexus schema using the content-api service:

I saw some old issues about it:

But it doesn’t help me :frowning:

I know that I can define cache-control in a dynamic way, and it works like a charm but I want to try the static way.

Maybe I miss something obvious?

In my typeDefs of registering strapi I use:

extensionService.use(({ strapi }) => ({
      typeDefs: `
            enum CacheControlScope {
            directive @cacheControl(
              maxAge: Int
              scope: CacheControlScope
              inheritMaxAge: Boolean

            type CategoryRelationResponseCollection @cacheControl(maxAge: 1000) {
              data: [CategoryEntity!]!

In order to make my CategoryRelationResponseCollection cached, but it litterally caches nothing…

Best regards.

System Information
  • Strapi Version: 4.15.5
  • Operating System: WSL on Windows (docker)
  • Database: postgresql
  • Node Version: 18.18.2
  • NPM Version: 9.8.1
  • Yarn Version: 1.22.21