v0.9.0-rc.1
Pre-releasetesting instructions
This release candidate includes rover dev
which allows you to develop a supergraph on your local machine.
help text
$ rover dev --help
rover-dev
Run your supergraph locally with a router and one or more subgraphs.
The first `rover dev` process you run starts a dev instance of the Apollo Router and connects it to
the running subgraph you specify. You can then run additional instances of `rover dev` to add more
subgraphs to your local supergraph (the same router instance is used). As you add subgraphs, `rover
dev` automatically composes all subgraph schemas into a new supergraph schema for the router.
The router instance is tied to the *first* `rover dev` process. If you terminate that process, the
router terminates. If you terminate a `rover dev` process *besides* the first process (thereby
removing a subgraph), a new supergraph schema is composed from the remaining subgraphs.
⚠️ Do not run this command in production! ⚠️ It is intended for local development.
USAGE:
rover dev [OPTIONS]
OPTIONS:
--name <SUBGRAPH_NAME>
The name of the subgraph.
This must be unique to each `rover dev` session.
-p, --supergraph-port <SUPERGRAPH_PORT>
The port the graph router should listen on.
If you start multiple `rover dev` sessions on the same port, they will communicate with
each other.
If you start multiple `rover dev` sessions with different ports, they will not
communicate with each other.
[default: 3000]
--supergraph-address <SUPERGRAPH_ADDRESS>
The address the graph router should listen on.
If you start multiple `rover dev` sessions on the same address and port, they will
communicate with each other.
[default: 127.0.0.1]
-s, --schema <SUBGRAPH_SCHEMA_PATH>
The path to a GraphQL schema file that `rover dev` will use as this subgraph's schema.
If this argument is passed, `rover dev` does not periodically introspect the running
subgraph to obtain its schema. Instead, it watches the file at the provided path and
recomposes the supergraph schema whenever changes occur.
-u, --url <SUBGRAPH_URL>
The URL that the `rover dev` router should use to communicate with this running subgraph
(e.g., http://localhost:3000).
This must be unique to each `rover dev` session and cannot be the same endpoint used by
the graph router, which are specified by the `--port` argument.
Installation
Linux/MacOS/WSL
Run the following command:
curl -sSL https://rover.apollo.dev/nix/v0.9.0-rc.1 | sh
Windows
Run the following command
iwr https://rover.apollo.dev/win/v0.9.0-rc.1 | iex
Run rover --version
and make sure that the version is equal to v0.9.0-rc.1
. If it is not, you should run npm uninstall -g @apollo/rover
, and try rover --version
again.
Usage
pre-made demo
- clone apollographql/supergraph-demo-products
- clone apollographql/supergraph-demo-pandas
- clone apollographql/supergraph-demo-users
cd supergraph-demo-products && npm i && npm run start
to start your subgraph server- open a new terminal and run
rover dev
- you should be prompted for the subgraph name and to watch the schema, just press enter twice to accept
- you may also be prompted to accept the ELv2 license - you will only have to accept that one time
- enter the subgraph URL that was output in the other terminal
- you should see that composition succeeded and that the router is now running!
- navigate to http://localhost:3000 in your browser to make queries against the
products
subgraph through the graph router
cd ../supergraph-demo-pandas && npm i && npm run start
to start your subgraph server- open a new terminal and run
rover dev
- you should be prompted for the subgraph name and to watch the schema, just press enter twice to accept
- enter the subgraph URL that was output in the other terminal
- you should see messages saying the other
rover dev
session was notified of the new schema, and the other terminal should re-compose and reload the router - navigate to http://localhost:3000 in your browser to make queries against the
products
subgraph and thepandas
subgraph through the graph router
cd ../supergraph-demo-users && npm i && npm run start
- open a new terminal and run
rover dev
- you should be prompted for the subgraph name and to watch the schema, just press enter twice to accept
- enter the subgraph URL that was output in the other terminal
- you should see messages saying the other
rover dev
session was notified of the new schema, and the other terminal should re-compose and reload the router - navigate to http://localhost:3000 in your browser to make queries against the
products
subgraph, thepandas
subgraph, and theusers
subgraph through the graph router
- you can now make changes to the source code of any of these subgraphs and the supergraph will recompose if/when the schema for a subgraph changes.
nodemon
takes care of reloading the subgraphs themselves if only logic has changed and the schema is the same.
your own subgraphs
cd
into multiple subgraph directories, start the subgraph server, and run rover dev
for each of them, one by one, and follow the prompts. you should be able to see a locally running router after your first subgraph, and it should reload with changes when you add/remove/edit other subgraphs.
This release was automatically created by CircleCI.
If you would like to verify that the binary you have downloaded was built from the source code in this repository, you can compute a checksum of the zipped tarball and compare it to the checksums that are included as release artifacts.
Binaries built for MacOS are signed, notarized, and automatically verified with Gatekeeper.