LEARN GRAPHQL

Introduction

GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL was developed internally by Facebook in 2012 before being publicly released in 2015.

GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.

Why learn GraphQL?

  1. No more client-specific endpoints: To make your REST API efficient, you often need to write endpoints tailored to a specific consumer. With GraphQL, each client can get just what it needs.
  2. Don't worry about outdated docs: Don't worry about outdated docs
  3. Understand how your API is used: Consumers of your GraphQL API specify what they are going to use, giving you fine-grained understanding of exactly which fields are used and by whom.

Features

  1. Ask for what you need, get exactly that: Send a GraphQL query to your API and get exactly what you need, nothing more and nothing less. GraphQL queries always return predictable results. Apps using GraphQL are fast and stable because they control the data they get, not the server.
  2. Get many resources in a single request: GraphQL queries access not just the properties of one resource but also smoothly follow references between them. While typical REST APIs require loading from multiple URLs, GraphQL APIs get all the data your app needs in a single request. Apps using GraphQL can be quick even on slow mobile network connections.
  3. Describe what’s possible with a type system: GraphQL APIs are organized in terms of types and fields, not endpoints. Access the full capabilities of your data from a single endpoint. GraphQL uses types to ensure Apps only ask for what’s possible and provide clear and helpful errors. Apps can use types to avoid writing manual parsing code.
  4. Evolve your API without versions: Add new fields and types to your GraphQL API without impacting existing queries. Aging fields can be deprecated and hidden from tools. By using a single evolving version, GraphQL APIs give apps continuous access to new features and encourage cleaner, more maintainable server code.

Topics to cover

Basics

  • Schema
  • Resolvers
  • Basic & Object Types
  • Queries
  • Mutations
  • Testing queries and mutations

Intermediate

  • Type Relations
  • Connecting with database
  • Client(frontend) integration using Apollo
  • Fetching & Refetching queries from client
  • Sending mutations from client

Advanced

  • Middlewares
  • Authentication
  • Constructing type

Resources to learn & code projects

That's it from this blog post. If you liked it then do share this blog with your friends or people who wanna get into programming world. Thank You!

Copyright © NStF Blogs 2021