How to generate the final schema

In my development process I rely heavily on code generation to speed things up significantly. Therefore, I need the final GQL-schema that is published by dgraph.

Currently, I use this procedure to get my hands on that schema:

curl -X POST localhost:8080/admin/schema --data-binary '@dgraph.graphql'
get-graphql-schema http://localhost:8080/graphql > api.graphql
go run github.com/maaft/gqlgenc # takes api.graphql and generates golang client

Now the big problem is that I use the generated golang client in my 2nd GQL server that is accessed via @custom mutations and queries in dgraph.graphql. This means that if the generated client has bugs (happens sometimes due to git merge stuff etc) I have circular dependencies that don’t resolve.
I need the correct client to start my GQL server. The server is needed so I can post the schema to dgraph. Dgraph is needed to fetch the final schema which is needed to generate the client.

Is there any way out of this misery?

I guess what I am really asking is: Can I disable the schema introspection checks for @custom queries?

https://dgraph.io/docs/graphql/custom/directive have You tried skipIntrospection: true ?

Good point, thank you.