Skip to content

v0.9.0-rc.1

Pre-release
Pre-release
Compare
Choose a tag to compare
@apollo-bot2 apollo-bot2 released this 19 Sep 21:57
· 678 commits to main since this release

testing 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

  1. clone apollographql/supergraph-demo-products
  2. clone apollographql/supergraph-demo-pandas
  3. clone apollographql/supergraph-demo-users
  4. cd supergraph-demo-products && npm i && npm run start to start your subgraph server
  5. 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
  6. cd ../supergraph-demo-pandas && npm i && npm run start to start your subgraph server
  7. 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 the pandas subgraph through the graph router
  8. cd ../supergraph-demo-users && npm i && npm run start
  9. 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, the pandas subgraph, and the users subgraph through the graph router
  10. 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.