# Go Libray for GraphQL schema parsing

**URL:** <https://discuss.dgraph.io/t/go-libray-for-graphql-schema-parsing/10458>\
**Category:** GraphQL\
**Tags:** graphql, kind:question, golang\
**Created:** [September 18, 2020, 6:13pm UTC](https://discuss.dgraph.io/t/go-libray-for-graphql-schema-parsing/10458 "2020-09-18T18:13:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinniefg](https://avatars.discourse-cdn.com/v4/letter/v/6de8d8/32.png) [@vinniefg](https://discuss.dgraph.io/u/vinniefg)\
**Post date:** [September 18, 2020, 6:13pm UTC](https://discuss.dgraph.io/t/go-libray-for-graphql-schema-parsing/10458/1 "2020-09-18T18:13:03Z")

</div>

Hi everyone,

I’m using Go, and I need to parse GraphQL requests intended for and the schema used in SlashQL.

For example, @chewxy mentioned `parse_query` and `parse_graph` from the `graphql_parser` Rust pkg [graphql\_parser::parse\_query - Rust](https://docs.rs/graphql-parser/0.3.0/graphql_parser/fn.parse_query.html)

Does anyone know of a lib/pkg to do that w/ Go? i.e. Does [GitHub - vektah/gqlparser: A port of the parser from graphql-js into golang](https://github.com/vektah/gqlparser) work?

Thx

---

<div class="post-metadata">

**Author:** ![chewxy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/chewxy/32/4339_2.png) [@chewxy](https://discuss.dgraph.io/u/chewxy)\
**Post date:** [September 19, 2020, 12:20am UTC](https://discuss.dgraph.io/t/go-libray-for-graphql-schema-parsing/10458/2 "2020-09-19T00:20:15Z")

</div>

I believe the dgraph repo has a graphql parser (but ironically it’s not in the `graphql` subdirectory. @pawan showed some snippets to me yesterday but I could not for the life of me remember where it is

---

<div class="post-metadata">

**Author:** ![vinniefg](https://avatars.discourse-cdn.com/v4/letter/v/6de8d8/32.png) [@vinniefg](https://discuss.dgraph.io/u/vinniefg)\
**Post date:** [September 19, 2020, 1:10am UTC](https://discuss.dgraph.io/t/go-libray-for-graphql-schema-parsing/10458/3 "2020-09-19T01:10:57Z")

</div>

@pawan @chewxy Looks like dgraph uses [gqlparser](https://github.com/dgraph-io/dgraph/blob/dcce8bf62a73683f7aae3306c5b3f184b9e18682/graphql/schema/request.go#L43) ?

---

<div class="post-metadata">

**Author:** ![chewxy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/chewxy/32/4339_2.png) [@chewxy](https://discuss.dgraph.io/u/chewxy)\
**Post date:** [September 20, 2020, 11:25pm UTC](https://discuss.dgraph.io/t/go-libray-for-graphql-schema-parsing/10458/4 "2020-09-20T23:25:52Z")

</div>

True dat!

---

<div class="post-metadata">

**Author:** ![Akra](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Akra](https://discuss.dgraph.io/u/Akra)\
**Post date:** [September 26, 2020, 7:01pm UTC](https://discuss.dgraph.io/t/go-libray-for-graphql-schema-parsing/10458/5 "2020-09-26T19:01:26Z")

</div>

Hey @chewxy For case 1, is there a library in Go for doing that? I’m recently encountering similar situation.

---

<div class="post-metadata">

**Author:** ![chewxy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/chewxy/32/4339_2.png) [@chewxy](https://discuss.dgraph.io/u/chewxy)\
**Post date:** [September 27, 2020, 9:21pm UTC](https://discuss.dgraph.io/t/go-libray-for-graphql-schema-parsing/10458/6 "2020-09-27T21:21:39Z")

</div>

Use this:

> **[GitHub - vektah/gqlparser: A port of the parser from graphql-js into golang](https://github.com/vektah/gqlparser)**
>
> A port of the parser from graphql-js into golang. Contribute to vektah/gqlparser development by creating an account on GitHub.
