To run the development server:
yarn dev
Visit the supergraph schema docs to view available operations.
Commands:
codegen:auth
codegen:thegraph
To generate a new apollo type safe hook add a file with .graphql
extension containing the request request to the correct subgraph/operation folder and run the code gen command for that service, the hook will be generated in the generated/{SUBGRAPH_NAME}.ts
file.
Eg how to generate a hook to fetch an active item by id:
Add a file with the name getActiveItem.graphql
to /graphql/theGraph/queries
containing the request:
query ActiveItem($activeItemId: ID!) {
activeItem(id: $activeItemId) {
id
buyer
seller
nftAddress
tokenId
price
}
}
Then run the codegen command for the graph subgraph:
codegen:thegraph
The type safe apollo graphql custom hook will generated in /generated/theGraph.ts
file.