如何编写查询以从 google book API 获取评分最高的 20 本书的列表?

问题描述 投票:0回答:0

我正在与 Stepzen 合作,使用 Google Search Books API。 这是通过输入的变量名称 $q 搜索书籍的查询:

query SearchBooks($q: String) {
    googleBooksSearch(q: $q, country: "US") {
      items {
        id
        volumeInfo {
          authors
          averageRating
          description
          imageLinks {
            thumbnail
          }
          title
          subtitle
          industryIdentifiers {
            identifier
            type
          }
        }
      }
    }
}

那么如何编写查询以从 google book API 中获取 20 本评分最高的图书列表?

我试过这个查询:

query GetTopRatedBooks {
  googleBooksSearch(q: "", country: "US", orderBy: "rating", maxResults: 20) {
    items {
      id
      volumeInfo {
        title
        subtitle
        authors
        averageRating
        ratingsCount
        description
        imageLinks {
          thumbnail
        }
      }
    }
  }
}

但是没用。当我在 Stepzen Dashboard 中运行它时,它在字段“Query.GoogleBooksSearch”上出现错误 Unknow argument orderBy

google-search-api
© www.soinside.com 2019 - 2024. All rights reserved.