Custom Subgraph Query
Requirements
Familiarity with GraphQL queries and The Graph queries (see https://thegraph.com/docs/en/developer/graphql-api/)
A Unity project with the Rawrshak SDK installed
Our examples are only for Rawrshak's Content and Exchange subgraphs. A developer can create custom queries for our subgraphs.
A developer can also retrofit this tutorial for any GraphQL source or any subgraph.
Tutorial
1. Create a folder for custom graphql queries
2. Inside that folder, create a "Resources" folder and a "Scripts" folder
3. In the Resources folder, create a text file that contains the GraphQL query
Filename: GetAssetName.txt
Notes:
GraphQL query syntax "{" and "}" must be replaced with "{{" and "}}"
Query parameters are indexed.
{0}
and{1}
indicate the first parameter and second parameter for the query.
4. Create Query Script
Notes:
This script should inherit from
QueryBase
queryWithArgs
format string should match the number of inputs in theGetAssetName.txt
Subgraph
object is in the Rawrshak SDK. If pointing to a different subgraph, replace this with the correct subgraph source uriThe ReturnData object should match the serializable json object returned by the query
5. Use the Custom Query
To use the query:
Last updated