apollographql / rover

The CLI for Apollo GraphOS
https://rover.apollo.dev
Other
404 stars 84 forks source link

Rover to list implementations #454

Open lrlna opened 3 years ago

lrlna commented 3 years ago

Description

An implementation is a service that executes GraphQL operations written against that graph’s schema.

Apollo can track implementations of a graph or variant. Services report their schema and intended graph (or variant) at startup, and the registry then uses heartbeats to maintain an up-to-date list of running services and their schemas.

The schema implemented by each implementation need not match the published schema for the graph. In this example we have three registered implementations of a graph whose published schema is acme@cafe1234. Two are running that exact schema; the third is running f01238ee3, which appears to include an extra type. Implementations whose schemas match the graph’s published schemas are marked with a *.

# FUTURE COMMAND: show the list of known implementations for a graph
$ rover implementations acme@prod
acme@prod is acme:cafe1234 [10 types, 63 fields]
6239    * acme:cafe1234 [10 types, 63 fields]     Mon Mar 1 18:28:32 UTC 2021
7129    * acme:cafe1234 [10 types, 63 fields]     Mon Mar 1 18:28:32 UTC 2021
7382      acme:f0128ee3 [11 types, 68 fields]     Wed Mar 3 18:28:32 UTC 2021

This illustrates the value of a registry when you have multiple instances of a server implementing a graph. With introspection, you may get different schemas back depending on which server handles your introspection request. But with a registry there is a clear distinction between the schema each server happens to be running and the schema published for the graph.

Along with schemas, implementations report graph analytics — a cube of data capturing exactly which fields in a graph were used by which clients, along with diagnostic traces of selected requests. Apollo uses this data for many purposes including validation, performance analysis, and field lifecycle management. This metadata about the graph is also valuable outside the walls of Apollo, as input to product management, design, business intelligence, marketing systems, and more.

This issue is created from a document created by Matt as part of An Introduction to Apollo Registry Quip Document.

EverlastingBugstopper commented 3 years ago

I'm told this will require some design and changes to the Studio API so I'll label this as blocked for the time being.