Guillaume Chau
Vue.js Core Team
MongoDB
MySQL
Oracle
ERP
CRM
Vue
Angular
React
Micro-services
Redis
Android
iOS
Legacy custom apps
AWS
JavaScript
Java
C#
type Message {
id: ID!
content: String
user: User
date: Int
}
type User {
id: ID!
name: String
email: String
avatarUrl: String
}
type Query {
messages: [Message]
}
{
messages {
id
content
user {
id
name
}
}
}
{
"data": {
"messages": [
{
"id": "0",
"content": "Are you enjoying the conference?",
"user": {
"id": "0",
"name": "Anne"
}
},
{
"id": "1",
"content": "Absolutely!",
"user": {
"id": "1",
"name": "Yoan"
}
}
]
}
}
import { createServer } from 'http'
import express from 'express'
import { makeExecutableSchema } from 'graphql-tools'
import { graphqlExpress } from 'apollo-server-express'
const typeDefs = `...`
const resolvers = {
Query: {
messages: (root, args, context) => database.questions()
},
}
const schema = makeExecutableSchema({ typeDefs, resolvers })
const app = express()
app.use(GRAPHQL_ENDPOINT, graphqlExpress({ schema }))
const server = createServer(app)
server.listen(PORT)
import { GraphQLServer } from 'graphql-yoga'
const typeDefs = `...`
const resolvers = {
Query: {
messages: (root, args, context) => database.questions()
},
}
const server = new GraphQLServer({ typeDefs, resolvers })
server.start()
Monitoring with history
Performance tracing
Errors tracking
Schema inspect
Caching
Automatic persisted queries
1M requests per month free
Query
Mutation
Subscription (Web socket)
.gql
Observable
query
Normalized Cache
import { ApolloClient } from 'apollo-boost'
const client = new ApolloClient({ uri: '...' })
Guillaume Chau
@Akryum
github.com/Akryum