Unable to enable apq caching #1073
-
Versions:
Description:I'm using the rebing/graphql-laravel package in my Laravel application to handle GraphQL queries. I have configured Automatic Persisted Queries (APQ) to cache the keys using Redis as the cache driver. However, I'm facing an issue where the keys are not being cached as expected. In my config/graphql.php file, I have the following APQ configuration:
I have also set the cache driver to Redis in my .env file with the following configuration:
According to these settings, the Laravel GraphQL library should cache all queries in the Redis cache database with the prefix laravel_cache:graphql.apq. However, after setting up and running artisan config:cache, I checked both the main database (DB 0) and the cache database (DB 1) in Redis but couldn't find any keys with the laravel_cache:graphql.apq prefix. I confirmed this by running the following command inside the Redis database:
Could you please assist me in resolving this issue? Any help or suggestions would be greatly appreciated. Thank you in advance. Steps To Reproduce:reproducing this issue is straightforward. normally install the laravel and package and setting the cache to redis and resetting the config by artisan config:cache after that checking redis cache db to see is there any key related to to graphql and there is nothing: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Everything looks fine AFAICS, can you so some debugging if / when certain cache code is called and what it returns? |
Beta Was this translation helpful? Give feedback.
-
Hi, sorry for the request that may seem trivial, but have you tried to execute some "caching" query (see docs or unit tests to look the protocol) ? |
Beta Was this translation helpful? Give feedback.
-
It seems I had a misunderstanding about the apq. I thought it does not require any configuration from the client side and by default, all queries will become cached after enabling the apq. |
Beta Was this translation helpful? Give feedback.
It seems I had a misunderstanding about the apq. I thought it does not require any configuration from the client side and by default, all queries will become cached after enabling the apq.