Skip to content

Add schema name step to Connectors init workflow #2647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 9, 2025

Conversation

alyssahursh
Copy link

This PR adds a schema naming step to the Connectors init workflow. Previously, running rover init for a Connectors project would generate a boilerplate schema named products. Not all customers have the concept of "products," and trying to change the name of the subgraph causes unnecessary friction. This change allows users to provide their own schema name, which is then populated into the supergraph.yaml file.

This PR is intended to be deployed with compensating changes in rover-init-starters: apollographql/rover-init-starters#51 This change should be deployed before those changes, as the reverse order will cause rover init to panic when it encounters a root-level .graphql file named schema.

Testing

  1. Renamed products.graphql to schema.graphql in rover-init-starters
  2. Pushed rover-init-starters changes to origin/schema-rename
  3. Updated rover to pull templates from schema-rename branch by modifying [repo_ref](https://github.com/apollographql/rover/blob/dd29b918fc84f862ab68c300b39d7f336d93f8ea/src/command/init/transitions.rs#L242) locally
  4. Ran cargo build to build these rover changes
  5. Aliased cargo rover to localrover with alias localrover='cargo run --manifest-path=/Users/alyssahursh/code/rover/Cargo.toml --bin rover --'
  6. Created new empty test directory
  7. Ran localrover init
  8. Verified that connectors init workflow prompted for a schema name
  9. Verified supergraph.yaml file was created using the newly provided schema name
subgraphs:
  alyssa-schema-name-test:
    routing_url: http://ignore
    schema:
      file: schema.graphql
federation_version: =2.11.0

This PR is part of the 2025 Hackathon.

@alyssahursh alyssahursh requested review from a team as code owners July 9, 2025 18:27
@apollo-librarian
Copy link
Contributor

apollo-librarian bot commented Jul 9, 2025

⚠️ Docs preview not attached to branch

The preview was not built because the PR's base branch release-0.35.0-beta is not in the list of sources.

An Apollo team member can comment one of the following commands to dictate which branch to attach the preview to:

  • !docs set-base-branch main

Build ID: e730a7e1b4754c17cf0607a1

@alyssahursh alyssahursh force-pushed the schema-name-alyssa-hackathon branch from da44f4f to 37bfaf2 Compare July 9, 2025 20:07
@alyssahursh alyssahursh changed the base branch from main to release-0.35.0-beta July 9, 2025 20:07
@alyssahursh alyssahursh force-pushed the schema-name-alyssa-hackathon branch from 37bfaf2 to 8a0d598 Compare July 9, 2025 20:32
@alyssahursh alyssahursh force-pushed the schema-name-alyssa-hackathon branch from 8a0d598 to d187ecd Compare July 9, 2025 21:29
@alyssahursh alyssahursh merged commit 114bee5 into release-0.35.0-beta Jul 9, 2025
32 checks passed
@alyssahursh alyssahursh deleted the schema-name-alyssa-hackathon branch July 9, 2025 22:22
alyssahursh added a commit that referenced this pull request Jul 10, 2025
This PR removes the use case guard clause in the schema name prompt.
When the original work to add the schema name prompt was written
(#2647), I made the incorrect
assumption that we would only want to prompt for a schema name in the
Connector use case. My changes were tested with and intended to work
with this PR:
apollographql/rover-init-starters#51

Because this work was done as part of the 2025 Hackathon project, a
different commit to `rover-init-starters` was merged instead:
apollographql/rover-init-starters#52 This
version assumes that the schema prompt will happen regardless of project
type. This PR adapts 2467 to work with the work that was merged in
`rover-init-starters`

### Testing
1. Ran `cargo build` to build these `rover` changes
1. Aliased `cargo rover` to `localrover` with `alias localrover='cargo
run --manifest-path=/Users/alyssahursh/code/rover/Cargo.toml --bin rover
--'`
1. Created new empty test directory
1. Ran `localrover init`
1. Verified that connectors init workflow prompted for a schema name
1. Verified `supergraph.yaml` file was created using the newly provided
schema name

```
graph_ref: my-api-m55izjn@current
subgraphs:
  main-schema-name:
    routing_url: http://localhost:4001
    schema:
      file: schema.graphql
```
@DaleSeo DaleSeo added this to the v0.35.0 milestone Jul 30, 2025
@DaleSeo DaleSeo added the feature 🎉 new commands, flags, functionality, and improved error messages label Jul 30, 2025
@DaleSeo DaleSeo mentioned this pull request Jul 30, 2025
DaleSeo added a commit that referenced this pull request Jul 30, 2025
# [0.35.0] - 2025-07-30

## ❗ BREAKING ❗

- **use config file for MCP server - @nicholascioli PR #2665**

## 🚀 Features

- **Update MCP options for rover dev - @DaleSeo PR #2661**
- **Add schema name step to Connectors init workflow - @alyssahursh PR
#2647**
- **Allow running rover dev without --supergraph-config if you have a
rover.yaml in the current directory - @dylan-apollo PR #2650**
- **Updating output for init & renaming generated "supergraph.yaml" ->
"rover.yaml" - @tayrrible PR #2651**
- **Adds support for .env file for use with rover dev - @DMallare PR
#2646**
- **Add graph_ref to and remove federation_version from subgraph.yaml -
@alyssahursh PR #2649**
- **Hackathon improvements to supergraph.yaml - @dylan-apollo PR #2648**
- **Adding link to studio for graph & showing each step in creation
process via spinners - @tayrrible PR #2657**
- **Generates .env file with rover init - @DMallare PR #2652**
- **Remove use case guard clause in schema name prompt - @alyssahursh PR
#2655**
- **Set APOLLO_GRAPH_REF from rover.yaml's graph_ref - @dylan-apollo PR
#2653**
- **Adding apollo.config.yaml file for connectors projects - @tayrrible
PR #2658**
- **add a note about the need for APOLLO_KEY and APOLLO_GRAPH_REF when
using router features or connect - @the-gigi-apollo PR #2677**
- **Update Studio Client after loading .env in rover dev - @dylan-apollo
PR #2654**
- **Exposing org selector for all runs of init and changing prompt order
- @tayrrible PR #2656**


## 🛠 Maintenance

- **upgrade schemars and apollo-federation-types - @DaleSeo PR #2676**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🎉 new commands, flags, functionality, and improved error messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants