Problem/Motivation

I've got multiple GraphQL servers setup.

After the cache is primed, I get back the cache of another server when querying.

This flows through to nearly any query. Running the same query on multiple servers returns whatever was cached first, from the first service's query.

Steps to reproduce

- Create Server A
- Create Server B

Each server should have a different configuration, leading to a different schema. Do this however you see fit? For me, with GraphQL Compose, I setup a different config per service.

- Visit voyager for Server A, see correct result
- Visit voyager for Server B, see Server A's introspective data.

Proposed resolution

src/GraphQL/Execution/Executor.php
cachePrefix() method

Add the Server ID to the sha256 hash:

 'server_id' => $this->context->getServer()->id(),

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork graphql-3593404

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

almunnings created an issue. See original summary.

almunnings’s picture

Status: Active » Needs review
almunnings’s picture

Issue summary: View changes

klausi made their first commit to this issue’s fork.

klausi’s picture

Thanks for reporting, I added a test case in the pull request.

kingdutch’s picture

Status: Needs review » Fixed

Looks good to me, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.