top | item 36223298

(no title)

itsjustjordan | 2 years ago

I'll flesh out my comment a bit more with a small example of what I mean.

We have an inbox list that is a combination of three different entities (direct message, job request, support message), we display all of these in a unified inbox, rather than pulling all the data with REST and sorting through what fields to use to display as a title and what status maps to which styling/label etc. I can just use my InboxPageQuery and render exactly what it tells me to, being able to build or change entire pages just by pushing new server code really helps with speeding up our dev time.

  {
    "data": {
      "inbox": {
        ...
        "inboxItems": [
          {
            ...
            "subtitle1": {
              "__typename": "InboxStandardText",
              "accessibilityText": "Hi Jordan.\n\nSarah has posted a handyman job near you",
              "components": [
                {
                  "__typename": "InboxStandardTextComponent",
                  "text": "Hi Jordan.\n\nSarah has posted a handyman job near you...",
                  "type": null
                }
              ]
            },
            "subtitle2": {
              "__typename": "InboxStandardText",
              "accessibilityText": "You declined this job today",
              "components": [
                {
                  "__typename": "InboxStandardTextComponent",
                  "text": "Declined",
                  "type": "errored_text"
                },
                {
                  "__typename": "InboxStandardTextComponent",
                  "text": " ยท ",
                  "type": "errored_text"
                },
                {
                  "__typename": "InboxStandardTextComponent",
                  "text": "07/06/23",
                  "type": "errored_text"
                }
              ]
            },
            ...
          }
        ],
        ...
      }
    }
  }

discuss

order

No comments yet.