GraphQL
Mohammed Shaban
Senior Software Engineer
ShabaanCIS@gmail.com
https://www.linkedin.com/in/mohammed-shaban-60b4b4113/
About me
Senior Software Engineer with 10+ years in analysis, design, development, testing, Agile, DevOps and
implementation of various Internet-based applications.
Experienced with all stages of the development cycle for dynamic web projects solutions are based on the
Microsoft stack including SQL Server, C#, ASP.NET MVC, Visual Studio, HTML5, CSS3 etc. while leveraging the
open source technologies such as jQuery, Bootstrap, Less, and others.
Strong background in management and leadership.
A proved leader with excellent interpersonal and motivational abilities to develop collaborative relationships
among high functioning teams.
Exceptional problem solver with an aptitude for troubleshooting and the ability to quickly master the new
skill, technology, or role.
GraphQL API Gateway and microservices
Think GraphQL
GraphQL in a nutshel
GraphQL is a syntax that describes how to ask for data, and is generally used to load data from a server to a
client. GraphQL has three main characteristics:
• It lets the client specify exactly what data it needs.
• It makes it easier to aggregate data from multiple sources.
• It uses a type system to describe data.
GraphQL Users
GraphQL History
GraphQL was developed internally by Facebook in 2012 before being publicly released in 2015. On 7
November 2018, the GraphQL project was moved from Facebook to the newly-established GraphQL
foundation, hosted by the non-profit Linux Foundation.
Imagine you need to display a list of posts, and under each post a list of likes, including user names. Easy
enough, you tweak your posts API to include a likes array containing user objects
Posts
Likes
Traditional REST APIs
Background
The Solution
Instead of having multiple “dumb” endpoints, have a single “smart” endpoint that can take in complex
queries, and then massage the data output into whatever shape the client requires.
The GraphQL layer lives between the client
and one or more data sources, receiving
client requests and fetching the necessary
data according to your instructions.
The Client can retrieve the data it needs in a
single round-trip to the API gateway.
• A GraphQL schema is a strongly typed schema.
• GraphQL speaks to the data as a Graph, and data is naturally a graph.
• GraphQL has a declarative nature for expressing data requirements.
• GraphQL solved the multiple round-trip problem.
GraphQL magic
GraphQL API Gateway and microservices
Query
A GraphQL query is the client application request to retrieve data from database or legacy API's.
Resolver
Schema
A GraphQL schema is at the center of any GraphQL server implementation and describes the functionality
available to the clients which connect to it.
Resolvers
provide the instructions for turning a GraphQL operation into data. They resolve the query to data by
defining resolver functions.
Components
GraphQL queries
• GraphQL document: A string written in the GraphQL language that defines one or more operations and
fragments.
• Operation: A single query, mutation, or subscription that can be interpreted by a GraphQL execution
engine.
• Field: A unit of data you are asking for, which ends up as a field in your JSON response data.
• Arguments: A set of key-value pairs attached to a specific field. These are passed into the server-side
execution of this field, and affect how it’s resolved.
GraphQL queries Cont.
Operation type: This is either query, mutation, or subscription.
Operation name: For debugging and server-side logging reasons, it’s useful to give your queries meaningful
names.
Variable definitions: When you send a query to your GraphQL server, you might have some dynamic parts
that change between requests, while the actual query document stays the same. These are the variables of
your query.
Variables: The dictionary of values passed along with a GraphQL operation, that provides dynamic
parameters to that operation.
GraphQL queries Cont.
Selection set: A set of fields requested in an operation, or nested within another field. A GraphQL query must
contain a selection set on any field that returns an object type, and selection sets are not allowed on fields
that return scalar types, such as Int or String.
Fragments
Fragment definition: Part of a GraphQL document which defines a GraphQL fragment. This is also sometimes
called a named fragment, in contrast to an inline fragment.
Fragment name: The name of each fragment has to be unique within a GraphQL document. This is the name
you use to refer to the fragment in an operation or in other fragments.
Type condition: GraphQL operations always start at the query, mutation, or subscription type in your schema,
but fragments can be used in any selection set.
Fragments
Fragment spread: When you use a fragment inside an operation or another fragment, you do so by putting ...
followed by the fragment name. This is called a fragment spread, and it can appear in any selection set that
matches that named fragment’s type condition.
Inline fragment: When you just want to execute some fields depending on the type of a result, but you don’t
want to split that out into a separate definition, you can use an inline fragment.
Directives
Directive: An annotation on a field, fragment, or operation that affects how it is executed or returned.
Directive arguments: These work just like field arguments, but they are handled by the execution engine
instead of being passed down to the field resolver.
@include(if: Boolean) Only include this field in the result if the argument is true.
@skip(if: Boolean) Skip this field if the argument is true.
Pagination
There are a number of ways we could do pagination:
• We could do something like friends(first:2 offset:2) to ask for
the next two in the list.
• We could do something like friends(first:2 after:$friendId), to
ask for the next two after the last friend we fetched.
• We could do something like friends(first:2
after:$friendCursor), where we get a cursor from the last item
and use that to paginate.
Mutation
Same as query behavior but aims to Insert-Update-Delete
Samples
1-Sample Query
2-Query with args
3-Aliace
4-Fragments
Samples Cont.
4-Fragments
{
"data": {
"leftComparison": {
"name": "Luke Skywalker",
"appearsIn": ["NEWHOPE", "EMPIRE", "JEDI"],
"friends": [ {"name": "Han Solo"}, {"name": "Leia Organa"}, {"name":
"C-3PO"}, {"name": "R2-D2"}]},
"rightComparison": {
"name": "R2-D2",
"appearsIn": ["NEWHOPE","EMPIRE","JEDI"],
"friends": [{"name": "Luke Skywalker"},{"name": "Han Solo"},
{"name": "Leia Organa"}]}
}
}
Samples Cont.
5-Inline Fragments
Samples Cont.
6-Directives
Samples Cont.
7-Mutation
GraphQL Schema
A GraphQL schema is at the center of any GraphQL server implementation and describes the functionality
available to the clients which connect to it.
The core building block within a schema is the “type”. Types provide a wide-range of functionality within a
schema, including the ability to:
• Create relationships between types (e.g. between a Book and an Author).
• Define which data-fetching (querying) and data-manipulation (mutating) operations can be executed by
the client.
• If desired, self-explain what capabilities are available to the client (via introspection).
GraphQL Schema Types
Scalar types
Scalar types represent the leaves of an operation and always resolve to concrete data. The default scalar
types which GraphQL offers are:
Int: Signed 32‐bit integer
• Float: Signed double-precision floating-point value
• String: UTF‐8 character sequence
• Boolean: true or false
• ID (serialized as String): A unique identifier, often used to refetch an object or as the key for a cache. While
serialized as a String, ID signifies that it is not intended to be human‐readable
GraphQL Schema Types Cont.
Object types
The object type is the most common type used in a schema and represents a group of fields. Each field inside
of an object type maps to another type, allowing nested types and circular references.
GraphQL Schema Types Cont.
The Query type
A GraphQL query is for fetching data and compares to the GET verb in REST-based APIs.
Schema
Request
Response
GraphQL Schema Types Cont.
The Mutation type
Mutations are operations sent to the server to create, update or delete data.
Schema
Request Response
GraphQL Schema Types Cont.
The Interface type
An Interface is an abstract type that includes a certain set of fields that a type must include to implement the
interface.
GraphQL Schema Types Cont.
The Subscriptions type
GraphQL subscriptions are a way to push data from the server to the clients that choose to listen to real time
messages from the server. Subscriptions are similar to queries in that they specify a set of fields to be
delivered to the client, but instead of immediately returning a single answer, a result is sent every time a
particular event happens on the server.
why GraphQL is great for real-time apps:
• Live-queries (subscriptions) are an implicit part of the GraphQL specification. Any GraphQL system has to
have native real-time API capabilities.
• A standard spec for real-time queries has consolidated community efforts around client-side tooling,
resulting in a very intuitive way of integrating with GraphQL APIs.
GraphQL Advantages
• Declarative Data Fetching
• No Over fetching with GraphQL
• Single Source of Truth
• GraphQL embraces modern Trends
• GraphQL Schema Stitching
• GraphQL Introspection
• Strongly Typed GraphQL
• GraphQL Versioning
• A growing GraphQL Ecosystem
GraphQL Disadvantages
• GraphQL Query Complexity
• GraphQL Caching
• GraphQL security
GraphQL Trend
GraphQL Vs. Falcor
While Falcor is easier to learn and write, GraphQL has a steeper learning curve,
but is more powerful.
Thank you

More Related Content

PPTX
Introduction to GraphQL
PPTX
An intro to GraphQL
PDF
Intro to GraphQL
PDF
GraphQL: Enabling a new generation of API developer tools
PDF
REST vs GraphQL
PPT
Graphql presentation
PDF
Better APIs with GraphQL
PPTX
Introduction to GraphQL
Introduction to GraphQL
An intro to GraphQL
Intro to GraphQL
GraphQL: Enabling a new generation of API developer tools
REST vs GraphQL
Graphql presentation
Better APIs with GraphQL
Introduction to GraphQL

What's hot (20)

PDF
GraphQL Fundamentals
PDF
Introduction to GraphQL
PDF
How to GraphQL
PPTX
Introduction to graphQL
PDF
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
PPTX
Introduction to GraphQL Presentation.pptx
PDF
GraphQL
PDF
React & GraphQL
PPTX
REST API Design & Development
PPTX
GraphQL Introduction
PDF
GraphQL vs REST
PPTX
introduction about REST API
PDF
Tutorial: Building a GraphQL API in PHP
PDF
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
PDF
PDF
Getting Started with Spring for GraphQL
PDF
Graphql
PPTX
PDF
Spring GraphQL
PDF
Microservices with Java, Spring Boot and Spring Cloud
GraphQL Fundamentals
Introduction to GraphQL
How to GraphQL
Introduction to graphQL
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
Introduction to GraphQL Presentation.pptx
GraphQL
React & GraphQL
REST API Design & Development
GraphQL Introduction
GraphQL vs REST
introduction about REST API
Tutorial: Building a GraphQL API in PHP
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
Getting Started with Spring for GraphQL
Graphql
Spring GraphQL
Microservices with Java, Spring Boot and Spring Cloud
Ad

Similar to GraphQL API Gateway and microservices (20)

PDF
GraphQL with .NET Core Microservices.pdf
PDF
PPTX
Introduction to Testing GraphQL Presentation
PPTX
Testing Graph QL Presentation (Test Automation)
PPTX
CONDG April 23 2020 - Baskar Rao - GraphQL
PDF
How easy (or hard) it is to monitor your graph ql service performance
DOCX
GraphQL Advanced Concepts A Comprehensive Guide.docx
DOCX
Graphql for Frontend Developers Simplifying Data Fetching.docx
DOCX
How to Deploy a GraphQL API A Comprehensive Guide.docx
PDF
GraphQL and its schema as a universal layer for database access
PDF
Apollo Server
PDF
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
PPTX
GraphQL research summary
PDF
GraphQL across the stack: How everything fits together
PDF
Simplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) Extension
PDF
What is GraphQL: Best Practices
PDF
Modern APIs with GraphQL
PPTX
GraphQL_devoxx_2023.pptx
PDF
GraphQL 101
PDF
GraphQL + relay
GraphQL with .NET Core Microservices.pdf
Introduction to Testing GraphQL Presentation
Testing Graph QL Presentation (Test Automation)
CONDG April 23 2020 - Baskar Rao - GraphQL
How easy (or hard) it is to monitor your graph ql service performance
GraphQL Advanced Concepts A Comprehensive Guide.docx
Graphql for Frontend Developers Simplifying Data Fetching.docx
How to Deploy a GraphQL API A Comprehensive Guide.docx
GraphQL and its schema as a universal layer for database access
Apollo Server
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
GraphQL research summary
GraphQL across the stack: How everything fits together
Simplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) Extension
What is GraphQL: Best Practices
Modern APIs with GraphQL
GraphQL_devoxx_2023.pptx
GraphQL 101
GraphQL + relay
Ad

Recently uploaded (20)

PPTX
Folder Lock 10.1.9 Crack With Serial Key
PDF
Building an Inclusive Web Accessibility Made Simple with Accessibility Analyzer
PPTX
SmartGit 25.1 Crack + (100% Working) License Key
PPTX
A Spider Diagram, also known as a Radial Diagram or Mind Map.
PDF
Sanket Mhaiskar Resume - Senior Software Engineer (Backend, AI)
PDF
Cloud Native Aachen Meetup - Aug 21, 2025
PDF
CapCut PRO for PC Crack New Download (Fully Activated 2025)
PDF
Bright VPN Crack Free Download (Latest 2025)
PPTX
ESDS_SAP Application Cloud Offerings.pptx
PPTX
Chapter 1 - Transaction Processing and Mgt.pptx
PPTX
Bandicam Screen Recorder 8.2.1 Build 2529 Crack
PDF
Streamlining Project Management in Microsoft Project, Planner, and Teams with...
PPTX
Post-Migration Optimization Playbook: Getting the Most Out of Your New Adobe ...
PDF
Mobile App Backend Development with WordPress REST API: The Complete eBook
PPTX
HackYourBrain__UtrechtJUG__11092025.pptx
PDF
IT Consulting Services to Secure Future Growth
PPTX
DevOpsDays Halifax 2025 - Building 10x Organizations Using Modern Productivit...
PDF
Mobile App for Guard Tour and Reporting.pdf
PDF
SOFTWARE ENGINEERING Software Engineering (3rd Edition) by K.K. Aggarwal & Yo...
PDF
Ragic Data Security Overview: Certifications, Compliance, and Network Safegua...
Folder Lock 10.1.9 Crack With Serial Key
Building an Inclusive Web Accessibility Made Simple with Accessibility Analyzer
SmartGit 25.1 Crack + (100% Working) License Key
A Spider Diagram, also known as a Radial Diagram or Mind Map.
Sanket Mhaiskar Resume - Senior Software Engineer (Backend, AI)
Cloud Native Aachen Meetup - Aug 21, 2025
CapCut PRO for PC Crack New Download (Fully Activated 2025)
Bright VPN Crack Free Download (Latest 2025)
ESDS_SAP Application Cloud Offerings.pptx
Chapter 1 - Transaction Processing and Mgt.pptx
Bandicam Screen Recorder 8.2.1 Build 2529 Crack
Streamlining Project Management in Microsoft Project, Planner, and Teams with...
Post-Migration Optimization Playbook: Getting the Most Out of Your New Adobe ...
Mobile App Backend Development with WordPress REST API: The Complete eBook
HackYourBrain__UtrechtJUG__11092025.pptx
IT Consulting Services to Secure Future Growth
DevOpsDays Halifax 2025 - Building 10x Organizations Using Modern Productivit...
Mobile App for Guard Tour and Reporting.pdf
SOFTWARE ENGINEERING Software Engineering (3rd Edition) by K.K. Aggarwal & Yo...
Ragic Data Security Overview: Certifications, Compliance, and Network Safegua...

GraphQL API Gateway and microservices

  • 1. GraphQL Mohammed Shaban Senior Software Engineer [email protected] https://www.linkedin.com/in/mohammed-shaban-60b4b4113/
  • 2. About me Senior Software Engineer with 10+ years in analysis, design, development, testing, Agile, DevOps and implementation of various Internet-based applications. Experienced with all stages of the development cycle for dynamic web projects solutions are based on the Microsoft stack including SQL Server, C#, ASP.NET MVC, Visual Studio, HTML5, CSS3 etc. while leveraging the open source technologies such as jQuery, Bootstrap, Less, and others. Strong background in management and leadership. A proved leader with excellent interpersonal and motivational abilities to develop collaborative relationships among high functioning teams. Exceptional problem solver with an aptitude for troubleshooting and the ability to quickly master the new skill, technology, or role.
  • 5. GraphQL in a nutshel GraphQL is a syntax that describes how to ask for data, and is generally used to load data from a server to a client. GraphQL has three main characteristics: • It lets the client specify exactly what data it needs. • It makes it easier to aggregate data from multiple sources. • It uses a type system to describe data.
  • 7. GraphQL History GraphQL was developed internally by Facebook in 2012 before being publicly released in 2015. On 7 November 2018, the GraphQL project was moved from Facebook to the newly-established GraphQL foundation, hosted by the non-profit Linux Foundation.
  • 8. Imagine you need to display a list of posts, and under each post a list of likes, including user names. Easy enough, you tweak your posts API to include a likes array containing user objects Posts Likes Traditional REST APIs Background
  • 9. The Solution Instead of having multiple “dumb” endpoints, have a single “smart” endpoint that can take in complex queries, and then massage the data output into whatever shape the client requires. The GraphQL layer lives between the client and one or more data sources, receiving client requests and fetching the necessary data according to your instructions. The Client can retrieve the data it needs in a single round-trip to the API gateway.
  • 10. • A GraphQL schema is a strongly typed schema. • GraphQL speaks to the data as a Graph, and data is naturally a graph. • GraphQL has a declarative nature for expressing data requirements. • GraphQL solved the multiple round-trip problem. GraphQL magic
  • 12. Query A GraphQL query is the client application request to retrieve data from database or legacy API's. Resolver Schema A GraphQL schema is at the center of any GraphQL server implementation and describes the functionality available to the clients which connect to it. Resolvers provide the instructions for turning a GraphQL operation into data. They resolve the query to data by defining resolver functions. Components
  • 13. GraphQL queries • GraphQL document: A string written in the GraphQL language that defines one or more operations and fragments. • Operation: A single query, mutation, or subscription that can be interpreted by a GraphQL execution engine. • Field: A unit of data you are asking for, which ends up as a field in your JSON response data. • Arguments: A set of key-value pairs attached to a specific field. These are passed into the server-side execution of this field, and affect how it’s resolved.
  • 14. GraphQL queries Cont. Operation type: This is either query, mutation, or subscription. Operation name: For debugging and server-side logging reasons, it’s useful to give your queries meaningful names. Variable definitions: When you send a query to your GraphQL server, you might have some dynamic parts that change between requests, while the actual query document stays the same. These are the variables of your query. Variables: The dictionary of values passed along with a GraphQL operation, that provides dynamic parameters to that operation.
  • 15. GraphQL queries Cont. Selection set: A set of fields requested in an operation, or nested within another field. A GraphQL query must contain a selection set on any field that returns an object type, and selection sets are not allowed on fields that return scalar types, such as Int or String.
  • 16. Fragments Fragment definition: Part of a GraphQL document which defines a GraphQL fragment. This is also sometimes called a named fragment, in contrast to an inline fragment. Fragment name: The name of each fragment has to be unique within a GraphQL document. This is the name you use to refer to the fragment in an operation or in other fragments. Type condition: GraphQL operations always start at the query, mutation, or subscription type in your schema, but fragments can be used in any selection set.
  • 17. Fragments Fragment spread: When you use a fragment inside an operation or another fragment, you do so by putting ... followed by the fragment name. This is called a fragment spread, and it can appear in any selection set that matches that named fragment’s type condition. Inline fragment: When you just want to execute some fields depending on the type of a result, but you don’t want to split that out into a separate definition, you can use an inline fragment.
  • 18. Directives Directive: An annotation on a field, fragment, or operation that affects how it is executed or returned. Directive arguments: These work just like field arguments, but they are handled by the execution engine instead of being passed down to the field resolver. @include(if: Boolean) Only include this field in the result if the argument is true. @skip(if: Boolean) Skip this field if the argument is true.
  • 19. Pagination There are a number of ways we could do pagination: • We could do something like friends(first:2 offset:2) to ask for the next two in the list. • We could do something like friends(first:2 after:$friendId), to ask for the next two after the last friend we fetched. • We could do something like friends(first:2 after:$friendCursor), where we get a cursor from the last item and use that to paginate.
  • 20. Mutation Same as query behavior but aims to Insert-Update-Delete
  • 21. Samples 1-Sample Query 2-Query with args 3-Aliace 4-Fragments
  • 22. Samples Cont. 4-Fragments { "data": { "leftComparison": { "name": "Luke Skywalker", "appearsIn": ["NEWHOPE", "EMPIRE", "JEDI"], "friends": [ {"name": "Han Solo"}, {"name": "Leia Organa"}, {"name": "C-3PO"}, {"name": "R2-D2"}]}, "rightComparison": { "name": "R2-D2", "appearsIn": ["NEWHOPE","EMPIRE","JEDI"], "friends": [{"name": "Luke Skywalker"},{"name": "Han Solo"}, {"name": "Leia Organa"}]} } }
  • 26. GraphQL Schema A GraphQL schema is at the center of any GraphQL server implementation and describes the functionality available to the clients which connect to it. The core building block within a schema is the “type”. Types provide a wide-range of functionality within a schema, including the ability to: • Create relationships between types (e.g. between a Book and an Author). • Define which data-fetching (querying) and data-manipulation (mutating) operations can be executed by the client. • If desired, self-explain what capabilities are available to the client (via introspection).
  • 27. GraphQL Schema Types Scalar types Scalar types represent the leaves of an operation and always resolve to concrete data. The default scalar types which GraphQL offers are: Int: Signed 32‐bit integer • Float: Signed double-precision floating-point value • String: UTF‐8 character sequence • Boolean: true or false • ID (serialized as String): A unique identifier, often used to refetch an object or as the key for a cache. While serialized as a String, ID signifies that it is not intended to be human‐readable
  • 28. GraphQL Schema Types Cont. Object types The object type is the most common type used in a schema and represents a group of fields. Each field inside of an object type maps to another type, allowing nested types and circular references.
  • 29. GraphQL Schema Types Cont. The Query type A GraphQL query is for fetching data and compares to the GET verb in REST-based APIs. Schema Request Response
  • 30. GraphQL Schema Types Cont. The Mutation type Mutations are operations sent to the server to create, update or delete data. Schema Request Response
  • 31. GraphQL Schema Types Cont. The Interface type An Interface is an abstract type that includes a certain set of fields that a type must include to implement the interface.
  • 32. GraphQL Schema Types Cont. The Subscriptions type GraphQL subscriptions are a way to push data from the server to the clients that choose to listen to real time messages from the server. Subscriptions are similar to queries in that they specify a set of fields to be delivered to the client, but instead of immediately returning a single answer, a result is sent every time a particular event happens on the server. why GraphQL is great for real-time apps: • Live-queries (subscriptions) are an implicit part of the GraphQL specification. Any GraphQL system has to have native real-time API capabilities. • A standard spec for real-time queries has consolidated community efforts around client-side tooling, resulting in a very intuitive way of integrating with GraphQL APIs.
  • 33. GraphQL Advantages • Declarative Data Fetching • No Over fetching with GraphQL • Single Source of Truth • GraphQL embraces modern Trends • GraphQL Schema Stitching • GraphQL Introspection • Strongly Typed GraphQL • GraphQL Versioning • A growing GraphQL Ecosystem
  • 34. GraphQL Disadvantages • GraphQL Query Complexity • GraphQL Caching • GraphQL security
  • 36. GraphQL Vs. Falcor While Falcor is easier to learn and write, GraphQL has a steeper learning curve, but is more powerful.