Hi,
i messed around with the graphql package on the master branch.
How ever i ran into multiple issues.
-
It would be great if graphql introspection query for queries and mutations would return queries and mutations with all additional types (e.g. filter types) for all auto generated crud options.
This is needed so that its easy to integrate it into you frontend toolchain (I create strong types, queries/mutations and subscriptions with apollo client codegen) -
Make The Executors and Rewriters dependency injectable.
I implemented some custom logic to the query rewriter and the mutation rewriter.
graphql is parsed by vektah package wich i already use in many projects with gqlgen.
The parsed query is then rewritten with the help of the gql package (filter trees and children etc.).
So it is very easy to add custom logic e.g. apply conditional filters on the serverside based on jwt sub etc.
Main Problem is that the executors are written for an integration into alpha - to make and spin up the whole project is just to much for every small change in the graphql layer.
I tried to import the dgraph package and start my own webserver with just the two routes to admin and query resolvers. Of course i had to change the query executor to do calls via dgo.
Currently AdminExecutor and DgraphExecutor share the same implementation.
Please consider to refactor the Query and Mutate function in dgraph/execute.go so that they hang of just from a DgraphExecutor struct.
This way on easily could implement a DgoExecutor and swop that in via di if the graphql package is needed from “the outside”. It also would be superb if you can make the Rewriter Functions injectable, so one can spin up a fully customizable graphql server with minimal effort by just importing the graphql package and inject some stuff.
Thanks you for your great work so far!