There are 2 kind of middlewares,
- Global Middleware : All middleware files kept under
./server/middleware/will be called for every api call.
- Resolver Specific Middleware 1 : These middleware files are kept under the
resolver folder and will be called for the query/mutation within that resolver.
Example : resolver path -
and middleware file path -
- Resolver Specific Middleware 2 : This middleware also gets invoked during the
of nested queries and in that case the last argument
idswould be an array of parent ids of the query.
Each middleware is a subclass of
BaseMiddlewareGql and will have method called
Subscribe to Our Newsletter
Let us stretch your imagination