# Dgraph Directives reference (for other tools)?

**URL:** <https://discuss.dgraph.io/t/dgraph-directives-reference-for-other-tools/12055>\
**Category:** GraphQL\
**Tags:** help-wanted\
**Created:** [December 23, 2020, 6:46pm UTC](https://discuss.dgraph.io/t/dgraph-directives-reference-for-other-tools/12055 "2020-12-23T18:46:11Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![trka](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/trka/32/5749_2.png) [@trka](https://discuss.dgraph.io/u/trka)\
**Post date:** [December 28, 2020, 3:51pm UTC](https://discuss.dgraph.io/t/dgraph-directives-reference-for-other-tools/12055/4 "2020-12-28T15:51:22Z")

</div>

Since this is indexed and others may come for a similar issue:

The final solution that seems to work _really well_ is below.  
My specific case is using [gqlgen](https://gqlgen.com/) to generate gql server stub from the active dgraph gql schema, but the same idea should work just as well for any other ci/cd/auto pipelines.

The curl command uses the recommendation from @rajas, and just adds python/jq for clean pipe-to-schema-file.

I translated my Taskfile to bash, so please don’t copy-paste.

```auto
# routine cleanup
rm -f gql-srv/graph/schema.graphqls

# get generated schema from /admin endpoint.
# use python and jq to pluck .data.getGQLSchema.generatedSchema from response and pass to schema file
curl 'http://localhost:8080/admin' \
    -H 'Content-Type: application/json' \
    --data-binary '{"query":"query{getGQLSchema{generatedSchema}}"}' | 
    python -m json.tool | jq -r '.data.getGQLSchema.generatedSchema' \
        > gql-srv/graph/schema.graphqls

# regenerate gql server stub from updated .graphqls
cd gql-srv && gqlgen generate

```

---

_[View the full topic](https://discuss.dgraph.io/t/dgraph-directives-reference-for-other-tools/12055)._
