【发布时间】:2019-01-13 02:07:56
【问题描述】:
我的查询看起来像这样(我遗漏了一些变量):
allContentfulBlog(
filter: { node_locale: { eq: "en-US" } }
sort: { fields: [node___date], order: DESC }
) {
edges {
node {
id
date(formatString: "DD MMMM, YYYY")
}
}
}
终端错误:
GraphQL 错误参数“排序”的值无效 {fields: [节点___日期],顺序:DESC}。在字段“字段”中:在元素 #0 中: 找到预期的类型“ContentfulBlogConnectionSortByFieldsEnum” 节点___日期。
为了排序,我尝试了我在教程中看到或能想到的所有论点。我认为它与 Contentful 有关,它是我的 gatsby 应用程序中的数据格式。
终端截图
【问题讨论】:
标签: reactjs graphql gatsby contentful