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

"Can't parse Array value, expected array" error #355

Open
rabyunghwa opened this issue Oct 7, 2020 · 3 comments
Open

"Can't parse Array value, expected array" error #355

rabyunghwa opened this issue Oct 7, 2020 · 3 comments

Comments

@rabyunghwa
Copy link

Hello!

So I followed along with this tutorial and added this:

query getMyTodos {
    todos(where: { is_public: { _eq: false} }, order_by: { created_at: desc }) {
      id
      title
      created_at
      is_completed
  }

to the api.graphql file. But the project failed to build and showed this error:

Failed to parse GraphQL file \app\src\main\graphql\api.graphql (2:54)
Can't parse `Array` value, expected array
----------------------------------------------------
[1]:query getAllPublicTodos {
[2]:  todos(where: { is_public: { _eq: true} }, order_by: { created_at: desc }) {
[3]:    id
----------------------------------------------------

Any help is greatly appreciated!

@Akshay-Nagle
Copy link
Contributor

@rabyunghwa I suggest you watch this [https://youtu.be/e66SASjCncY?t=65]. This might help

@rabyunghwa
Copy link
Author

@Akshay-Nagle Thanks for your help! However, it doesn't cover what I wanted to ask. The provided Android project didn't build. It showed that exact error. Could you or any other Android guy help me look into the issue? Thanks in advance!

@rabyunghwa
Copy link
Author

query GetAllPublicTodos {
  todos(where: {is_public: {_eq: false}}, order_by: {created_at: desc}) {
    id
    title
    created_at
    is_completed
  }
}

[1]:query getAllPublicTodos {
[2]: todos(where: { is_public: { _eq: false} }, order_by: { created_at: desc }) {
[3]: id

This seems to have to do with the second "order_by" query parameter. Although it works with GraphiQL, it doesn't seem to work with Android Apollo (version 2.4.1). Any fix? Is there another way to specify a second parameter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants