Exploring GraphQL Systems Lifecycle: Server, Development, Monitoring, and Maintenance
Table of Contents
- GraphQL Systems Lifecycle: Server, Development, Monitoring, and Maintenance
- About Town (Core Concepts)
- The Trail (REST, aysnc, docs)
- The Ascent (Development Practices)
- Going to the People (API Contract, Monitoring, CI/CD)
- Produced for Inspection (Performance and Monitoring)
- The First Day of Creation (Cloud and Serverless)
GraphQL Systems Lifecycle: Server, Development, Monitoring, and Maintenance
https://www.meetup.com/bostonpython/events/262475756/
Now, what do you do with it? Jason Walsh (Senior Engineer, Chewy) continues our fable with the ongoing cycle of software from the server's perspective. State, async, fetching, oh my! As well as some basic implementations, he'll also cover things like tracing, logging, validation and the ongoing maintenance cycle of api.
- Provide background on historical means of separating concerns
- Contrast GraphQL with REST
- Focus on hosted Python
- Indicate design considerations
- Managing change and code ownership
- Focus on exploration
- Look at extending core cases
- What how do you detect issues with resolvers
- Performance considerations over the wire
TODO Deck, Design, Colors, and Images
- GraphViz
- Core presentation equipement
- Code repository for examples
About Town (Core Concepts)
Evaluate and Assess GraphQL for your Organization
Example: Existing REST microservices and multiple clients
Take a simple example and walk through some of the considerations associated with design, development, deployment, change management,
Show a high level for an example running locally.
Getting Started and Terminology
Python and GraphQL
import graphene class Query(graphene.ObjectType): hello = graphene.String() def resolve_hello(self, info): return 'World' schema = graphene.Schema(query=Query) schema.execute(''' query { hello } ''')
GraphQL queries, mutations, and subscriptions
Type Definition
Resolvers
- Faker
- Random
- Neo4J
- DB
Schema
type Query { get(id: ID, meta: String): Thing } type Thing { id: ID! title: String! meta: String } schema { query: Query }
Executable Schema
Model
type Person {
name: String!
knows: [Person] @relation(name: "KNOWS", direction: "OUT")
likes: [Hobby] @relation(name: "LIKES", direction: "OUT")
}
type Hobby {
name: String!
liked_by: [Person] @relation(name: "LIKES", direction: "IN")
}
The Trail (REST, aysnc, docs)
What does GraphQL get you that REST doesn't and how we're transitioning from server-side template driven develoment to
Assuming we have the following industry adoption timeline.
Workflow with REST
As an alternative to server-side rendering and
Workflow with Microservices
Workflow with API Gateways
Weak Typing
Async Stitching
REST Primitives
Documentation and OpenAPI
Subscriptions
Round Trip Times
Getting Data
At the most simple the option here is to ensure that a client can get data for the request. Since we're pushing
State
There are three core components when making requests to the GraphQL end-point: the core mutation or query, parameters passed into that document, and the headers associated with the request.
Async
API Gateways
The Ascent (Development Practices)
Design/Schema First vs. Code First
Ownership Consolidation
Designing API
https://docs.aws.amazon.com/appsync/latest/devguide/designing-a-graphql-api.html
build a schema from scratch, provision resources automatically, manually define a data source, and connect to it with a GraphQL resolver
Create Schema
IBM OpenAPI-to-GraphQL
Security
Authentication
cookies, JSON web tokens, or even HTTP Basic auth.
Authorization
From Session Cookies
Basic Auth
String usernameColonPassword = "user:passwd"; String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString(usernameColonPassword.getBytes());
Going to the People (API Contract, Monitoring, CI/CD)
Exploration
Data
Types
Specifications
Errors
Monitoring Usage
Breaking Changes
Deprecation Strategies
Mocking and Testing
There are a number of excellent resources
Expanding the Team
Managing Teams and Federation
Federated graph
GrAMPS
CI/CD and Tooling
Produced for Inspection (Performance and Monitoring)
Performance Response Payload
Tracing
https://github.com/graphql-python/graphene-tornado/pull/34
This would cover some of the core operational.
Graphene Core
Installation
Tracing Middleware
Performance Characteristics
The First Day of Creation (Cloud and Serverless)
Serverless
Cloud
AWS AppSync
AWS AppSync is an enterprise level, fully managed GraphQL service with real-time data synchronization and offline programming features.