Cannot decode when fragment contains a Node id
chungwong opened this issue · 0 comments
chungwong commented
Given an query
query HomeQuery {
viewer {
...home_viewer
id
}
}
fragment home_viewer on Customer {
id
}and a response
{
"data": {
"viewer": {
"id": "Q3VzdG9tZXI6MA=="
}
}
}An error is is encountered.
response_body = Err(
reqwest::Error {
kind: Decode,
source: Error("missing field `id`", line: 1, column: 43),
},
)If id is added along side with the the fragment, i.e.
...home_viewer
idsomehow it cannot decode it. If id is removed then everything is okay.
I can reproduce the same problem in the github example by adding a fragment to the query
query RepoView($owner: String!, $name: String!) {
repository(owner: $owner, name: $name) {
...home_viewer
id
...
}
}
fragment home_viewer on Repository {
id
}