SlideShare une entreprise Scribd logo
Par Félix Billon
QUI SUIS-JE ?
Développeur web orienté front-end chez Dcube.
Blog dev web : shakedatcode.fr
@felix_billon
SOMMAIRE
1. API Gateway Pattern
2. GraphQl
3. TypeScript dans tout ça ?
MONOLITICS VS MICROSERVICES
MICROSERVICES : PROBLÈME...
API GATEWAY PATTERN
API GATEWAY PATTERN
API GATEWAY PATTERN : AVANTAGES
Moins d’aller-retour client/services.
Simplification du code client.
Centralisation des middlewares (authentification,
logging, controle du traffic, ...).
Le client doit connaitre un seul endpoint.
API GATEWAY PATTERN :
DÉSAVANTAGES
Ajout d'un nouveau composant.
Doit être HAUTEMENT disponible.
Doit connaître les endpoints des services.
GRAPHQL : EN BREF
Spécification !
By Facebook.
Open source depuis 2015.
Grosse communauté.
Beaucoup d'outils disponible : GraphiQL, GraphQL
Voyager, GraphQL Docs, ...
GRAPHQL : EN BREF
GRAPHQL : TYPE ET SCHÉMA
type Query {
user(id: Int): User
}
type Mutation {
createUser(firstName: String!, lastName: String!): User!
}
type User {
id: Int!
firstName: String!
lastName: String!
posts: [Post]
}
type Post {
id: Int!
title: String!
}
GRAPHQL : RESOLVER
export const resolvers = {
Query: {
user: (obj, args, context) => {
return users.find((user) => user.id === args.id);
}
},
Mutation: {
createUser: (root, args) => {
const newUser = {
id: users.length + 1,
firstName,
lastName
}
users.push(newUser);
return newUser;
}
},
User: {
posts(user) {
t t filt (( t) > t i d Of( t id) ! 1)
GRAPHQL : QUERY
Ressemble très fortement à du JSON.
{
user(id: "10") {
id
firstName
posts {
title
}
}
}
{
"data": {
"user": {
"id": 1,
"firstName": "Felix",
"posts": [
{
"title": "Paris TypeScript #1 was awesome"
},
{
"title": "BestOfWeb rocks"
}
]
}
}
}
GRAPHQL : DEEP DIVE
Subscription : permet de cabler un système de
PubSub.
Dataloader : optimisation des requêtes.
Introspection du graph.
GRAPHQL : CLIENT
TYPESCRIPT DANS TOUS ÇA ?
Génération automatique des annotations de types à
partir du schéma et des requêtes (apollo-codegen,
gql2ts, ts2gql, ...)
Language service (ts-graphql-plugin, graphql-
language-service, ...)
DEMO TIME

Contenu connexe

PDF
TypeScript - An Introduction
PPTX
Typescript tips & tricks
PDF
Power Leveling your TypeScript
PDF
Angular 2 - Typescript
PDF
TypeScript: особенности разработки / Александр Майоров (Tutu.ru)
PPTX
Typescript Fundamentals
PDF
TypeScript Seminar
PPTX
TypeScript
TypeScript - An Introduction
Typescript tips & tricks
Power Leveling your TypeScript
Angular 2 - Typescript
TypeScript: особенности разработки / Александр Майоров (Tutu.ru)
Typescript Fundamentals
TypeScript Seminar
TypeScript

En vedette (19)

PDF
TypeScript: Un lenguaje aburrido para programadores torpes y tristes
PPTX
Getting started with typescript
PPTX
TypeScript - Silver Bullet for the Full-stack Developers
PDF
«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21
PPTX
TypeScript Overview
PDF
TypeScript: Angular's Secret Weapon
PPTX
Introducing type script
PPTX
PPTX
002. Introducere in type script
PPTX
Typescript
PDF
TypeScript Introduction
PPTX
Why TypeScript?
PDF
Александр Русаков - TypeScript 2 in action
PPT
TypeScript Presentation
PDF
TypeScript: coding JavaScript without the pain
PPTX
Typescript ppt
PDF
TypeScript for Java Developers
PPTX
Typescript in 30mins
PDF
TypeScriptで快適javascript
TypeScript: Un lenguaje aburrido para programadores torpes y tristes
Getting started with typescript
TypeScript - Silver Bullet for the Full-stack Developers
«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21
TypeScript Overview
TypeScript: Angular's Secret Weapon
Introducing type script
002. Introducere in type script
Typescript
TypeScript Introduction
Why TypeScript?
Александр Русаков - TypeScript 2 in action
TypeScript Presentation
TypeScript: coding JavaScript without the pain
Typescript ppt
TypeScript for Java Developers
Typescript in 30mins
TypeScriptで快適javascript
Publicité

Similaire à Typescript + Graphql = <3 (20)

PDF
Cellenza microservices - tour d'horizon - v0.1
PDF
Êtes-vous API dans votre organisation ?
PDF
La Duck Conf - "L'API Management : au-délà des promesses"
PDF
XebiCon'16 : GS1 - Comment les services managés du Cloud nous ont permis de t...
PDF
LAWS - Crée un site dynamique en serverless c'est possible
PPTX
Linq Tech Days08 Lux
PPTX
SPA avec Angular et SignalR (FR)
PDF
TP GWT JDEV 2015
PDF
Gestion des APIs avec Azure API Management - Samir AREZKI
PPTX
meetup devops aix marseille du 16/05/23
PDF
Présentation de WAMP.ws, le protocole pour faire du PUB/SUB et RPC over Webso...
PPTX
Petit-Déjeuner : L'API ne fait pas le moine : Confessions d'experts sur les m...
PDF
ASP.NET MVC 6
PDF
Refcard GraphQL
ODP
LemonLDAP::NG, un WebSSO libre
PDF
2018-10-18 J2 4D - Implémentez votre prochain assistant personnel d’intranet ...
ODP
WebSphere Portal & Rich Internet Applications
PDF
Architectures lambda - Microsoft
PDF
Ou sont mes beans, contrats et workflows ? WOA et REST: Un changement de ment...
PDF
API Management
Cellenza microservices - tour d'horizon - v0.1
Êtes-vous API dans votre organisation ?
La Duck Conf - "L'API Management : au-délà des promesses"
XebiCon'16 : GS1 - Comment les services managés du Cloud nous ont permis de t...
LAWS - Crée un site dynamique en serverless c'est possible
Linq Tech Days08 Lux
SPA avec Angular et SignalR (FR)
TP GWT JDEV 2015
Gestion des APIs avec Azure API Management - Samir AREZKI
meetup devops aix marseille du 16/05/23
Présentation de WAMP.ws, le protocole pour faire du PUB/SUB et RPC over Webso...
Petit-Déjeuner : L'API ne fait pas le moine : Confessions d'experts sur les m...
ASP.NET MVC 6
Refcard GraphQL
LemonLDAP::NG, un WebSSO libre
2018-10-18 J2 4D - Implémentez votre prochain assistant personnel d’intranet ...
WebSphere Portal & Rich Internet Applications
Architectures lambda - Microsoft
Ou sont mes beans, contrats et workflows ? WOA et REST: Un changement de ment...
API Management
Publicité

Plus de felixbillon (8)

PPTX
typescript_cdktf.pptx
PPTX
Un problème 10 solutions : Azure Fighter
PDF
TypeScript Best Practices
PPTX
Présentation et dernières nouveautés Microsoft Bot
PPTX
Global Azure Bootcamp 2018 - Microsoft Bot
PPTX
Présentation Google Cloud Vision API
PPTX
Service cognitifs : vue d'ensemble
PDF
Introduction TypeScript
typescript_cdktf.pptx
Un problème 10 solutions : Azure Fighter
TypeScript Best Practices
Présentation et dernières nouveautés Microsoft Bot
Global Azure Bootcamp 2018 - Microsoft Bot
Présentation Google Cloud Vision API
Service cognitifs : vue d'ensemble
Introduction TypeScript

Dernier (6)

PPTX
Presentation_Securite_Reseaux_Bac+2.pptx
PDF
FORMATION EN Programmation En Langage C.pdf
PDF
Tendances tech 2025 - SFEIR & WENVISION.pdf
PDF
FORMATION COMPLETE EN EXCEL DONE BY MR. NYONGA BRICE.pdf
PDF
L'évolution de la création de contenu (2020-2025) : L'impact de l'IA générati...
PDF
Modems expliqués- votre passerelle vers Internet.pdf
Presentation_Securite_Reseaux_Bac+2.pptx
FORMATION EN Programmation En Langage C.pdf
Tendances tech 2025 - SFEIR & WENVISION.pdf
FORMATION COMPLETE EN EXCEL DONE BY MR. NYONGA BRICE.pdf
L'évolution de la création de contenu (2020-2025) : L'impact de l'IA générati...
Modems expliqués- votre passerelle vers Internet.pdf

Typescript + Graphql = <3

  • 2. QUI SUIS-JE ? Développeur web orienté front-end chez Dcube. Blog dev web : shakedatcode.fr @felix_billon
  • 3. SOMMAIRE 1. API Gateway Pattern 2. GraphQl 3. TypeScript dans tout ça ?
  • 8. API GATEWAY PATTERN : AVANTAGES Moins d’aller-retour client/services. Simplification du code client. Centralisation des middlewares (authentification, logging, controle du traffic, ...). Le client doit connaitre un seul endpoint.
  • 9. API GATEWAY PATTERN : DÉSAVANTAGES Ajout d'un nouveau composant. Doit être HAUTEMENT disponible. Doit connaître les endpoints des services.
  • 10. GRAPHQL : EN BREF Spécification ! By Facebook. Open source depuis 2015. Grosse communauté. Beaucoup d'outils disponible : GraphiQL, GraphQL Voyager, GraphQL Docs, ...
  • 11. GRAPHQL : EN BREF
  • 12. GRAPHQL : TYPE ET SCHÉMA type Query { user(id: Int): User } type Mutation { createUser(firstName: String!, lastName: String!): User! } type User { id: Int! firstName: String! lastName: String! posts: [Post] } type Post { id: Int! title: String! }
  • 13. GRAPHQL : RESOLVER export const resolvers = { Query: { user: (obj, args, context) => { return users.find((user) => user.id === args.id); } }, Mutation: { createUser: (root, args) => { const newUser = { id: users.length + 1, firstName, lastName } users.push(newUser); return newUser; } }, User: { posts(user) { t t filt (( t) > t i d Of( t id) ! 1)
  • 14. GRAPHQL : QUERY Ressemble très fortement à du JSON. { user(id: "10") { id firstName posts { title } } } { "data": { "user": { "id": 1, "firstName": "Felix", "posts": [ { "title": "Paris TypeScript #1 was awesome" }, { "title": "BestOfWeb rocks" } ] } } }
  • 15. GRAPHQL : DEEP DIVE Subscription : permet de cabler un système de PubSub. Dataloader : optimisation des requêtes. Introspection du graph.
  • 17. TYPESCRIPT DANS TOUS ÇA ? Génération automatique des annotations de types à partir du schéma et des requêtes (apollo-codegen, gql2ts, ts2gql, ...) Language service (ts-graphql-plugin, graphql- language-service, ...)