SlideShare a Scribd company logo
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 Flink
DataWorks Summit
 
SETCON'18 - Ilya labacheuski - GraphQL adventures
SETCON'18 - Ilya labacheuski - GraphQL adventuresSETCON'18 - Ilya labacheuski - GraphQL adventures
SETCON'18 - Ilya labacheuski - GraphQL adventures
Nadzeya 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 Palma
MongoDB
 
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
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
zhang 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.0
Tobias 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 Stitch
MongoDB
 
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
Bartosz Sypytkowski
 
Getting Started with GraphQL && PHP
Getting Started with GraphQL && PHPGetting Started with GraphQL && PHP
Getting Started with GraphQL && PHP
Andrew 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 tools
Sashko 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 needs
Sriskandarajah 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
 
Exploring Relay land
Exploring Relay landExploring Relay land
Exploring Relay land
Stefano Masini
 
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
Andrew Rota
 
Usable APIs at Scale
Usable APIs at ScaleUsable APIs at Scale
Usable APIs at Scale
Tim 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 needs
Microsoft 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 needs
Microsoft 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 Observability
All Things Open
 
Modern Database Best Practices
Modern Database Best PracticesModern Database Best Practices
Modern Database Best Practices
All Things Open
 
Open Source and Public Policy
Open Source and Public PolicyOpen Source and Public Policy
Open Source and Public Policy
All 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 Nash
All 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 JavaScript
All 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 Contract
All 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 TensorFlow
All Things Open
 
DEI Challenges and Success
DEI Challenges and SuccessDEI Challenges and Success
DEI Challenges and Success
All Things Open
 
Scaling Web Applications with Background
Scaling Web Applications with BackgroundScaling Web Applications with Background
Scaling Web Applications with Background
All Things Open
 
Supercharging tutorials with WebAssembly
Supercharging tutorials with WebAssemblySupercharging tutorials with WebAssembly
Supercharging tutorials with WebAssembly
All 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 Haystacks
All 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 Intercept
All Things Open
 
Scaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship ProgramScaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship Program
All 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 Source
All 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 Beam
All 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 control
All 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 Applications
All 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 code
All 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

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 

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