0

I am trying to send JSON data for graph ql query JSON DATA:

{
    "dataIds": ["1224rr67-4b3e-473c-80a7-dccc480fb6c0", "28avxrb8-5ff6-45ef-b51b-d4f654321bf8"]
}

GRAPH QL query:

query GetDataByIds($dataIds: [uuid!]) {
  view_data(where: {data_id: {_in: $dataIds}}) {
    data_id
    created_on
    updated_on
  }
}

I am facing issue that as you see above JSON, the array is of type [String] (String array) but when i call Graph QL, it gives me this error:

{
    "path": "$",
    "error": "The variable type for the expected variable dataIds was not supported.",
    "code": "bad-request"
}

It means that [String] is not parsed to [uuid], which i am assuming are equivalent. Is there any way i can convert [String] to [uuid] in graph ql query (I cannot change the Database column which is of type uuid) Anyone having solution, kindly share

Fast Coderz
  • 321
  • 1
  • 13
  • We use a lot of such queries and see no problems with them. Although we use hasura 1.3: do you use hasura 2.x ? – Alex Yu Oct 06 '21 at 03:29

1 Answers1

0

Where those Ids come from? You can check here that these Ids are not valid uuidv4.

So I think Hasura convert the type to String and not use type uuid.

ManUtopiK
  • 4,495
  • 3
  • 38
  • 52
  • In case of bad-fformatted uuids hasura 1.3 returns: "invalid input syntax for type uuid: \"hello\"" (I passed `["hello"]` on input) – Alex Yu Oct 06 '21 at 03:28