Ramu Hegde
Ramu Hegde

Reputation: 65

Graphql is returing the error as "Can't parse `Array` value, expected array" when I'm trying to run gradle

I'm trying a mutation query in Android using ApolloClient below is my .graphql file

mutation insertAddress($city: String, $landmark: String, $postcode: Int, $state: String, $type: String, $userUuid: String) {
    __typename
    insert_addresses(objects: {city: $city, landmark: $landmark, postcode: $postcode, state: $state, type: $type, userUuid: $userUuid}) {
      returning {
          uuid
      }
   }
}

I'm getting the error as com.sample.app\InsertAddress.graphql (3:30) Can't parse `Array` value, expected array Please help me to solve this error.

Upvotes: 0

Views: 1244

Answers (1)

Vishwas C
Vishwas C

Reputation: 41

Can you try

    mutation insertAddress($city: String, $landmark: String, $postcode: Int, $state: String, $type: String, $userUuid: String) {
    __typename
    insert_addresses(objects: [{city: $city, landmark: $landmark, postcode: $postcode, state: $state, type: $type, userUuid: $userUuid}]) {
      returning {
          uuid
      }
   }
}

Upvotes: 4

Related Questions