You can are able to add middlewares to a whole router with the
middleware() method. The middleware(s) will be run before any of the procedures defined after are invoked & can be async or sync.
In the example below any call to
admin.* will ensure that the user is an "admin" before executing any query or mutation.