【发布时间】:2018-08-02 11:01:03
【问题描述】:
我正在使用 React 开发一个 GraphCMS 站点,并希望设置一个 GraphQL 查询来过滤帖子。我们有这个查询设置,它可以工作并获取所有帖子(收养):
export const allAdoptions = gql`
query allAdoptions($first: Int!, $skip: Int!) {
allAdoptions(orderBy: date_DESC, first: $first, skip: $skip) {
id
name
date
image {
handle
}
desc
sex
species
neutered
},
_allAdoptionsMeta {
count
}
}
`
代码可在此处获得:https://github.com/foxreymann/foranimals/blob/master/src/components/Adoptions.js
我们想设置一个过滤器组件来按物种获取帖子:例如“Cat”,我们尝试只修改上述物种查询:“Cat”,但没有成功。任何建议都非常感谢,谢谢
【问题讨论】:
标签: reactjs graphql-js