我正在与 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