3

GraphQL Essentials

 4 years ago
source link: https://dzone.com/refcardz/an-overview-of-graphql?chapter=1
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Section 1

The Evolution of GraphQL

GraphQL is a language-independent specification for client-server communication. It is declarative (i.e., empowers developers to specify what needs to be fetched rather than how) and also serves as a runtime or fulfilling queries with your data.

In 2012, Facebook decided to revamp its native mobile apps as those for iOS and Android were just thin wrappers around the views of the mobile website and often crashed by multiple REST calls. This was a solution to overcome the disadvantages of REST, which paved a way to the birth of what we know as GraphQL. Today, GraphQL powers almost all of Facebook’s data fetching and is used in production by organizations such as IBM, Intuit, GitHub, and Airbnb.

Benefits of GraphQL

Benefit Description Suitable for complex systems and microservices GraphQL unifies multiple systems behind a single API, thus encapsulating the complexity of each system. Data fetching with a single API call GraphQL is typically served over HTTP via a single endpoint that expresses the full set of capabilities of the service. Autogenerating API documentation The GraphQL API is tightly coupled with code, so once a field, type, or query changes, so do the docs. Versionless API evolution GraphQL eliminates the need for versioning by deprecating APIs on a field level. Aging fields can be later removed from the schema without impacting the existing queries. Shared query logic (Fragment) Fragments can be visualized as functions in programming languages. A GraphQL Fragment is a reusable unit of a GraphQL query, which creates a shared piece of query logic. Over-fetching and under-fetching problems resolved GraphQL lets the front end fetch only the data needed.

This is a preview of the GraphQL Essentials Refcard. To read the entire Refcard, please download the PDF from the link above.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK