# GraphQL - A Practical Overview and Hands-On Tutorial

DevFeed: [GraphQL - A Practical Overview and Hands-On Tutorial](<https://devfeed.tech/articles/graphql-a-practical-overview-and-hands-on-tutorial-24984.md>)

Original publisher: [Read original article](<https://codeahoy.com/2019/10/13/graphql-practical-tutorial/>)

Author: umer

Published: 2019-10-13T00:00:00Z

Content type: tutorial

Language: en

Sources: [Code Ahoy - Articles](<https://devfeed.tech/sources/code-ahoy-articles.md>)

Topics: [GraphQL](<https://devfeed.tech/topics/graphql.md>), [API](<https://devfeed.tech/topics/api.md>), [REST API](<https://devfeed.tech/topics/rest-api.md>), [Tutorial](<https://devfeed.tech/topics/tutorial.md>), [data](<https://devfeed.tech/topics/data.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [apis](<https://devfeed.tech/tags/apis.md>), [article](<https://devfeed.tech/tags/article.md>), [data](<https://devfeed.tech/tags/data.md>), [graphql](<https://devfeed.tech/tags/graphql.md>), [rest](<https://devfeed.tech/tags/rest.md>), [rest-api](<https://devfeed.tech/tags/rest-api.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

## AI overview

A hands-on introduction to GraphQL, explaining how it lets clients query a single API endpoint for precisely the data they need. The article contrasts this approach with the rigidity and over-fetching risks of traditional REST APIs and uses practical examples for beginners.

## Source excerpt

GraphQL is a Query Language for APIs. It provides a fresh and modern approach to fetching (and manipulating) data from APIs when compared to traditional methods such as REST. Its power comes from the ability to let clients talk to a single endpoint and specify precisely what data they need. That's very powerful indeed. This blog post is a hands-on introduction to GraphQL and its important features. When I first encountered GraphQL (we're switching public REST APIs to GraphQL,) coming from REST background, I was baffled. 'Where's the list of API end-points?', 'Is the list of fields documented somewhere?' So I decided to write this article not as a comprehensive overview that deep-dives into internals, but rather to give an understanding of what GraphQL is and how to use it using real examples. It assumes no previous knowledge of GraphQL. Let's get started. GraphQL - An Overview GraphQL - or more specifically - the data query language specification and the runtime for it - was developed by Facebook. It was opened sourced it in 2015, after a few years of internal use at Facebook. What inspired the need for GraphQL? Here's an excerpt from the Facebook engineering blog: As we transitioned to natively implemented models and views, we found ourselves for the first time needing an API data version of News Feed -- which up until that point had only been delivered as HTML. We evaluated our options for delivering News Feed data to our mobile apps, including RESTful server resources ... We were frustrated with the differences between the data we wanted to use in our apps and the server queries they required. Once you build and expose a REST API, it's pretty rigid. For example, suppose we have built a News Feed RESTful API which is returning 10 attributes for each item in the news feed. Down the road, you are building a mobile app for low-tier devices that don't have the screen real-estate to show the news feed in all its glory. So instead of showing all 10 attributes for each news