Open toriphes opened 4 years ago
Thank you for the great work!
Response headers setted with wp-graphql filters like graphql_response_headers_to_send or graphql_access_control_allow_headers are ignored when data is served from the cache.
graphql_response_headers_to_send
graphql_access_control_allow_headers
I used this code as a workaround.
add_action( 'graphql_cache_early_response', function() { WPGraphQL\Router::set_headers(); } );
Wouldn't it be better to insert WPGraphQL\Router::set_headers() exactly before calling the respond_and_exit method of the QueryCache class?
WPGraphQL\Router::set_headers()
respond_and_exit
QueryCache
I'm facing the same issue!
Thank you for the great work!
Response headers setted with wp-graphql filters like
graphql_response_headers_to_send
orgraphql_access_control_allow_headers
are ignored when data is served from the cache.I used this code as a workaround.
Wouldn't it be better to insert
WPGraphQL\Router::set_headers()
exactly before calling therespond_and_exit
method of theQueryCache
class?