Skip to main content

Query your Project using GraphQL

SubQuery TeamAbout 1 min

Query your Project using GraphQL

Coming from the Graph?

You may want to take a look at the information we have on the differences between SubQuery's GraphQL library, and The Graph.

You can follow the official GraphQL guide hereopen in new window to learn more about GraphQL, how it works, and how to use it:

SubQuery Project

On the top right of the playground, you'll find a Docs button that will open a documentation draw. This documentation is automatically generated and helps you find what entities and methods you can query. On our Managed Service Exploreropen in new window, you will also find a query constructor.

The result of the directive will provide new connections to the GraphQL schema allowing you to search. They follow the pattern search<EntityName> and take a search parameter.

The search parameter allows for more than just searching for strings, you can do AND (&), OR (|) , NOT (!, -), begins with (<Text>:*, <Text>*>) and follows (>, <->).

For more details on these operations please see pg-tsqueryopen in new window for sanitised operations and Postgres tsqueryopen in new window for the underlying DB implementation.


# Search for all NFTs with either "blue" or "red" in the name or description
{
  searchNFTs(search: "blue|red") {
    nodes: {
      id
      name
      description
    }
  }
}