I want to build a grapql server that exposes only few of dgraph generated graphql queries, mutations and subscriptions. Basically something that simply passes on the query with appropriate validation, auth etc. I would prefer https://github.com/mcollina/fastify-gql for my server but apollo is good too.
Can you provide more details of your use case ?
In case you want auth along with graphql, Dgraph Graphql does provide an @auth directive for the purpose of authorization.
Apollo also does provide a Apollo federation gateway service which can delegate graphql requests to other graphql endpoints. It can be used to forward requests to Dgraph graphql endpoint.
Yes, I understand the @auth directive but I find some problems with it like the inability to expire a user token. We would like to have our own authentication mechanism on the external graphql.
I wasn’t aware that Apollo Federation is compatible with dgraph grapql. Are there any examples I can use?
The fine tuning feature would be great but right now I am just looking for a simple way to have my own graphql server sit as a gateway to dragph generated grapqhl, where I do the validation and auth and pass the query/mutation/subscription forward but not for all of them, only a subset. Apollo federation and graphql-mesh seem like good solutions but I couldn’t find dgraph specific examples or recommendations.
There was a demonstration carried out at Graphql Asia 2020 workshop. Here is the github repo.
Marking this as solution for now. @pranaypratyush if you are unsatisfied, please do respond
I did see this solution and I found it to be really messy and error prone. Are there any other solutions available?
@vardhanapoorv, do you have any other solutions ?