查询
这是 GraphQL 库版本 6 的文档。有关长期支持 (LTS) 版本 5,请参阅 GraphQL 库版本 5 LTS。 |
类型定义
此页面上的查询假定以下类型定义
type Post @node {
id: ID! @id
content: String!
creator: User! @relationship(type: "HAS_POST", direction: IN, properties: "PostedAt")
createdAt: DateTime!
}
type User @node {
id: ID! @id
name: String!
age: Int!
posts: [Post!]! @relationship(type: "HAS_POST", direction: OUT, properties: "PostedAt")
friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT)
}
type PostedAt @relationshipProperties {
date: DateTime
}
为其生成以下查询字段
type Query {
posts(where: PostWhere, sort: [PostSort!]!, limit: Int, offset: Int,): [Post!]!
postsAggregate(where: PostWhere): PostAggregationSelection!
users(where: UserWhere, sort: [UserSort!]!, limit: Int, offset: Int,): [User!]!
usersAggregate(where: UserWhere): UserAggregationSelection!
}