You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CacheReader returns false if the content is not served from cache, and here the returnedFromCache is set to the negate of the return value making it true.
This means the following condition is not met, so the query is not processed by the HttpRequestInvoker, resulting in no response in being sent to the client.
When
GraphQLConfiguration
is built with aGraphQLResponseCacheManager
instance, the HTTP response body is empty. The servlet is created as follows,To Reproduce
Steps to reproduce the behavior:
GraphQLConfiguration
with aGraphQLResponseCacheManager
as shown above.Expected behavior
Result of the GraphQL query execution
Additional context
Looking through the code, it seems like the issue is in the following bit of code.
graphql-java-servlet/graphql-java-servlet/src/main/java/graphql/kickstart/servlet/cache/CachingHttpRequestInvoker.java
Lines 30 to 35 in 36ae1d1
The
CacheReader
returnsfalse
if the content is not served from cache, and here thereturnedFromCache
is set to the negate of the return value making ittrue
.This means the following condition is not met, so the query is not processed by the
HttpRequestInvoker
, resulting in no response in being sent to the client.graphql-java-servlet/graphql-java-servlet/src/main/java/graphql/kickstart/servlet/cache/CachingHttpRequestInvoker.java
Lines 42 to 44 in 36ae1d1
I think the fix is to just remove the
!
in the following line, which seems to align with the naming of the variable and the associated comment.graphql-java-servlet/graphql-java-servlet/src/main/java/graphql/kickstart/servlet/cache/CachingHttpRequestInvoker.java
Line 33 in 36ae1d1
With this change, it works as expected locally. Would be great to get this fixed and released.
p.s. Its great to have response caching supported, many thanks!
The text was updated successfully, but these errors were encountered: