'Is it possible run a middleware for all query/mutation except any one?

I want to call a http middleware for all mutation/query call in GraphQL, but do not want to call for one query ? Is that possible ?

Edit : I want to send user deactivated response, for all api which needs user to be logged-in, if user is soft deleted. But I do not want this for api to restore the user again.



Solution 1:[1]

No, this is not possible. I will not add such a feature to Lighthouse.

If you need specific logic based on which GraphQL fields are used, that belongs in field middleware. HTTP and GraphQL are two separate layers and must not be conflated.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 spawnia