Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot decode when fragment contains a Node id #442

Open
chungwong opened this issue Jan 3, 2023 · 0 comments
Open

Cannot decode when fragment contains a Node id #442

chungwong opened this issue Jan 3, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@chungwong
Copy link

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
    id

somehow 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
}
@tomhoule tomhoule added the bug Something isn't working label Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants