GraphQL Tag

Parsing queries with graphql-tag gql

When you use a GraphQL client, you will most likely use graphql-tag. graphql-tag is a library for parsing GraphQL operations. It includes the gql tag, which parses a GraphQL operation (query/mutation/subscription) string into an AST (Abstract Syntax Tree) document your client understands.

That means you can define the GraphQL operations in your code using template literals and use gql to compile them to an AST document.

Did you find this page helpful?
Start with GraphQL on Hasura for Free
  • ArrowBuild apps and APIs 10x faster
  • ArrowBuilt-in authorization and caching
  • Arrow8x more performant than hand-rolled APIs
Promo
footer illustration
Brand logo
© 2024 Hasura Inc. All rights reserved
Github
Titter
Discord
Facebook
Instagram
Youtube
Linkedin