这样做
query {
postsConnection(where: {
status: PUBLISHED
}) {
aggregate {
count
}
edges {
cursor
node {
id
slug
}
}
}
}
给我postsConnection发布的帖子。
该模型在 field 中有一个枚举Post数组。这是帖子Categorycategoriesdatamodel
enum Category {
TECH
FIN
DIGIMARK
CODING
TUTORIAL
HOWTO
WRITING
INSPIRE
SCIENCE
POLITICS
LIFESTYLE
}
type Post {
id: ID!
title: String!
editorSerializedOutput: Json!
editorCurrentContent: Json!
editorHtml: String!
updatedAt: DateTime!
createdAt: DateTime!
author: User
authorId: String!
categories: [Category!]!
thumbnail: Json!
status: PostStatus!
slug: String!
}
我的问题是,我需要编写什么 Prisma 查询才能获取PostConnection特定类别的帖子?