Slide 1

Slide 1 text

Building A Better Platform with GraphQL

Slide 2

Slide 2 text

GitHub Meet the Team 2

Slide 3

Slide 3 text

GitHub Platform Today 3 • Home to over 38 million projects, central location for most modern open-source software. • A collaborative community of over 15 million people learning, sharing and working together every day. • Over 250,000 OAuth applications building on the platform. • Over 6 million users have OAuth apps installed. • Broad eco-system of innovative integrators and developers building rich user experiences and critical developer tools through the REST API and web hooks.

Slide 4

Slide 4 text

GitHub Thinking About Tomorrow 4 Internally • Be forward thinking about how we build out services internally. • Add additional diversity to our tech stack. • Simplify and improve how we work across teams, make development a seamless experience. • Create a back-end layer that everyone can contribute to. • Improve how our own off-site clients interact with GitHub’s platform back-end.

Slide 5

Slide 5 text

GitHub Externally • Be more transparent with the community we support. • Getting the data you want today can require multiple, often many REST calls away. • Close the feature gap for external developers. • Improve platform engagement and adoption through better tooling, documentation and on-boarding resources. Thinking About Tomorrow 5

Slide 6

Slide 6 text

GitHub Why GraphQL? 6

Slide 7

Slide 7 text

GitHub Why GraphQL? 7 What We Liked… • Why not X? GraphQL had a clear value proposition and a light weight unopinionated spec. • GraphQL had strong and very lively support from the greater open-source community. • It was an opportunity to collaborate with the community. • It helps pave the way for many of the goals we have for GitHub’s platform. • It changes the way we ship — in a good way.

Slide 8

Slide 8 text

GitHub Challenges 8 • Mitigating the Management Overhead of Multiple Schemas • Security and Privacy • Versioning, Behavioral and Breaking Changes • Performance Optimization and Resilience • On-boarding — Removing Roadblocks for Adoption • Instrumentation and Monitoring • Managing GraphQL Interface Contributions

Slide 9

Slide 9 text

GitHub Open-Source 9 GraphQL Client (Ruby) • Used internally to power many core GitHub features. • Provides integration and query validation in Rails views. • Handles query execution and query result parsing.

Slide 10

Slide 10 text

GitHub Open-Source 10 GraphQL Client (Ruby) require "graphql/client" require "graphql/client/http" http = GraphQL::Client::HTTP.new("http://graphql-swapi.parseapp.com/") schema = GraphQL::Client.load_schema(http) client = GraphQL::Client.new(schema: schema, execute: http)

Slide 11

Slide 11 text

GitHub Open-Source 11 GraphQL Client (Ruby) HumanFragment = client.parse <<-'GRAPHQL' fragment on Human { name homePlanet } GRAPHQL HeroNameQuery = client.parse <<-'GRAPHQL' { luke: human(id: "1000") { ...HumanFragment } leia: human(id: "1003") { ...HumanFragment } } GRAPHQL

Slide 12

Slide 12 text

GitHub Open-Source 12 GraphQL Client (Ruby) result = client.query(HeroNameQuery) result.data.luke.home_planet

Slide 13

Slide 13 text

GitHub Open-Source 13 GraphQL Client (Ruby) <%# app/views/humans/human.html.erb %> <%graphql fragment HumanFragment on Human { name homePlanet } %>

<%= human.name %> lives on <%= human.home_planet %>.

Slide 14

Slide 14 text

GitHub Open-Source 14 GraphQL Walker (Ruby) • Proactively identifies and hunts down node access discrepancies in your GraphQL interface. • Can easily be used directly along side GraphQL Client. • Written in Ruby, but useful for any GraphQL interface.

Slide 15

Slide 15 text

GitHub Open-Source 15 GraphQL Walker (Ruby) require "graphql/relay/walker" id = "cGVvcGxlOjE=" query = GraphQL::Relay::Walker.query_string(schema) GraphQL::Relay::Walker.walk(from_id: id) do |frame| frame.gid frame.parent frame.result = execute(query, variables: {"id" => frame.gid}) frame.enqueue_found_gids end

Slide 16

Slide 16 text

GitHub Open-Source 16 GraphQL Walker (Ruby) require "graphql/relay/walker/client_ext" id = "cGVvcGxlOjE=" GraphQL::Client.walk(from_id: id) do |frame| frame.gid frame.parent frame.result end

Slide 17

Slide 17 text

GitHub Coming Soon 17

Slide 18

Slide 18 text

GitHub Thank You 18 twitter.com/brandonmblack