Skip to content
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

feat: Fetch templates from a GraphQL API (#1388)Co-authored-by: Dylan Anthony <[email protected]> Co-authored-by: Avery Harnish <[email protected]> #1388

Merged
merged 7 commits into from
Mar 10, 2023

Conversation

dbanty
Copy link
Contributor

@dbanty dbanty commented Oct 25, 2022

Draft implementation of moving template definitions into an external service.

Copy link
Contributor

@EverlastingBugstopper EverlastingBugstopper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Thanks for throwing this together - let me know if I can clarify anything here.

Cargo.toml Show resolved Hide resolved
rust-toolchain.toml Outdated Show resolved Hide resolved
src/command/template/.gitignore Show resolved Hide resolved
src/command/template/queries.rs Show resolved Hide resolved
src/command/template/regenerate_queries.sh Outdated Show resolved Hide resolved
src/command/template/templates.rs Show resolved Hide resolved
src/options/template.rs Outdated Show resolved Hide resolved
@dbanty
Copy link
Contributor Author

dbanty commented Nov 3, 2022

TODO:

  • Add the API to the normal Apollo API
  • Move this client code into the rover-client crate
  • Swap out the .sh regenerate script for xtask or build.rs
  • Open an issue to explore converting the rest of rover-client to generation

@EverlastingBugstopper EverlastingBugstopper marked this pull request as draft November 3, 2022 21:19
@dbanty dbanty marked this pull request as ready for review February 23, 2023 20:53
@dbanty
Copy link
Contributor Author

dbanty commented Feb 23, 2023

Long awaited updates:

  1. We will not be including this functionality in the core platform API for now; instead, we have a separate "DX" supergraph with a templates subgraph hosted in Apollo's Netlify account (to get this off of my personal Railway account).
  2. Template submission process and the source for the templates subgraph live in https://github.com/apollographql/templates which will be open source soon. Specifically, https://github.com/apollographql/templates/blob/main/netlify/functions/server/templates.json should correspond to
    const TEMPLATES: [GithubTemplate; 8] = [

@dbanty
Copy link
Contributor Author

dbanty commented Mar 8, 2023

TODO: change the templates GraphQL URL once https://github.com/apollographql/orbiter/pull/74 is merged

Done!

Copy link
Contributor

@EverlastingBugstopper EverlastingBugstopper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Great work on this - excited to have dynamic templates so quickly 😄

@EverlastingBugstopper EverlastingBugstopper added this to the vNext milestone Mar 9, 2023
@EverlastingBugstopper EverlastingBugstopper added the feature 🎉 new commands, flags, functionality, and improved error messages label Mar 10, 2023
@EverlastingBugstopper EverlastingBugstopper changed the title feat: Fetch templates from a GraphQL API feat: Fetch templates from a GraphQL API (#1388)Co-authored-by: Dylan Anthony <[email protected]> Co-authored-by: Avery Harnish <[email protected]> Mar 10, 2023
@EverlastingBugstopper EverlastingBugstopper merged commit 53310ed into main Mar 10, 2023
@EverlastingBugstopper EverlastingBugstopper deleted the graphql-templates branch March 10, 2023 00:03
EverlastingBugstopper pushed a commit that referenced this pull request Mar 10, 2023
…oreply.github.com>

# [0.13.0] - 2023-03-10

## 🚀 Features

- **Dynamic templates - @dbanty, #1388**

Rover now fetches templates from a GraphQL API. New templates can be
contributed to [the templates
repo](https://github.com/apollographql/templates) and will not require a
new release of Rover to be used. To see the latest templates, run `rover
template list`.

## 🐛 Fixes

- **Fixes behavior of `--router-config` in `rover dev` -
@EverlastingBugstopper, #1536 fixes #1535**

Older versions of Rover did not respect the `supergraph` section of the
`--router-config` file. This has been fixed in v0.13.0.

---------

Co-authored-by: Dylan Anthony <[email protected]>
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