2 ms·
As far as I can tell REST has not quite enough structure to allow interesting things. As an API it doesn't allow you to do much more than talk to the thing. Th
by contravariant 7y ago
As far as I can tell REST has not quite enough structure to allow interesting things. As an API it doesn't allow you to do much more than talk to the thing.
The next step up is something like OpenAPI which is still REST but at least it encodes what result you could expect and how the objects are related to each other.
Another step and you've got GraphQL which doesn't just enforce the schema but actually generates your entire API from it (just the interface though not the implementation). It goes from 'this endpoint returns data conforming to this definition' to 'these are the objects I can return and these are their properties'.
By allowing more flexible queries it is possible to encode information into these objects that is impossible to fit in a single JSON (consider e.g. a simple user-management API that returns for each user a list of all the groups they're in and for each group a list of all its users).