Middleware the GraphQL API to extend functionality

Hey there,
I’d really much appreciate if I could develop my own custom directives on top of that of dgraph.
So I could implement specific auth directives that fit my needs and implement validation directives.
I thought I’d middleware the API using nodejs.

My two questions on this topic:

  1. Could this be added as a feature?
  2. Is there a solution out there (e.g. for nodejs)? Otherwise I’d maybe implement it on my own :slight_smile:

Have a nice day :smiley:

1 Like

I think that Lambda Resolvers is your friend. Any idea @graphql team?

Hey, thanks for your reply!
I should have mentioned, that I’m aware of lambdas. I just really don’t like them as they are not so flexible as I’d need them.

For example:
Directives in graphql are actually pretty handy, but our directives to customize some types are just the one: @lambda
You can neither pass variables to it nor is it readable. Everytime you put there your @lambda, you also need to update the lambda script…

Also: As I’m aware of, you can only use them on fields, not on type definitions, like you do with @auth.