This repository serves as a guide and reference for building new templates that will be accessible via Rover.
Templates that are submitted by the community are expected to be maintained by the community. Because of the difficulty in enforcing this, we are currently only accepting templates contributed by the maintainers of the primary libraries that the template is built around. The template's repository should be located under the same account or organization as the primary library. For example, a template for Apollo Server should be located under the apollographql
organization.
In order to keep the template up to date with the latest template requirements, please follow releases on this repository. We will create a release each time a requirement changes or an optional feature is added.
Once your template meets all of the requirements below, contribute the template by opening an issue.
In order to be included in the list of templates that can be used with Rover, a template must meet the following requirements:
- Be located in an open source Git repository.
- Include a
LICENSE
file in the root of the repository with one of the approved license formats: - Include a
README.md
file in the root of the repo which describes what the template does, and the next steps to take after runningrover template use
with the template. For an example, see the Apollo Server template. - Include a
.github/workflows
directory with GitHub Actions workflows (see "Author Resources" below for examples) which:- Execute tests on pull request
- Run schema checks against Apollo Studio on pull request
- Publish schema to Apollo Studio on push to the default branch
- Implement the federated subgraph schema in
schema.graphql
to provide examples / boilerplate for consumers. You can optionally add more to the schema to show off more features of the library, but the schema file contains the minimum that must be implemented. - Include example tests which exercise all resolvers (query, mutation, and entity) in the schema. These tests must make GraphQL queries to the server, not simply call the resolver functions directly. Example queries which should be executed in tests are in
test_queries.graphql
. - Contain CORS rules compatible with Apollo Studio. The least permissive set is:
Access-Control-Allow-Origin: https://studio.apollographql.com
Access-Control-Allow-Methods: POST
Access-Control-Allow-Headers: Content-Type
- Be runnable via some start command immediately after cloning (and installing any required dependencies). In its simplest form, template usage is simply cloning the latest version of the repo. All templates are expected to be fully-functional GraphQL servers without any further editing for quick evaluation.
- Set up your code to be deployable on Railway with no additional configuration. Most Apollo tutorials currently direct users to Railway for deployment as an easy, free option. You can optionally add a Deploy to Railway button to your
README.md
file as an even quicker getting started option. - Configure Renovate or Dependabot to keep dependencies up to date more easily. Templates which fall too far out of date will be removed from the registry.
Feel free to look at any of the existing templates for help building your own. Get the latest list via rover template list
. Additionally, this repo contains a few sets of GitHub Actions workflows to get you started in the workflows
directory.