Differences between REST&GraphQL -- my view

Original Post: https://notes.bbish.net/blog/post/yarco/REST-and-GraphQL-my-view

It was said that GraphQL is the replacement of REST. But after I read a bit on GraphQL, I actually feel it is an extension to REST. 

The Point of Using GraphQL

Just like the name GraphQL, I think its aim is for fetching data – A Query Language. You have rare time on updating several different entities the same time, so REST CUD(Create, Update and Delete) is totally enough. 

One of the advantages of using GraphQL’s is the agility of getting data. That is the point of using GraphQL. 

The Usage of the Both

For the agility of getting data in GraphQL, it is obviously good for the situation of fast prototype and quick improvements circle at the client end. If your app is done in native language, I don’t think you will upgrade it so often. I mean: 

  • GraphQL is good for H5 apps & the web (they can be changed quite often)
  • REST is good for native apps

Language Level

GraphQL is in some way a standalone language. But REST is just using HTTP keywords. How does that affect your usage? 

For example, you need to define types in GraphQL. But if you are using some backend programming languages, why you can not reuse those classes defined in those languages? ex.: the PHP class. 

Because normally those backend programming languages are too powerful that they have strong language feature like the namespace. So that classes in those languages are hard to be distinguished at the client end. It is unnecessary for the client end to know the class name in the backend. 





I'm going to add GraphQL like feature in REST API in Symfony though...(But maybe no one would use it for it is not a standard)

Like
Reply

But maybe you have other thinkings on the both.

Like
Reply

To view or add a comment, sign in

More articles by Yarco Wang

  • My First glance at AutoAI in Watson Studio

    First of all, let me introduce myself, I am not an expert in the area of Data Science, and even didn't graduate from…

  • Surface: a new programming language design view

    This article is not going to introduce another programming language, but, a new view on designing a programming…

    2 Comments
  • Evolution of the Open Source development: Using Blockchain

    We’ve once created open source projects for fun or they are just the side projects during working. Those projects may…

    1 Comment
  • Namespace: right and wrong between PHP and Node.js

    I have learned both PHP and Node.js, there are something I want to say according to the design of the concept…

  • Yin- Yang and Coexistence Theory

    Abstract Game theory(see 1.) is discovered by John von Neumann, mainly focus on the rela- tionships between competitors.

    2 Comments
  • html5 - suggestion of new element and attribute `greyarea`

    There are different types of resources in internet, from article to video. Normally, when we publish a resource, we…

  • Why we work 5 days a week

    I always feel unhappy or losing inspiration during a job in some company. And of cause, we need job to live.

  • Sex, Yin-yang And Family

    The basic axiom in natural is everything try to keep balance, like Swing or pendulum, always goes from one side to…

    1 Comment
  • Data structure and society

    When i'm trying to solve the problem (or at least on the first step ): My Question and when i review the book i bought…

Explore content categories