non-fungible-apps/subgraph/examples/query
Shredder e28c7c6e96
test: subgraph matchstick tests for access points and acl refactor (#150)
* fix: errors from deprecated entities.

* fix: events from deprecated entities.

* test: add tests for NewAccessPoint.

* chore: remove yarn-error.log and add it to .gitignore.

* test: add changeAccessPointCreationStatus tests to subgraph matchstick.

* test: add tests for changeAccessPointNameVerify x matchstick

* feat: add utility functions for ACL events

* test: add tests for tokenRoleChanged event

* test: add tests for the CollectionRoleChanged event

* feat: add handleTokenRolesCleared handler function - slipped from the ACL refactor pr.

* refactor: rename the Token owner consts to user consts.

* chore: add .bin to gitignore.
2023-03-09 23:22:38 +03:30
..
.gitignore test: subgraph matchstick tests for access points and acl refactor (#150) 2023-03-09 23:22:38 +03:30
.graphclientrc.yml feat: subgraph setup for the FleekNFA contracts (#72) 2023-01-31 18:29:42 +03:30
README.md feat: subgraph setup for the FleekNFA contracts (#72) 2023-01-31 18:29:42 +03:30
main.ts feat: subgraph setup for the FleekNFA contracts (#72) 2023-01-31 18:29:42 +03:30
package.json feat: subgraph setup for the FleekNFA contracts (#72) 2023-01-31 18:29:42 +03:30
queries.graphql feat: subgraph setup for the FleekNFA contracts (#72) 2023-01-31 18:29:42 +03:30
yarn.lock feat: subgraph setup for the FleekNFA contracts (#72) 2023-01-31 18:29:42 +03:30

README.md

Query Examples

This directory contains a TypeScript app that performs queries on the deployed subgraph instance of the Fleek NFA.

How to run

Prerequisites

In order to run the app, the following dependencies are required:

  • yarn
  • NPM
  • ts-node

Running the TypeScript app

To launch the TypeScript app, you need to install all dependencies that come with it: yarn or npm install

After doing so, you can run the app by executing the following command: npx ts-node main.ts

Tweaking the queries

As previously mentioned, all queries' GraphQL form can be found in the queries.graphql file.

By following The Graph's Querying Documentation, you can change the queries or add new ones as you desire.

The next thing you need to do after changing the file, is generating the TypeScript format of them by running the following commands:

# if you already have graphclient installed, skip the first command.
yarn add -D @graphprotocol/client-cli
yarn graphclient build

After generating the new TypeScript query specification files, you can change the main.ts script to execute the new queries.