I have a document in the Player collection:
{
"ref": Ref(Collection("Player"), "282953608634302981"),
"ts": 1606104439300000,
"data": {
"rankingid": "282953512300577285",
"uid": "282953404609724933",
"rank": 1,
"challengerid": ""
}
}
a succesfully updated schema update:
gotPlayersByRankingId (rankingid: String!): [Player] @resolver(name: "got_players_byrankingid")
an index :
{
name: "playersByRankingId",
unique: false,
serialized: true,
source: "Player",
terms: [
{
field: ["data", "rankingid"]
}
]
}
a function:
{
name: "got_players_byrankingid",
role: null,
body: Query(
Lambda(
["rankingid"],
Let(
{ player: Match(Index("playersByRankingId"), Var("rankingid")) },
{ player: Select("data", Var("player")) }
)
)
)
}
in PG:
query GotPlayersByRankingId {
gotPlayersByRankingId(rankingid: "282953512300577285") {
_id
rankingid
uid
rank
challengerid
}
}
Gives me:
{
"errors": [
{
"message": "Value not found at path [data].",
"extensions": {
"code": "value not found"
}
}
]
}
I tried adding P (capital P) and player {…} in PG as well:
Gives me:
"message": "Cannot query field '(P)player' on type 'Player'.
What do I need to change to return a list of players matching rankingid?
thanks …