Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Facing issues while querying an API with certain fields but getting an array in response. #91

Closed
debdiptahalder-4tigo opened this issue Sep 3, 2019 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@debdiptahalder-4tigo
Copy link

debdiptahalder-4tigo commented Sep 3, 2019

Hi I am trying to query an API which is of the following format.
query{ requestallstudentdata{ id name hobby } }
In response we get something like following:
`{
"data": {
"requestallstudentdata": [
{
"id": 1,
"name":"xyz",
"hobby":"fxdu"

  },
  {
  "id": 2,
    "name":"xYz",
    "hobby":"fdu"
  }
]

}
}`

How to handle such requests.Please assist.
Currently I have the following classes.

I am getting the following response whenever I am trying to send a list.

GraphQLException{message='OK', status='200', description='Can not deserialize instance of com.graphql.model.foo.StudentDetails out of START_ARRAY token
 at [Source: N/A; line: -1, column: -1] (through reference chain: io.aexp.nodes.graphql.Wrapper["data"])', errors=null}

@chemdrew
Copy link
Contributor

chemdrew commented Sep 3, 2019

ah yeah, querying lists isn't super clear. The same solution in #26 should work here as well.

@chemdrew chemdrew closed this as completed Sep 3, 2019
@chemdrew chemdrew added the duplicate This issue or pull request already exists label Sep 3, 2019
@debdiptahalder-4tigo
Copy link
Author

debdiptahalder-4tigo commented Sep 3, 2019 via email

@tkosik12
Copy link

tkosik12 commented Jun 7, 2022

@debdiptahalder-4tigo could you tell me what was the solution? If you found it of course.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants