Ako Suminoe :njp: on Nostr: Not really. At least, if you contort a REST API to do what GraphQL can do, it loses ...
Not really. At least, if you contort a REST API to do what GraphQL can do, it loses the advantages of REST APIs. The singular advantage of a REST API is that they are highly cacheable. The advantage of GraphQL is that it's easier to make querying child objects in a single request, you can add query parameters to a REST API to include specific child objects, but you have to do this specifically for each child object, and it also becomes a new request that can't be cached with the other requests.
Published at
2023-07-10 17:41:26Event JSON
{
"id": "8236a7c589bbee09af8670cdb1fbe95c3ba2e99e657899c10ac82b04a386b25f",
"pubkey": "5f01776c0691515e825871d13aaafc46d807201cb4332c0d7112c3386ffb2e24",
"created_at": 1689010886,
"kind": 1,
"tags": [
[
"p",
"262d5a8a8201b6e0804087a9d26929935c7ac6682875b13fe24a5314a04a6cbf",
"wss://relay.mostr.pub"
],
[
"p",
"79c2cae114ea28a981e7559b4fe7854a473521a8d22a66bbab9fa248eb820ff6",
"wss://relay.mostr.pub"
],
[
"e",
"4c4b15037c9935084dcc40c3ce25b2b461b4e4d0a1a8882a378bf858d10f782c",
"wss://relay.mostr.pub",
"reply"
],
[
"mostr",
"https://poa.st/objects/1d2ecdd7-f90b-4978-9462-ec9c9957266b"
]
],
"content": "Not really. At least, if you contort a REST API to do what GraphQL can do, it loses the advantages of REST APIs. The singular advantage of a REST API is that they are highly cacheable. The advantage of GraphQL is that it's easier to make querying child objects in a single request, you can add query parameters to a REST API to include specific child objects, but you have to do this specifically for each child object, and it also becomes a new request that can't be cached with the other requests.",
"sig": "d52eaee0fca5d09bebe9423b3fd31a29e942b1e824d376ed1b9fd6dc784d516330bbe8c75d93cae2f676ae4e372d763ec30aff039dfa423698a10a91c9e80090"
}