/
đź“ť

Apollo GraphQL-A complete system to build, manage, and access a data graph

https://www.apollographql.com/docs/federation/federation-spec/
graphqlapiapollomicroservices
On this page

Federated GraphQL Microservices

Federation is an architecture for composing two or more graphs (called subgraphs) into a single data graph (called a supergraph). A supergraph’s schema is made up of all the composed subgraph schemas, plus some metadata.

One of the key principles of GraphQL involves having a single data graph of the implementing services that will allow the client to have a unified interface to access more data and services through a single query.

A gateway is responsible for receiving incoming queries and splitting them up across whichever services are required to resolve them. The gateway then takes each service’s response and combines them into a single response that’s returned to the querying client.

Implementing Federated GraphQL Microservices using Apollo Federation

Subscriptions

Subscriptions are not currently supported in Apollo Federation.

Subscriptions are long-lasting GraphQL read operations that can update their result whenever a particular server-side event occurs. Most commonly, updated results are pushed from the server to subscribing clients. For example, a chat application's server might use a subscription to push newly received messages to all clients in a particular chat room.

Using Subscriptions with a Federated Data Graph

This demonstration library shows how a decoupled subscription service can run alongside a federated data graph to provide real-time updates to a client.

Apollo AWS Lambda with GraphQL subscriptions

With this library you can do:

same things as with apollo-server-lambda by utiizing AWS API Gateway v1 GraphQL subscriptions over WebSocket by utilizing AWS API Gateway v2 and subscriptions-transport-ws

References

Edit this page
logo
Code-related notes and snippets