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
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
Comment #3
almunningsComment #4
almunningsComment #6
klausiThanks for reporting, I added a test case in the pull request.
Comment #7
kingdutchLooks good to me, thanks!