#1 2020-11-01 11:58:00

AOG
Member
Registered: 2014-02-24
Posts: 490

GraphQL versus REST

Hello Ab,
Hello All,

There is an ongoing discussion about GraphQL being better (more efficient) than REST.
I would value the opinions of the mORMot boss and users ?

Thanks, Alfred.

Last edited by AOG (2020-11-01 11:58:29)

Offline

#2 2020-11-01 17:06:36

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: GraphQL versus REST

GraphQL is mostly used if you put the logic on the client side.
To my opinion, it is most of time misused as another JavaScript-friendly way of BBM development.

If you follow DDD principles, in most situations the logic would be on the application layer and the domain/kingdom layer.
GraphQL my have some advantages here, if you return mostly undefined json e.g. from TDocVariant. The app layer may use GraphQL to return some data from the domain layer.
In practice, I don't see why GraphQL may be better than our ORM methods to retrieve information. Please enlight me if I am wrong.

As a query API, e.g. for reporting or a general-purpose read/only data endpoint, GraphQL could be a good way to return information.
So I am not against its integration in mORMot 2.

IIRC it is easy to use, but not so easy to implement on the server side.
We already discussed this in the forum since years.
https://synopse.info/forum/viewtopic.ph … 739#p29739
https://synopse.info/forum/viewtopic.php?id=5482

Offline

#3 2020-11-01 20:27:55

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: GraphQL versus REST

Thanks Ab, I have completely overlooked the links you provided.
These provide enough info.
For me, REST is enough. And DDD makes all abstractions worthwile.
The question was based on the fact that Pimcore (a nice PIM) will change its api towards GraphQL. And I am using the mORMot to provide Pimcore some realtime data.

Offline

Board footer

Powered by FluxBB