How to restore the data marked as trash

Sometimes you may want to restore the data marked as trash.

Now, let’s see how to do that.

  • The untrash function removes the trash marker from the records.
    untrash(type: HypiMutationType!, arcql: String!): Int!
  • ArcQL filter is used to select the records to be untrashed

Just like the previous post, we will work with the same ReadObject data type here.

type ReadObject {
   field1: String
   field2: Int
}

Sample Query

mutation {
  untrash(type: ReadObject, arcql: "hypi.id = '01FH5MKT5ZXHA7KNKTAK48H6KP'")
}
#result
{
  "data": {
    "untrash": 1
  }
}

Output

The untrash function returns the number of records untrashed.

Query with Variables

mutation untrashObject($type: HypiMutationType!, $arcql: String!) {
  untrash(type: $type, arcql: $arcql)
}

#query variables
{
  "type": "ReadObject",
  "arcql": "hypi.id = '01FH5MKT5ZXHA7KNKTAK48H6KP'"
}   

Please note query variables has the form of JSON.

Check the POSTMAN collection for the untrash requests in different programming languages! Click </> and choose the programming language of your choice.
Don’t forget to insert your own Authorization key and Hypi Domain under Headers to test the results!

Run in Postman