holaplex / indexer

Index Solana data using a Geyser plugin (downstream service cluster)
https://holaplex.com
GNU Affero General Public License v3.0
169 stars 39 forks source link

filtering: Allow for filtering solely by update_authority #572

Closed dandlezzz closed 2 years ago

dandlezzz commented 2 years ago

Problem: I'd like to filter nfts by update_authorities. At the moment, owners or creators is required. I think this might have initially been done to prevent unchecked queries returning large datasets.

Solution: Remove / modify check that requires owners or creators from the nfts query.

This query should work:

  nfts(
    updateAuthorities: ["3qaRhSRP2vHGNR83FPXqtjBWT9gv1Bkrq9hrRkyBmw58"],
     limit: 10000, offset: 0) {
    name
    mintAddress
    address

    files {
      uri
      fileType
    }
  }
}

Right now it returns this error:


  "data": null,
  "errors": [
    {
      "message": "No filter provided! Please provide at least one of the filters",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "nfts"
      ],
      "extensions": {
        "Filters": "owners: Vec<PublicKey>, creators: Vec<PublicKey>, offerers: Vec<PublicKey>, auction_houses: Vec<PublicKey>, term: String"
      }
    }
  ]
}