我有这个 GraphQL模式: graphql schema graphql query
type Board {
title: String @unique
description: String
columns: [Column] @relation
user: User
locked: Boolean
}
type Column {
title: String @unique
description: String
columnType: ColumnType
board: Board
wip: Int
wipLimit: Int
weight: Int
}
type Query {
allBoards: [Board!]!
allColumns: [Column!]!
getBoardByTitle(title: String!):Board @resolver(name: "GetBoardByTitle")
}
功能的实现是: function implementation
Query(
Lambda(
["title"],
Let(
{ boardRef: Match(Index("board_by_title"), Var("title")) },
{
data: {
_id: Select(["ref", "id"], Get(Var("boardRef"))),
description: Select(["data", "description"], Get(Var("boardRef"))),
title: Select(["data", "title"], Get(Var("boardRef"))),
columns: Map(
Paginate(
Match(
Index("all_columns_by_board_order_by_weight"),
Select(["ref"], Get(Var("boardRef")))
)
),
Lambda(
["weight", "columnRef"],
Let(
{ columnRef1: Get(Var("columnRef")) },
{
_id: Select(["ref", "id"], Var("columnRef1")),
description: Select(
["data", "description"],
Var("columnRef1")
),
title: Select(["data", "title"], Var("columnRef1"))
}
)
)
)
}
}
)
)
)
以及索引: board index column index
{
name: "board_by_title",
unique: true,
serialized: true,
source: "Board",
terms: [
{
field: ["data", "title"]
}
]
}
{
name: "all_columns_by_board_order_by_weight",
serialized: true,
source: "Column",
terms: [
{
field: ["data", "board"]
}
],
values: [
{
field: ["data", "weight"]
},
{
field: ["ref"]
}
]
}
并且 GraphQL查询的执行出现此错误: error of graphql query execution(“在路径[ref]上找不到值。”)
谢谢