How to store / save data in an instance

In the previous post, we’ve seen the functions of the magic hypi object. Now, we will see how to create /save data into an object.

  • upsert function does the job of inserting data in an object.

upsert (values: HypiUpsertUnion!) : [Hypi!] !

  • The plural argument values creates multiple values in a single request.
  • Pass on data from the User Interface in the form of JSON and into the variable values.

Let’s insert data into the Object1 data type below. It contains different kinds of fields.

type Object1 {
    field1: String
    field2: Int
    field3: Boolean
    field4: Float
    field5: Json
    field6: DateTime
    field7: [Object2]
    field8: [Int]
    field9: UUID
type Object2 {
    fld1: String

*** field7 is an array of type Object2. We can store objects inside this array. Either we can save the values directly or save of the objects.

Sample Query

mutation {
    values: {
      Object1: [
          field1: "The future is low code!"
          field2: 3
          field3: false
          field4: 4.6
          field5: { fld1: "Low Code Platform", fld2: "" }
          field6: "2021-05-07"
          field7: [
            { fld1: "Hypi's low code platform" }
            { fld1: "Use Serverless" }
          field9: "bfcf282c-b7a4-11eb-8529-0242ac130003"
          field8: [1, 2, 3]
  ) {
  "data": {
    "upsert": [
        "id": "01FGK951GC9YB02HHDYESG04QA"


id value from the hypi object gets returned as the data gets added to the object successfully.
Data goes to the data root as shown in the response.

Query with Variables

mutation Upsert($values: HypiUpsertInputUnion!) {
    upsert(values: $values) {
  "values": {
      "Object1": [
          "field1": "The future is low code!",
          "field2": 3,
          "field3": false,
          "field4": 4.6,
          "field5": {"fld1": "Low Code Platform","fld2": "" }, 
          "field6": "2021-05-07",
          "field7": [
            { "fld1": "Hypi's low code platform" },
            { "fld1": "Use Serverless" }
          "field9": "bfcf282c-b7a4-11eb-8529-0242ac130003",
          "field8": [1, 2, 3]

Please note values data has the form of JSON.

Check the POSTMAN collection for the upsert 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