Like most technologies it depends on how you're using it. When I first starting working in GraphQL, paired with a React frontend I used it in an a similar way to REST, pull the data and then do all the logic of what to display on the frontend. For me I saw the most benefit when I used the schema to define what to display in the frontend, all the logic of what to display is done on the server and my frontend just beco…
I didn't fully understand what your meant (as I haven't used graphql much), so I asked ChatGPT to explain. It did a decent job, so I figure the answer might help others as well: https://chat.openai.com/share/d708cc93-e920-4b83-b372-83248e...
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"
}
]
},
...
}
],
...
}
}
}