Skip to content

Disable strict input type coercion for a single query? #917

Answered by mfn
hossein asked this question in Q&A
Discussion options

You must be logged in to vote

I remember also being impacted by the strict input coercion. The previous way felt more "PHP style" to me, but that ship has sailed anyway.

I'm sorry I don't have anymore recommendations, adding a Laravel HTTP middleware would be my solution.

I know you evaluating that option and I cannot know your stack, but have you already benchmarked such a solution? In my experience the GraphQL type system overhead (building the schema, parsing the request, validating all the fields in the response) brings more latency to a request than a middleware manipulating some data structure slightly.

Replies: 1 comment 1 reply

Comment options

mfn
May 8, 2022
Collaborator

You must be logged in to vote
1 reply
@hossein
Comment options

Answer selected by hossein
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants