Skip to content

Latest commit

 

History

History
639 lines (595 loc) · 6.69 KB

querying.md

File metadata and controls

639 lines (595 loc) · 6.69 KB

Querying for the Zora Subgraph

To quickly query the Zora Subgraph you can navigate to The Graph's online sandbox and execute arbitrary graphql queries.

To programmatically query the Zora Subgraph you can send queries to https://api.thegraph.com/subgraphs/name/ourzora/zora-v1

Example Queries

Media

Media by Id

{
  media(id: "") {
    id
    metadataURI
    contentURI
    contentHash
    metadataHash
    owner {
      id
    }
    ownerBidShare
    creator {
      id
    }
    creatorBidShare
    prevOwner {
      id
    }
    prevOwnerBidShare
    approved {
      id
    }
    currentBids {
      id
    }
    currentAsk {
      id
    }
    createdAtTimestamp
    createdAtBlockNumber
  }
}

Media by Creator

{
  media(where: { creator: "" }) {
    id
    metadataURI
    contentURI
    contentHash
    metadataHash
    owner {
      id
    }
    ownerBidShare
    creator {
      id
    }
    creatorBidShare
    prevOwner {
      id
    }
    prevOwnerBidShare
    approved {
      id
    }
    currentBids {
      id
    }
    currentAsk {
      id
    }
    createdAtTimestamp
    createdAtBlockNumber
  }
}

Media by Owner

{
  media(where: { owner: "" }) {
    id
    metadataURI
    contentURI
    contentHash
    metadataHash
    owner {
      id
    }
    ownerBidShare
    creator {
      id
    }
    creatorBidShare
    prevOwner {
      id
    }
    prevOwnerBidShare
    approved {
      id
    }
    currentBids {
      id
    }
    currentAsk {
      id
    }
    createdAtTimestamp
    createdAtBlockNumber
  }
}

Medias by Previous Owner

{
  media(where: { prevOwner: "" }) {
    id
    metadataURI
    contentURI
    contentHash
    metadataHash
    owner {
      id
    }
    ownerBidShare
    creator {
      id
    }
    creatorBidShare
    prevOwner {
      id
    }
    prevOwnerBidShare
    approved {
      id
    }
    currentBids {
      id
    }
    currentAsk {
      id
    }
    createdAtTimestamp
    createdAtBlockNumber
  }
}

Bids

Bid by Id

{
  bid(id: "") {
    id
    media {
      id
    }
    amount
    currency {
      id
    }
    sellOnShare
    bidder {
      id
    }
    recipient {
      id
    }
    createdAtTimestamp
    createdAtBlockNumber
  }
}

Bids by Media

{
  bids(where: { media: "" }){
    id
    currency {
      id
    }
    amount
    sellOnShare
    bidder {
      id
    }
    recipient {
      id
    }
    createdAtTimestamp
    createdAtBlockNumber
  }
}

Bids by Currency

{
  bids(where: { currency: "" }){
    id
    currency {
      id
    }
    amount
    sellOnShare
    bidder {
      id
    }
    recipient {
      id
    }
    createdAtTimestamp
    createdAtBlockNumber
  }
}

Bids by Bidder

{
  bids(where: { bidder: "" }){
    id
    currency {
      id
    }
    amount
    sellOnShare
    bidder {
      id
    }
    recipient {
      id
    }
    createdAtTimestamp
    createdAtBlockNumber
  }
}

Asks

Ask by Id

{
  ask(id: "") {
    id
    media {
      id
    }
    amount
    currency {
      id
    }
    owner {
      id
    }
    createdAtTimestamp
    createdAtBlockNumber
  }
}

Ask by Asker

{
  asks(where: { owner: "" }) {
    id
    media {
      id
    }
    amount
    currency {
      id
    }
    owner {
      id
    }
    createdAtTimestamp
    createdAtBlockNumber
  }
}

Ask by Currency

{
  asks(where: { currency: "" }) {
    id
    media {
      id
    }
    amount
    currency {
      id
    }
    owner {
      id
    }
    createdAtTimestamp
    createdAtBlockNumber
  }
}

InactiveBids

InactiveBid by Id

{
  inactiveBid(id: "") {
    id
    type
    media {
      id
    }
    amount
    currency {
      id
    }
    sellOnShare
    bidder {
      id
    }
    recipient {
      id
    }
    createdAtTimestamp
    createdAtBlockNumber
  }
}

InactiveBids by Media

{
  inactiveBids(where: { media: "" }) {
    id
    type
    media {
      id
    }
    amount
    currency {
      id
    }
    sellOnShare
    bidder {
      id
    }
    recipient {
      id
    }
    createdAtTimestamp
    createdAtBlockNumber
  }
}

InactiveBids by Bidder

{
  inactiveBids(where: { bidder: "" }) {
    id
    type
    media {
      id
    }
    amount
    currency {
      id
    }
    sellOnShare
    bidder {
      id
    }
    recipient {
      id
    }
    createdAtTimestamp
    createdAtBlockNumber
  }
}

InactiveAsks

InactiveAsk by Id

{
  inactiveAsk(id: "") {
    id
    type
    media {
      id
    }
    amount
    currency {
      id
    }
    owner {
      id
    }
    createdAtTimestamp
    createdAtBlockNumber
  }
}

InactiveAsks by Media

{
  inactiveAsks(where: { media: "" }) {
    id
    type
    media {
      id
    }
    amount
    currency {
      id
    }
    owner {
      id
    }
    createdAtTimestamp
    createdAtBlockNumber
  }
}

InactiveAsks by Asker

{
  inactiveAsks(where: { owner: "" }) {
    id
    type
    media {
      id
    }
    amount
    currency {
      id
    }
    owner {
      id
    }
    createdAtTimestamp
    createdAtBlockNumber
  }
}

UriUpdates

UriUpdate by Id

{
  uriupdate(id: "" ){
    id
    type
    media {
        id
    }
    from
    to
    owner {
        id
    }
    updater {
        id
    }
  }
}

UriUpdates by Updater

{
  uriupdates(where: { updater: "" }){
    id
    type
    media {
        id
    }
    from
    to
    owner {
        id
    }
    updater {
        id
    }
  }
}

UriUpdates by Media

{
  uriupdates(where: { media: "" }){
    id
    type
    media {
        id
    }
    from
    to
    owner {
        id
    }
    updater {
        id
    }
  }
}

Transfers

Transfer by Id

{
  transfer(id: ""){
    id
    media {
      id
    }
    from {
      id
    }
    to {
      id
    }
  }
}

Transfers by Media

{
  transfers(where: { media: "" }){
    id
    media {
      id
    }
    from {
      id
    }
    to {
      id
    }
  }
}

Transfers by From User

{
  transfers(where: { from: "" }){
    id
    media {
      id
    }
    from {
      id
    }
    to {
      id
    }
  }
}

Transfers by To User

{
  transfers(where: { to: "" }){
    id
    media {
      id
    }
    from {
      id
    }
    to {
      id
    }
  }
}

Currency

Currency by Id

{
  currency(id: "") {
    id
    name
    symbol
    decimals
    liquidity
  }
}

User

User by Id

{
  user(id: "") {
    id
    creations {
      id
    }
    collection{
      id
    }
    authorizedUsers {
      id
    }
  }
}