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

Dgs headers backward compatibility #2104

Merged
merged 2 commits into from
Jan 8, 2025

Conversation

paulbakker
Copy link
Collaborator

Fix for #2101. Prior to Spring GraphQL integration we could set response headers in two ways:

  1. Set a field dgs-response-headers in the extensions of an ExecutionResult.
  2. Return a DgsExecutionResult which has a headers field.

This functionality stopped working, because DgsExecutionResult (which was responsible for both mechanisms) was no longer referenced in the framework, so the special handling stopped working.

While the now recommended mechanism is to implement a WebGraphQlInterceptor to set headers as described in the docs, existing code would have to be updated.

This PR adds support for the previous mechanisms. The implementation is now based on a WebGraphQlInterceptor.

…er a field in "extensions" or using DgsExecutionResult. While users can now just use WebGraphQlInterceptor, this adds compatibility with the old mechanism.
@paulbakker paulbakker force-pushed the feature/dgs-headers-backward-compatibility branch from 77e769b to 06bb0d7 Compare January 8, 2025 20:18
@paulbakker paulbakker merged commit 7a65cde into master Jan 8, 2025
3 checks passed
@paulbakker paulbakker deleted the feature/dgs-headers-backward-compatibility branch January 8, 2025 21:05
@dokkaraman
Copy link

May I know in which version this would be available?

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

Successfully merging this pull request may close these issues.

5 participants