【发布时间】:2022-09-27 21:57:59
【问题描述】:
我不确定版本是否重要,但目前我使用的是 graphql 版本 15.8.0
这就是我想要做的。
我正在尝试同时通过account = \"string1\" 和transaction.from = \"string2\" 过滤查询。
我将在下面提供有关实体类型的详细信息。
type Swap @entity {
id: ID!
account: String!
transaction: Transaction!
timestamp: Int!
}
type Transaction @entity {
id: ID!
blockNumber: Int!
timestamp: Int!
from: String!
to: String!
}
到目前为止,这是我尝试过的,它奏效了。
但我不知道如何过滤嵌套对象类型Transaction
`{
swaps (
first:1000
orderBy: timestamp
orderDirection: desc
where: { account: \"0x9a64e084a6773180d9aca7eee0173d64ec8111f0\" }
) {
transaction{
id
to
from
}
timestamp
}
}`
我试过这个但没有用
`{
swaps (
first:1000
orderBy: timestamp
orderDirection: desc
where: { account: \"0xaddress\" }
) {
transactions (where: {from : \"0xaddress\"}) {
id
to
from
}
timestamp
}
}`
标签: node.js graphql graphql-js typegraphql thegraph