This is an example app to show you how to query data from a Subgraph from a client-side application.
The project includes a front-end application built with Next.js that queries NFT data from a subgraph that indexes data from the Foundation smart contracts.
You can deploy this project with Gitpod by clicking here:
Once the setup is complete, the app will be started and you should be able to open it and view it:
To deploy locally, follow these steps:
- Clone the project
git clone [email protected]:graphprotocol/full-stack-graph-app.git
- Change into the graph-frontend directory and install the dependencie:
cd full-stack-graph-app/graph-frontend
npm install
- Start the server:
npm run dev
- Optional
If you have an endpoint that you'd like to use, update .env.local with your subgraph endpoint.
- Change into the foundation-subgraph directory and install the dependency:
cd foundation-subgraph
npm install
-
Create a new Subgraph in Subgraph Studio
-
Configure your deploy key
graph auth --studio
- Deploy your subgraph
graph deploy --studio <subgraph-name>
- Update the API endpoint environment variable in graph-frontent/.env.local