GraphQL Seach Items By Attribute
I’m new to graphql and I’m looking to build a query for an existing API (link). This Schema has the entity ClaimedToken
that has a field called lending
which is of type GotchiLending
(another object). What I am trying to do, is simply to list all ClaimedTokens
based on the borrower
of GotchiLending
(claimedToken.lending.borrower === "0x081b0ebac365be1d64febdcc66bdb4f14c37813b"
).
Here is what I have tried:
- Put borrower on lending field
{
claimedTokens {
lending(borrower: "0x081b0ebac365be1d64febdcc66bdb4f14c37813b") {
borrower
}
}
}
- Put borrower on claimedTokens
{
claimedTokens(borrower: "0x081b0ebac365be1d64febdcc66bdb4f14c37813b") {
lending {
borrower
}
}
}
{
claimedTokens {
lending(where: { borrower: "0x081b0ebac365be1d64febdcc66bdb4f14c37813b" }) {
borrower
}
}
}
{
claimedTokens {
lending(find: { borrower: "0x081b0ebac365be1d64febdcc66bdb4f14c37813b" }) {
borrower
}
}
}
Surprisingly, all my queries were ignored and no errors or warnings were raised. Again, I’m a beginner in graphql so I might be missing something obvious.
Thanks in advance,
Ernani
Read more here: Source link