javascript - 对 GraphQl 查询不区分大小写进行排序
问题描述
与此相同的问题:GraphQL 排序不区分大小写 ,即我需要按字母顺序对查询结果进行排序,但它首先返回以大写字母开头的帖子,然后是小写字母。我只想要完全按字母顺序。
但我不知道如何让上面的答案与盖茨比一起工作。
我的查询如下所示:
query {
allMdx(
sort: {fields: frontmatter___title, order: ASC}
) {
nodes {
frontmatter {
title
slug
}
id
}
}
}
我的组件如下所示:
const AlphabeticalIndex = ({data}) => {
return (
<Layout pageTitle="Alphabetical Index">
<div>
{
data.allMdx.nodes.map(node => (
<p key={node.frontmatter.title} className={listLink}>
<Link to={"/" + node.frontmatter.slug}>
{node.frontmatter.title}
</Link>
</p>
))
}
</div>
</Layout>
)
}
该网站已上线,您可以在此处查看当前查询结果https://ausdict.translatableenglish.com/entry-index(脏话的内容警告)。
谢谢您的帮助。
解决方案
推荐阅读
- c++ - 如何将 -std=c++11 配置为默认编译器?
- hyperledger-fabric - 什么情况会导致fabric网络出现状态分叉
- ios - ios上的颤振蓝牙问题
- sql - 尝试在 azure 中创建应用程序,它将基于 SQL 服务器中的 DML 操作将 xml 发布到 URL
- python - 与 Django 1.6.11 兼容的 Elastic APM 版本是多少?
- nativescript - event.object.lastVisionImage.getBitmap 不是函数
- spring - HttpHeaders 在 spring5 更改中发生更改,导致 API 失败 400
- reactjs - 实现 react-bootstrap 选项卡时出现 TypeScript 错误
- c# - Nuget 包更新 - Microsoft.Data.SqlClient.SNI.x64
- rust - Rust const 函数中的 if 或 match 等条件评估的替代方法是什么?