SlideShare a Scribd company logo
1 of 38
Download to read offline
Weaving Microservices
into a Unified GraphQL
Schema with graph-quilt
Ashpak Shaikh | Sr Staff Software Engineer
@shaikh__ashpak
Lucy Shen | Developer Advocate
@spooleans
Ashpak Shaikh
Sr Staff Software Engineer, Intuit
- Tech Lead/Architect - Dynamic Experience Platform
- Intuit API Steward
- GraphQL Expert
- Passion for service orchestration and Domain
Specific Languages (DSLs)
@shaikh__ashpak
in/ashpak--shaikh
Lucy Shen
Developer Advocate, Intuit
Former frontend software engineer (and JavaScript
apologist) turned Developer Advocate. My work is
focused on developer education and community building
in Intuit’s open source and API strategy. And I do a lot of
cosplay & photography in my free time!
@spooleans
in/lucyjshen
• GraphQL 101
• Quick graph-quilt demo
• GraphQL orchestrator history & architecture
• Schema composition using graph-quilt (and other features!)
On the agenda:
Intuit is the global
financial technology
platform that powers
prosperity for more than
100 million customers
worldwide.
GraphQL 101
REST vs GraphQL
Source: mobilelive.ca
• A query language API (not a database
technology)
• Services can be written in any language
• Open-sourced by Facebook in 2015
What is GraphQL?
Sample query
Sample response
query HeroNameAndFriends {
hero {
name
friends {
name
}
}
}
{
"data": {
"hero": {
"name": "R2-D2",
"friends": [
{
"name": "Luke Skywalker"
},
{
"name": "Han Solo"
},
{
"name": "Leia Organa"
}
]
}
}
}
• As the name suggests, it’s the language
used to define your schema 😂
• Your schema describes the shape of your
available data to the GraphQL server
• It also defines queries and mutations
available to the client
Schema Definition Language (SDL)
Sample schema
type Character {
name: String!
appearsIn: [Episode!]!
}
type Starship {
id: ID!
name: String!
length(unit: LengthUnit = METER): Float
}
STEP 1
Create a Schema
(SDL - Schema Definition Language)
type Query {
petById(id: ID!): Pet
}
type Pet {
id: ID!
name: String!
status: Status!
}
STEP 2
Implement DataFetchers (Resolvers)
(DGS Guide)
@DgsComponent
public class PetDataFetcher {
@Autowired
PetStoreDao petStoreDao;
@DgsQuery
public Pet petById(@InputArgument String id) {
return petStoreDao.findById(id);
}
}
Creating a GraphQL Service
But wait…
The GraphQL
Orchestrator Problem
GraphQL Orchestrator
PetStore Service
User Service
Pet Query
User Query
Client
O
R
C
H
E
S
T
R
A
T
O
R
(Pet + User) Query
Pet Results
User Results
(Pet + User) Results
Demo:
A brief history
Production statistics - graph-quilt
54
Subgraphs
150+
Clients
18
REST adapters
60+
Authz clients
5000+
TPS
6ms
Overhead
Existing Orchestrator - Platform Abstraction Service(PAS)
GraphQL Gateway in TurboTax Live
Let’s create our own GraphQL Orchestrator
● Senior Leadership and Architect
community approved a mission
team in 2018.
● Modest Goal : Tax + Credit
Service
● Vision : Single endpoint Data API
First Principles
Execution
● GraphQL specification for
schema authoring and subgraph
communication.
Registration
● Loose coupling between
orchestrator and subgraph.
Registration
Subgraph registration mechanism
GraphQL Registration files
{
"namespace":"PETSTORE",
"type":"graphql-sdl",
"endpoint":"https://petstore.api.com/graphql"
…
}
config.json
# Amount
scalar Amount
type Cat implements Pet {
id: ID!
name: String!
status: Status!
price: Amount
livesLeft: Int!
age: Int
}
…
schema.graphqls
Type name conflicts
type Profile
@rename(to: "TaxProfile")
{...}
Schema composition
Schema composition
● Number of subgraphs grew organically.
● Schema organization requests came in.
● Dependency between the subgraphs started emerging.
● Clients are spoilt and always want to make a single query.
● Diverse literature and spec for distributed GraphQL schemas.
Recursive Merge
User subgraph Tax subgraph Unified Schema
type Query {
user(id: ID!): User
}
type User {
personalInfo: PersonalInfo
}
type PersonalInfo {
id: ID!
firstname: String
lastname: String
email: EmailAddress
}
scalar EmailAddress
type Query {
user(id: ID!): User
}
type User {
finance: FinanceInfo
}
type FinanceInfo {
tax(year: Int): TaxInfo!
}
type TaxInfo {
…
}
type Query {
user(id: ID!): User
}
type User {
personalInfo:PersonalInfo
finance: FinanceInfo
}
type FinanceInfo {
tax(year: Int): TaxInfo!
credit: CreditInfo!
}
type PersonalInfo { … }
type TaxInfo { … }
type CreditInfo { … }
scalar EmailAddress
query QUERY_USER {
user(id:”myId”) {
personalInfo { … }
finance {
tax { … }
credit { … }
}
}
}
type Query {
user(id: ID!): User
}
type User {
finance: FinanceInfo
}
type FinanceInfo {
credit: CreditInfo!
}
type CreditInfo {
…
}
Credit subgraph
Remote Type Extension - @resolver
Tax subgraph
type Query {
user(id: ID!): User
}
type User {
finance: FinanceInfo
}
type FinanceInfo {
tax(year: Int!): [TaxInfo]
}
type TaxInfo {
taxId: ID!
year: Int!
…
}
Unified Schema
type Query {
user(id: ID!): User
taxDocument(id: ID!,
year: Int!): TaxDocument
}
type User {
finance: FinanceInfo
}
type FinanceInfo {
tax(year: Int!): [TaxInfo]
}
type TaxInfo {
userId: ID!
year: Int!
…
taxDocument: TaxDocument
}
…
query QUERY_USER {
user(id: “123”) {
finance {
tax(year: “2022”) {
taxDocumment {
…
}
}
}
}
}
type Query {
taxDocument(id: ID!,year: Int!):
TaxDocument
}
type TaxDocument {
year: Int
forms: [TaxForm]
}
type TaxForm { … }
Tax Documents subgraph
Field Reference
extend type TaxInfo {
taxDocument: TaxDocument @resolver(
field: "taxDocument"
arguments: [
{name: "id", value: "$taxId"},
{name: "year", value: "$year"},
]
)
}
# local type reference
type TaxDocument {}
Remote Type Extension - Apollo Federation
Tax subgraph
type Query {
user(id: ID!): User
}
type User {
finance: FinanceInfo
}
type FinanceInfo {
tax(year: Int!): TaxInfo!
}
type TaxInfo @key(fields: "taxId year") {
taxId: ID!
year: Int!
…
}
Unified Schema
type Query {
user(id: ID!): User
}
type User {
finance: FinanceInfo
}
type FinanceInfo {
tax(year: Int!): TaxInfo!
}
type TaxInfo {
taxId: ID!
year: Int!
…
taxDocument: TaxDocument
}
…
query QUERY_USER {
user(id: “123”) {
finance {
tax(year: “2022”) {
taxDocumment {
…
}
}
}
}
}
type TaxInfo @extends @key(fields:
"taxId year") {
taxId: ID! @external
year: Int! @external
taxDocument:TaxDocument
}
type TaxDocument {
year: Int
forms: [TaxForm]
}
type TaxForm { … }
Tax Documents subgraph
More features
GraphQL Authorization
● Restrict access to the supergraph
○ Real user vs System user
○ Session with a lower access level
○ User consented data access
○ Intuit vs Third party apps
● Authz solutions for REST APIs are not applicable.
● Central Authz Enforcement.
GraphQL Authorization (graphql-authorization-java)
REST Adapter (graphql-service-adapters)
Problem
● Clients love GraphQL and now need data from
REST APIs.
● REST services not be ready to adopt GraphQL.
Solution
● The orchestrator projects the data from REST
endpoint to match the GraphQL Schema.
● REST adapter pipeline with validation.
REST Registration files
{
"namespace":"PETSTORE",
"type":"rest",
"endpoint":"https//petstore.api.com",
"timeout":"4000"
}
config.json
Service categoryById method GET {
@Url -> @Config("endpoint")
@Path -> "/v1/categories/{categoryId}"
@Timeout -> @Config("timeout")
@Header accept -> "application/json"
@PathParam categoryId -> ${graphQLContext.arguments.id}
}
service.flow
type Query {
petCategory(id: String): PetCategory! @adapter(service:“categoryById”)
}
type PetCategory {...}
schema.graphqls
All the things we learnt
● Open Source GraphQL Orchestrator
Library
● Sample GraphQL Gateway with Authz
and REST adapter
● Uses graphql-java library
● Active Maintainers
○ (We’re doing Hacktoberfest!)
Graph Quilt github.com/graph-quilt
Thank you!
github.com/graph-quilt
Ashpak Shaikh
@shaikh__ashpak
Lucy Shen
@spooleans

More Related Content

Similar to Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak Shaikh & Lucy Shen

Why and how to leverage the simplicity and power of SQL on Flink
Why and how to leverage the simplicity and power of SQL on FlinkWhy and how to leverage the simplicity and power of SQL on Flink
Why and how to leverage the simplicity and power of SQL on FlinkDataWorks Summit
 
SETCON'18 - Ilya labacheuski - GraphQL adventures
SETCON'18 - Ilya labacheuski - GraphQL adventuresSETCON'18 - Ilya labacheuski - GraphQL adventures
SETCON'18 - Ilya labacheuski - GraphQL adventuresNadzeya Pus
 
Evolving your Data Access with MongoDB Stitch - Drew Di Palma
Evolving your Data Access with MongoDB Stitch - Drew Di PalmaEvolving your Data Access with MongoDB Stitch - Drew Di Palma
Evolving your Data Access with MongoDB Stitch - Drew Di PalmaMongoDB
 
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDB
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDBIntroducing MongoDB Stitch, Backend-as-a-Service from MongoDB
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDBMongoDB
 
Swift distributed tracing method and tools v2
Swift distributed tracing method and tools v2Swift distributed tracing method and tools v2
Swift distributed tracing method and tools v2zhang hua
 
Performant APIs with GraphQL and PHP (Dutch PHP 2019)
Performant APIs with GraphQL and PHP (Dutch PHP 2019)Performant APIs with GraphQL and PHP (Dutch PHP 2019)
Performant APIs with GraphQL and PHP (Dutch PHP 2019)Andrew Rota
 
GraphQL Bangkok Meetup 2.0
GraphQL Bangkok Meetup 2.0GraphQL Bangkok Meetup 2.0
GraphQL Bangkok Meetup 2.0Tobias Meixner
 
MongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
MongoDB.local Sydney: Evolving your Data Access with MongoDB StitchMongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
MongoDB.local Sydney: Evolving your Data Access with MongoDB StitchMongoDB
 
GraphQL - an elegant weapon... for more civilized age
GraphQL - an elegant weapon... for more civilized ageGraphQL - an elegant weapon... for more civilized age
GraphQL - an elegant weapon... for more civilized ageBartosz Sypytkowski
 
Getting Started with GraphQL && PHP
Getting Started with GraphQL && PHPGetting Started with GraphQL && PHP
Getting Started with GraphQL && PHPAndrew Rota
 
GraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer toolsGraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer toolsSashko Stubailo
 
WSO2 Analytics Platform - The one stop shop for all your data needs
WSO2 Analytics Platform - The one stop shop for all your data needsWSO2 Analytics Platform - The one stop shop for all your data needs
WSO2 Analytics Platform - The one stop shop for all your data needsSriskandarajah Suhothayan
 
Flink Forward San Francisco 2018: Fabian Hueske & Timo Walther - "Why and how...
Flink Forward San Francisco 2018: Fabian Hueske & Timo Walther - "Why and how...Flink Forward San Francisco 2018: Fabian Hueske & Timo Walther - "Why and how...
Flink Forward San Francisco 2018: Fabian Hueske & Timo Walther - "Why and how...Flink Forward
 
Understanding Business APIs through statistics
Understanding Business APIs through statisticsUnderstanding Business APIs through statistics
Understanding Business APIs through statisticsWSO2
 
Tutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPTutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPAndrew Rota
 
Usable APIs at Scale
Usable APIs at ScaleUsable APIs at Scale
Usable APIs at ScaleTim Burks
 
SH 1 - SES 8 - Stitch_Overview_TLV.pptx
SH 1 - SES 8 - Stitch_Overview_TLV.pptxSH 1 - SES 8 - Stitch_Overview_TLV.pptx
SH 1 - SES 8 - Stitch_Overview_TLV.pptxMongoDB
 
Microsoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needsMicrosoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needsMicrosoft Tech Community
 
Microsoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needsMicrosoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needsMicrosoft Tech Community
 

Similar to Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak Shaikh & Lucy Shen (20)

Why and how to leverage the simplicity and power of SQL on Flink
Why and how to leverage the simplicity and power of SQL on FlinkWhy and how to leverage the simplicity and power of SQL on Flink
Why and how to leverage the simplicity and power of SQL on Flink
 
SETCON'18 - Ilya labacheuski - GraphQL adventures
SETCON'18 - Ilya labacheuski - GraphQL adventuresSETCON'18 - Ilya labacheuski - GraphQL adventures
SETCON'18 - Ilya labacheuski - GraphQL adventures
 
Evolving your Data Access with MongoDB Stitch - Drew Di Palma
Evolving your Data Access with MongoDB Stitch - Drew Di PalmaEvolving your Data Access with MongoDB Stitch - Drew Di Palma
Evolving your Data Access with MongoDB Stitch - Drew Di Palma
 
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDB
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDBIntroducing MongoDB Stitch, Backend-as-a-Service from MongoDB
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDB
 
Swift distributed tracing method and tools v2
Swift distributed tracing method and tools v2Swift distributed tracing method and tools v2
Swift distributed tracing method and tools v2
 
Performant APIs with GraphQL and PHP (Dutch PHP 2019)
Performant APIs with GraphQL and PHP (Dutch PHP 2019)Performant APIs with GraphQL and PHP (Dutch PHP 2019)
Performant APIs with GraphQL and PHP (Dutch PHP 2019)
 
GraphQL Bangkok Meetup 2.0
GraphQL Bangkok Meetup 2.0GraphQL Bangkok Meetup 2.0
GraphQL Bangkok Meetup 2.0
 
MongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
MongoDB.local Sydney: Evolving your Data Access with MongoDB StitchMongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
MongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
 
GraphQL - an elegant weapon... for more civilized age
GraphQL - an elegant weapon... for more civilized ageGraphQL - an elegant weapon... for more civilized age
GraphQL - an elegant weapon... for more civilized age
 
Getting Started with GraphQL && PHP
Getting Started with GraphQL && PHPGetting Started with GraphQL && PHP
Getting Started with GraphQL && PHP
 
GraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer toolsGraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer tools
 
WSO2 Analytics Platform - The one stop shop for all your data needs
WSO2 Analytics Platform - The one stop shop for all your data needsWSO2 Analytics Platform - The one stop shop for all your data needs
WSO2 Analytics Platform - The one stop shop for all your data needs
 
Flink Forward San Francisco 2018: Fabian Hueske & Timo Walther - "Why and how...
Flink Forward San Francisco 2018: Fabian Hueske & Timo Walther - "Why and how...Flink Forward San Francisco 2018: Fabian Hueske & Timo Walther - "Why and how...
Flink Forward San Francisco 2018: Fabian Hueske & Timo Walther - "Why and how...
 
Understanding Business APIs through statistics
Understanding Business APIs through statisticsUnderstanding Business APIs through statistics
Understanding Business APIs through statistics
 
Exploring Relay land
Exploring Relay landExploring Relay land
Exploring Relay land
 
Tutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPTutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHP
 
Usable APIs at Scale
Usable APIs at ScaleUsable APIs at Scale
Usable APIs at Scale
 
SH 1 - SES 8 - Stitch_Overview_TLV.pptx
SH 1 - SES 8 - Stitch_Overview_TLV.pptxSH 1 - SES 8 - Stitch_Overview_TLV.pptx
SH 1 - SES 8 - Stitch_Overview_TLV.pptx
 
Microsoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needsMicrosoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needs
 
Microsoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needsMicrosoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needs
 

More from All Things Open

Building Reliability - The Realities of Observability
Building Reliability - The Realities of ObservabilityBuilding Reliability - The Realities of Observability
Building Reliability - The Realities of ObservabilityAll Things Open
 
Modern Database Best Practices
Modern Database Best PracticesModern Database Best Practices
Modern Database Best PracticesAll Things Open
 
Open Source and Public Policy
Open Source and Public PolicyOpen Source and Public Policy
Open Source and Public PolicyAll Things Open
 
The State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil NashThe State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil NashAll Things Open
 
Total ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScriptTotal ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScriptAll Things Open
 
What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?All Things Open
 
How to Write & Deploy a Smart Contract
How to Write & Deploy a Smart ContractHow to Write & Deploy a Smart Contract
How to Write & Deploy a Smart ContractAll Things Open
 
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
 Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlowAll Things Open
 
DEI Challenges and Success
DEI Challenges and SuccessDEI Challenges and Success
DEI Challenges and SuccessAll Things Open
 
Scaling Web Applications with Background
Scaling Web Applications with BackgroundScaling Web Applications with Background
Scaling Web Applications with BackgroundAll Things Open
 
Supercharging tutorials with WebAssembly
Supercharging tutorials with WebAssemblySupercharging tutorials with WebAssembly
Supercharging tutorials with WebAssemblyAll Things Open
 
Using SQL to Find Needles in Haystacks
Using SQL to Find Needles in HaystacksUsing SQL to Find Needles in Haystacks
Using SQL to Find Needles in HaystacksAll Things Open
 
Configuration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit InterceptConfiguration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit InterceptAll Things Open
 
Scaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship ProgramScaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship ProgramAll Things Open
 
Build Developer Experience Teams for Open Source
Build Developer Experience Teams for Open SourceBuild Developer Experience Teams for Open Source
Build Developer Experience Teams for Open SourceAll Things Open
 
Deploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache BeamDeploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache BeamAll Things Open
 
Sudo – Giving access while staying in control
Sudo – Giving access while staying in controlSudo – Giving access while staying in control
Sudo – Giving access while staying in controlAll Things Open
 
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML ApplicationsFortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML ApplicationsAll Things Open
 
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...All Things Open
 
Building AlmaLinux OS without RHEL sources code
Building AlmaLinux OS without RHEL sources codeBuilding AlmaLinux OS without RHEL sources code
Building AlmaLinux OS without RHEL sources codeAll Things Open
 

More from All Things Open (20)

Building Reliability - The Realities of Observability
Building Reliability - The Realities of ObservabilityBuilding Reliability - The Realities of Observability
Building Reliability - The Realities of Observability
 
Modern Database Best Practices
Modern Database Best PracticesModern Database Best Practices
Modern Database Best Practices
 
Open Source and Public Policy
Open Source and Public PolicyOpen Source and Public Policy
Open Source and Public Policy
 
The State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil NashThe State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil Nash
 
Total ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScriptTotal ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScript
 
What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?
 
How to Write & Deploy a Smart Contract
How to Write & Deploy a Smart ContractHow to Write & Deploy a Smart Contract
How to Write & Deploy a Smart Contract
 
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
 Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
 
DEI Challenges and Success
DEI Challenges and SuccessDEI Challenges and Success
DEI Challenges and Success
 
Scaling Web Applications with Background
Scaling Web Applications with BackgroundScaling Web Applications with Background
Scaling Web Applications with Background
 
Supercharging tutorials with WebAssembly
Supercharging tutorials with WebAssemblySupercharging tutorials with WebAssembly
Supercharging tutorials with WebAssembly
 
Using SQL to Find Needles in Haystacks
Using SQL to Find Needles in HaystacksUsing SQL to Find Needles in Haystacks
Using SQL to Find Needles in Haystacks
 
Configuration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit InterceptConfiguration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit Intercept
 
Scaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship ProgramScaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship Program
 
Build Developer Experience Teams for Open Source
Build Developer Experience Teams for Open SourceBuild Developer Experience Teams for Open Source
Build Developer Experience Teams for Open Source
 
Deploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache BeamDeploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache Beam
 
Sudo – Giving access while staying in control
Sudo – Giving access while staying in controlSudo – Giving access while staying in control
Sudo – Giving access while staying in control
 
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML ApplicationsFortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
 
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
 
Building AlmaLinux OS without RHEL sources code
Building AlmaLinux OS without RHEL sources codeBuilding AlmaLinux OS without RHEL sources code
Building AlmaLinux OS without RHEL sources code
 

Recently uploaded

JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...caitlingebhard1
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaWSO2
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....rightmanforbloodline
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 

Recently uploaded (20)

JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 

Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak Shaikh & Lucy Shen

  • 1. Weaving Microservices into a Unified GraphQL Schema with graph-quilt Ashpak Shaikh | Sr Staff Software Engineer @shaikh__ashpak Lucy Shen | Developer Advocate @spooleans
  • 2. Ashpak Shaikh Sr Staff Software Engineer, Intuit - Tech Lead/Architect - Dynamic Experience Platform - Intuit API Steward - GraphQL Expert - Passion for service orchestration and Domain Specific Languages (DSLs) @shaikh__ashpak in/ashpak--shaikh
  • 3. Lucy Shen Developer Advocate, Intuit Former frontend software engineer (and JavaScript apologist) turned Developer Advocate. My work is focused on developer education and community building in Intuit’s open source and API strategy. And I do a lot of cosplay & photography in my free time! @spooleans in/lucyjshen
  • 4. • GraphQL 101 • Quick graph-quilt demo • GraphQL orchestrator history & architecture • Schema composition using graph-quilt (and other features!) On the agenda:
  • 5. Intuit is the global financial technology platform that powers prosperity for more than 100 million customers worldwide.
  • 7. REST vs GraphQL Source: mobilelive.ca
  • 8. • A query language API (not a database technology) • Services can be written in any language • Open-sourced by Facebook in 2015 What is GraphQL? Sample query Sample response query HeroNameAndFriends { hero { name friends { name } } } { "data": { "hero": { "name": "R2-D2", "friends": [ { "name": "Luke Skywalker" }, { "name": "Han Solo" }, { "name": "Leia Organa" } ] } } }
  • 9. • As the name suggests, it’s the language used to define your schema 😂 • Your schema describes the shape of your available data to the GraphQL server • It also defines queries and mutations available to the client Schema Definition Language (SDL) Sample schema type Character { name: String! appearsIn: [Episode!]! } type Starship { id: ID! name: String! length(unit: LengthUnit = METER): Float }
  • 10. STEP 1 Create a Schema (SDL - Schema Definition Language) type Query { petById(id: ID!): Pet } type Pet { id: ID! name: String! status: Status! } STEP 2 Implement DataFetchers (Resolvers) (DGS Guide) @DgsComponent public class PetDataFetcher { @Autowired PetStoreDao petStoreDao; @DgsQuery public Pet petById(@InputArgument String id) { return petStoreDao.findById(id); } } Creating a GraphQL Service
  • 13. GraphQL Orchestrator PetStore Service User Service Pet Query User Query Client O R C H E S T R A T O R (Pet + User) Query Pet Results User Results (Pet + User) Results
  • 14. Demo:
  • 16. Production statistics - graph-quilt 54 Subgraphs 150+ Clients 18 REST adapters 60+ Authz clients 5000+ TPS 6ms Overhead
  • 17.
  • 18. Existing Orchestrator - Platform Abstraction Service(PAS)
  • 19. GraphQL Gateway in TurboTax Live
  • 20. Let’s create our own GraphQL Orchestrator ● Senior Leadership and Architect community approved a mission team in 2018. ● Modest Goal : Tax + Credit Service ● Vision : Single endpoint Data API
  • 21. First Principles Execution ● GraphQL specification for schema authoring and subgraph communication. Registration ● Loose coupling between orchestrator and subgraph.
  • 24. GraphQL Registration files { "namespace":"PETSTORE", "type":"graphql-sdl", "endpoint":"https://petstore.api.com/graphql" … } config.json # Amount scalar Amount type Cat implements Pet { id: ID! name: String! status: Status! price: Amount livesLeft: Int! age: Int } … schema.graphqls
  • 25. Type name conflicts type Profile @rename(to: "TaxProfile") {...}
  • 27. Schema composition ● Number of subgraphs grew organically. ● Schema organization requests came in. ● Dependency between the subgraphs started emerging. ● Clients are spoilt and always want to make a single query. ● Diverse literature and spec for distributed GraphQL schemas.
  • 28. Recursive Merge User subgraph Tax subgraph Unified Schema type Query { user(id: ID!): User } type User { personalInfo: PersonalInfo } type PersonalInfo { id: ID! firstname: String lastname: String email: EmailAddress } scalar EmailAddress type Query { user(id: ID!): User } type User { finance: FinanceInfo } type FinanceInfo { tax(year: Int): TaxInfo! } type TaxInfo { … } type Query { user(id: ID!): User } type User { personalInfo:PersonalInfo finance: FinanceInfo } type FinanceInfo { tax(year: Int): TaxInfo! credit: CreditInfo! } type PersonalInfo { … } type TaxInfo { … } type CreditInfo { … } scalar EmailAddress query QUERY_USER { user(id:”myId”) { personalInfo { … } finance { tax { … } credit { … } } } } type Query { user(id: ID!): User } type User { finance: FinanceInfo } type FinanceInfo { credit: CreditInfo! } type CreditInfo { … } Credit subgraph
  • 29. Remote Type Extension - @resolver Tax subgraph type Query { user(id: ID!): User } type User { finance: FinanceInfo } type FinanceInfo { tax(year: Int!): [TaxInfo] } type TaxInfo { taxId: ID! year: Int! … } Unified Schema type Query { user(id: ID!): User taxDocument(id: ID!, year: Int!): TaxDocument } type User { finance: FinanceInfo } type FinanceInfo { tax(year: Int!): [TaxInfo] } type TaxInfo { userId: ID! year: Int! … taxDocument: TaxDocument } … query QUERY_USER { user(id: “123”) { finance { tax(year: “2022”) { taxDocumment { … } } } } } type Query { taxDocument(id: ID!,year: Int!): TaxDocument } type TaxDocument { year: Int forms: [TaxForm] } type TaxForm { … } Tax Documents subgraph Field Reference extend type TaxInfo { taxDocument: TaxDocument @resolver( field: "taxDocument" arguments: [ {name: "id", value: "$taxId"}, {name: "year", value: "$year"}, ] ) } # local type reference type TaxDocument {}
  • 30. Remote Type Extension - Apollo Federation Tax subgraph type Query { user(id: ID!): User } type User { finance: FinanceInfo } type FinanceInfo { tax(year: Int!): TaxInfo! } type TaxInfo @key(fields: "taxId year") { taxId: ID! year: Int! … } Unified Schema type Query { user(id: ID!): User } type User { finance: FinanceInfo } type FinanceInfo { tax(year: Int!): TaxInfo! } type TaxInfo { taxId: ID! year: Int! … taxDocument: TaxDocument } … query QUERY_USER { user(id: “123”) { finance { tax(year: “2022”) { taxDocumment { … } } } } } type TaxInfo @extends @key(fields: "taxId year") { taxId: ID! @external year: Int! @external taxDocument:TaxDocument } type TaxDocument { year: Int forms: [TaxForm] } type TaxForm { … } Tax Documents subgraph
  • 32. GraphQL Authorization ● Restrict access to the supergraph ○ Real user vs System user ○ Session with a lower access level ○ User consented data access ○ Intuit vs Third party apps ● Authz solutions for REST APIs are not applicable. ● Central Authz Enforcement.
  • 34. REST Adapter (graphql-service-adapters) Problem ● Clients love GraphQL and now need data from REST APIs. ● REST services not be ready to adopt GraphQL. Solution ● The orchestrator projects the data from REST endpoint to match the GraphQL Schema. ● REST adapter pipeline with validation.
  • 35. REST Registration files { "namespace":"PETSTORE", "type":"rest", "endpoint":"https//petstore.api.com", "timeout":"4000" } config.json Service categoryById method GET { @Url -> @Config("endpoint") @Path -> "/v1/categories/{categoryId}" @Timeout -> @Config("timeout") @Header accept -> "application/json" @PathParam categoryId -> ${graphQLContext.arguments.id} } service.flow type Query { petCategory(id: String): PetCategory! @adapter(service:“categoryById”) } type PetCategory {...} schema.graphqls
  • 36. All the things we learnt
  • 37. ● Open Source GraphQL Orchestrator Library ● Sample GraphQL Gateway with Authz and REST adapter ● Uses graphql-java library ● Active Maintainers ○ (We’re doing Hacktoberfest!) Graph Quilt github.com/graph-quilt