This repository contains a set of plugins and packages designed to streamline the migration from Apollo to Cosmo.
Before using the examples below, ensure you have created an API token for your federated graph on Cosmo. You can generate this token by running the following wgc command:
wgc router token create
npm i @wundergraph/cosmo-to-apollo-schema
The Schema Loader is an Apollo Gateway plugin that enables seamless integration of your subgraphs from Cosmo's execution configuration. It helps compose the subgraphs into a Supergraph SDL, simplifying the transition to Cosmo.
Once you have the token, you can use it in your environment file (.env
) as shown in the full example. The following code snippet demonstrates how easy it is to integrate the Schema Loader into your Apollo Gateway setup:
Example: Apollo Gateway with Schema Loader
npm i @wundergraph/apollo-to-cosmo-metrics
The Metric Exporter is a plugin that enables the collection and export of schema usage metrics from Apollo Gateway to Cosmo. It helps you monitor and analyze the usage of your clients and use Cosmo's powerful analytics features like breaking changes detection and schema evolution.
Once you have the token, you can use it in your environment file (.env
) as shown in the full example. The following code snippet demonstrates how easy it is to integrate the metrics exporter into your Apollo Gateway setup:
Example: Apollo Gateway with Metrics Exporter
This project is licensed under the Apache License, Version 2.0.