Skip to content
KestutisDikinis edited this page Oct 10, 2024 · 10 revisions

Draft of the content for the workshop

Introduction

  • Brief overview of Workshop
  • Goals of the workshop
  • Instruction of use

First Part (evolution)(Kestutis)

  • What is GraphQL
  • GraphQL is a query language for APIs and a runtime for executing those queries by using a type system you define for your data. What does that mean?
  • Imagine you have a waiter at a restaurant (that's your API), and you're the customer (the client). In a typical restaurant, you ask for a full meal, and they bring you everything on the plate, even if you only wanted the side salad or the steak. This is how traditional REST APIs work—they bring you the full set of data, even if you only need a part of it.
  • Now, in a GraphQL restaurant, you can tell the waiter exactly what you want: "I want just the steak and the dessert." The waiter only brings you what you asked for—nothing more, nothing less. GraphQL is like that: it allows you to ask for exactly the data you need from a server, and you get only that, without extra information.
  • In simple terms, GraphQL is a tool for talking to a server in a way that gives you more control over what data you get back, making your life easier by avoiding wasteful or unnecessary information.

  • Why it was developed(Gabriele)
  • GraphQL was developed by Facebook in 2012 to address several limitations and challenges they encountered with REST APIs, particularly as their mobile app became more complex. Here are the key reasons:
  1. Reducing Over-fetching and Under-fetching of Data
  • Over-fetching: REST APIs often return more data than the client needs. For example, when requesting a user’s data, the response might include the full profile, posts, and other unnecessary information.
  • Under-fetching: REST APIs sometimes require multiple requests to get all the needed data. For instance, you might have to fetch a list of users from one endpoint and then make additional requests for each user’s detailed profile.
  • GraphQL was designed to solve this problem by allowing clients to request exactly the data they need, avoiding both over-fetching and under-fetching.

REST API vs GraphQL API(Gabriele)

  • Differences: comparison table
  • Use cases (REST and Graph)

GraphQL 101(Kestutis)

  • GraphQL schema
  • Types, queries
  • Mutations

Building simple GraphQL server(Gabriele)

  • Setting up the server

Advanced concepts overview(Kestutis)

  • Subscriptions
  • Best practices

Q&A

Finito