This repository was archived by the owner on Dec 19, 2023. It is now read-only.
forked from yandooo/graphql-spring-boot
-
Notifications
You must be signed in to change notification settings - Fork 326
Add support for two graphiql headers configurations #484
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d7d2ee6
Add support for two graphiql headers configurations
oliemansm 8ea2101
Call onEditHeaders to ensure they're added to the request
oliemansm 88ed986
Include sonar analysis in pipeline
oliemansm c3e572c
Add accept and content-type headers silently
oliemansm 0c3fa8a
Add accept and content-type headers silently
oliemansm 833756f
Fix pull request configuration
oliemansm a0d7ff9
Upgrade servlet and tools
oliemansm 2dad5b2
Fix unit test
oliemansm 6ff2907
Fix javadoc issue
oliemansm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calling
onEditHeaders(props.headers)
seems to be necessary here, otherwise the headers are not sent with the request (until theonEditHeaders
event is triggered)Also, two additonal headers are appearing on the "Request headers" tab:
"Accept": "application/json"
and"Content-Type": "application/json"
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those two additional headers are added by the
GraphiQLController
atm because otherwise it would send the request as just plain text:Accept:
*/*
Content-Type:
text/plain;charset=UTF-8
According to GraphQL Specification it should use Content-Type
application/json
in that case.I could add them "silently" though, so instead of adding them in the headers tab too, only add them if there absent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the "silent" solution is better in this case, since these headers are/should be always the same. (And the user still has the option to customize them by adding them manually.)