Skip to content

Cannot use headers in sessionId or cacheKey #5102

@mayrn-techdivision

Description

@mayrn-techdivision

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

Make sure to fork this template and run yarn generate in the terminal.

Please make sure Mesh package versions under package.json matches yours.

  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

To Reproduce Steps to reproduce the behavior:

{
  greeting
}
  • Enter the following header into Yoga GraphiQl:
{
  "test": "a"
}
  • Run query (responseCache extension says didCache: true)
  • Run query again (responseCache extension says hit: true)
  • Change test header value to "b"
  • Run query again (responseCache extension says hit: true)

Expected behavior

  • With a different header value, the last query should not be a cache hit

Environment:

  • OS: MacOS
  • @graphql-mesh/response-cache: 0.2.7
  • NodeJS: 16.x

Additional context
There was a related PR (#4109), the problem is that in the session function in packages/plugins/response-cache/src/index.ts we are still getting a fetch Headers object which is not supported in string interpolation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions