|
|
|
|
|
by xmatos
3259 days ago
|
|
Why use GraphQL? Why not simply expose one endpoint that takes a sql data parameter, queries the db and return the result set as json? Yes, you'd have to setup db security to allow those db commands to run only selects and restrict which tables are allowed to be queried. How can using a new json query language, without any server libraries targetting relational databases be better than that? How much work would be envolved to implement this on the server side and for what, exactly? to allow frontend devs to query without exposing separate endpoints? Client-server applications should not run business code on the client. The only code that should run on the client is the UI's. Sorry, this is simply wrong. |
|
To your other points:
* no matter what you do to expose an API you have to set up security
* there are already server side solutions that help enormously with implementing your own endpoint
* I don't see the logic behind your client-server opinion. You seem to say that the server should be defining the data that the client needs.