Query a Vendor by property

Hi All,
I’m a bit new to this API and can’t figure out how to query a Vendor by a property like Account Number or Name. Filters don’t seem to exist. I just want to get a single Vendor back where the Account Number matches a value. Is this possible?

Hi @fairweather!
I just submitted a feature request to be able to filter by vendor ID, would that work for you?

In the meantime you could use the sort parameter, for example:

query {
  vendors {
    request_id
    complexity
    data(first: 1, sort:"name") {
      edges {
        node {
          id
          legacy_id
          name
          email
          account_number
          account_id
          currency
          internal_note
          default_po_note
          logo
          partner_vendor_id
          created_at
        }
      }
    }
  }
}

It’s not as accurate as filtering by id, but it might be useful in the meantime.
Thanks!
Tom

Thanks for adding the feature request. I’m not sure what your query above would accomplish as it seems it would just get the first value in the list sorted by name. My assumption would be it would return a vendor starting with the letter “A”. Please correct me if I’m wrong. I’m still a bit new to this GraphQL querying model.

My current solution is to load all the vendors and find it in the list which works but with this silly “credits” throttling, it’s not exactly the best solution.

You are right about that! it wouldn’t help if you are looking for a specific vendor.
So the request would be to be able to filter by id or name.
I’ll let you know as soon as I have an update on this.
Thanks!
Tom