My Products
Help
Florian Haase
PARTNER

GraphQL vs Rest

by Florian Haase

Hi,

 

just wondered if someone here has any opinions about GraphQL vs Rest. Is GraphQL taking over for Rest? Is this getting the new standard?

 

Florian

 

 

1 REPLY 1
adrianm
PARTNER

by adrianm

I see it in the same way as stored procedures vs queries when dealing with database access.

 

There are cases where it is ok to expose your internal data structure. Adding an extra layer can then be an unnecessary maintenance burden.

GraphQL and similar interfaces will play a role in places where you control the entire chain from data- to presentation layer.

 

But I don't think it is a good fit for general API:s where you give 3rd parties access to your functionality. It puts to much burden on the consumers for understanding your data model. If you have ever had to use an OData interface into someone else's system you know what I mean 🙂

 

You can of course create a GraphQL API which is independent from your data model but then I'm not sure what you really gain compared to REST.

 

(Disclaimer: I create REST interfaces at least every month and the design goal is always to expose an API which makes sense for the consumer independent of the data layout. Have also created OData interfaces in the past and found that it worked best for reporting and other data extraction scenarios. Many BI tools can read OData out of the box and I assume it is the same for GraphQL)