Exploring GraphQL Systems Lifecycle: Server, Development, Monitoring, and Maintenance

Table of Contents

1. 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

1.1. TODO Deck, Design, Colors, and Images

  1. GraphViz
  2. Core presentation equipement
  3. Code repository for examples

2. 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.

2.2. Python and GraphQL

https://graphene-python.org/

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
  }
''')

2.5. Resolvers

  • Faker
  • Random
  • Neo4J
  • DB

2.6. Schema

type Query {
    get(id: ID, meta: String): Thing
}

type Thing {
    id: ID!
    title: String!
    meta: String
}

schema {
    query: Query
}

2.8. Model

https://medium.com/google-cloud/secure-graphql-apis-in-minutes-with-google-cloud-run-and-grand-stack-97d050dbc744

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")
}

3. 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.

flow.png

3.1. Workflow with REST

As an alternative to server-side rendering and

3.10. 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

3.11. 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.

3.12. Async

3.13. API Gateways

4. The Ascent (Development Practices)

4.3. 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

4.6. Security

4.7. Authentication

cookies, JSON web tokens, or even HTTP Basic auth.

4.11. Basic Auth

String usernameColonPassword = "user:passwd";
String basicAuthPayload = "Basic " + Base64.getEncoder().encodeToString(usernameColonPassword.getBytes());

5. Going to the People (API Contract, Monitoring, CI/CD)

5.2. Data

5.3. Types

5.5. Errors

5.9. Mocking and Testing

There are a number of excellent resources

https://github.com/graphql/swapi-graphql

5.11. Managing Teams and Federation

Federated graph

6. Produced for Inspection (Performance and Monitoring)

6.2. Tracing

https://github.com/graphql-python/graphene-tornado/pull/34

This would cover some of the core operational.

6.3. Graphene Core

Installation

7. The First Day of Creation (Cloud and Serverless)

7.4. Cloud

7.5. AWS AppSync

AWS AppSync is an enterprise level, fully managed GraphQL service with real-time data synchronization and offline programming features.