Force request header depending on request type #1878
-
Hello 👋, I am using an instance of
This also enforces the headers to be present in the request. If header is not in the request, the server answers with Can you please tell me, how to change this if we want to enforce header only for specific request types? The idempotency header makes only sense for mutation requests. Queries don't need to send it. Is there anything which makes an if possible? Sth like this?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
I am really thankful for each hint on this :). @dariuszkuc Can you please help me on this? You are one of the big magicians with Kotlin graphql. |
Beta Was this translation helpful? Give feedback.
You are on the "right" path -> you already configured your context factory through
So you just need to access the value from the context in your directive wiring and then decide whether to proceed with the call or return failure.