Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing response headers when data is served from the cache #2

Open
toriphes opened this issue Jun 8, 2020 · 1 comment
Open

Missing response headers when data is served from the cache #2

toriphes opened this issue Jun 8, 2020 · 1 comment

Comments

@toriphes
Copy link

toriphes commented Jun 8, 2020

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.

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?

@DevWael
Copy link

DevWael commented Jan 12, 2022

I'm facing the same issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants