This only works when the document contains a single operation. If the document contains let's say two queries, it will cache the first result and subsequently resolve the cached result for any of the operations in the document. To fix it, the name of the operation should be taken into account.
Example:
query one {
currentUser {
name
}
}
query two {
nodeById(id: 12) {
title
}
}
Executing the query "one" first and then "two" will return the result from query "one".
The
cachePrefix()
method inExecutor.php
generates a hash based on the query, variables and extensions:This only works when the document contains a single operation. If the document contains let's say two queries, it will cache the first result and subsequently resolve the cached result for any of the operations in the document. To fix it, the name of the operation should be taken into account.
Example:
Executing the query "one" first and then "two" will return the result from query "one".