Git Product home page Git Product logo

doodles-subgraph-api's Introduction

Doodles Subgraph API

Subgraph to query Doodles NFT tokens along with the traits and owners.

How to use the API

Try it out here

Example query:

{
  tokens(first: 5) {
    id
    tokenID
    tokenURI
    image
    name
    description
    face
    hair
    body
    background
    head
    piercing
    updatedAtTimestamp 
    owner {
      id 
    }
  }
}

Filtering

{
  tokens(
    where: {
      face_contains: "mustache"
    }
  ) {
    face
    name
    tokenID
    owner {
      id 
    }
  }
}

Full text search

{
  doodleSearch(
    text: "'mustache'"
  ) {
    id
    name
    description
  }
}

How to deploy the API

This project is an example of how you can build and deploy Graph Protocol APIs for NFT projects.

This subgraph indexes data from doodles smart contract transactions and makes them queryable.

This API enables advanced querying capabilities like full text search, relationships between tokens and users, filtering, sorting, and pagination.

To deploy this API, follow these steps:

  1. Clone this repo, change into the directory, and install the dependencies:
git clone [email protected]:jinsley8/doodles-subgraph-api.git

cd doodles-subgraph-api

npm install
  1. Visit The Graph hosted service dashboard, create a profile, and create a new subgraph by clicking Add Subgraph.

  2. Install The Graph CLI:

npm install -g @graphprotocol/graph-cli
  1. Authenticate the your CLI environment with the Access Token from your account dashboard:
graph auth https://api.thegraph.com/deploy/ <ACCESS_TOKEN>
  1. Replace username/apiname in package.json with your username and apiname, for example: jinsley8/doodles-api

  2. Deploy the subgraph

yarn deploy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.