Skip to content

Caching on gateway LocalGraphQLDataSource level does not seem to work #3225

@dazlious

Description

@dazlious

Issue Description

I am running into an issue where the apollo supergraph's caching does not work, but the underlying supgraphs just work fine.

When executing

query a {
  foo
}

I get response header cache-control: no-store

When executing

query b {
  products {
    name
  }
}

I get response header cache-control: max-age=500, public

When executing

query c {
  foo
  products {
    name
  }
}

I get response header cache-control: max-age=500, public

Problem 1: I cannot seem to make the cache work for query foo
Problem 2: When querying foo with any other cached subgraph query, it just applies the cacheControl of that query to the whole response, but IMO it should compute the correct restrictive one.

Link to Reproduction

https://codesandbox.io/p/devbox/headless-cherry-2xpp5d

Reproduction Steps

query c {
  foo
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions