Dgraph Directives reference (for other tools)?

As I understand the question, you need a way to automatically generate definitions of directives which you are using in Dgraph GraphQL schema so that the schema (along with directive definitions) could be used with gqlgen.

Dgraph GraphQL takes in a schema, adds queries, mutations, and definitions of directives and other extra things to generate a schema which could then be used with gqlgen.

You may find examples of schema generated by Dgraph GraphQL for every schema in input directory in the output directory of dgraph/graphql/schema/testdata/schemagen at master · dgraph-io/dgraph · GitHub .

The generated GraphQL schema can be queried using the following query on /admin endpoint.

query{
  getGQLSchema{
    generatedSchema
  }
}

I hope that this answers your question. Do let us know if you have any more questions.