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

chore: use graphql endpoint to fetch schema #1126

Merged
merged 4 commits into from
Jun 7, 2022

Conversation

EverlastingBugstopper
Copy link
Contributor

This PR updates rover-client/build.rs to fetch the schema hash instead of the etag. if the hash is different than what is on the local machine, the query will be re-run to fetch the schema and put it at ./.schema/schema.graphql.

cc @jsegaran

@netlify
Copy link

netlify bot commented May 6, 2022

Deploy Preview for apollo-cli-docs canceled.

Name Link
🔨 Latest commit bb0dbc6
🔍 Latest deploy log https://app.netlify.com/sites/apollo-cli-docs/deploys/629fb8a54ff5e600089618cf

}"#;

fn query(fetch_document: bool) -> Result<(String, Option<String>)> {
let graphql_endpoint = option_env!("APOLLO_GRAPHQL_SCHEMA_URL")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i'm not sure how useful this lever is - perhaps it would be better for us to support an environment variable that changes the variant we're fetching the schema from? not sure! fwiw i'm not sure if anybody is even using this endpoint right now for their build setups - it's not super easy to prototype w/Rover quite yet because of the inflexibility of rust's graphql-client library

Copy link
Contributor

Choose a reason for hiding this comment

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

Yea. I think for local dev stuff it would be nice if we could point to a different variant that has our testing or experimental features but it would require some work to make our testing variants public, so probably should scope out from this initial change?

This does set us up nicely to be able to fetch any schema from studio though so eventually devs could test things before they hit the public api.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍🏼 cool, i'll leave this as is then and as things progress we can revisit and make this a bit more configurable. thanks a bunch for doing the leg work to make this possible 😄

@EverlastingBugstopper EverlastingBugstopper force-pushed the avery/use-graphql-endpoint branch from 5906488 to 465075e Compare May 6, 2022 19:03
@EverlastingBugstopper EverlastingBugstopper added this to the 0.6.1 or 0.7.0 milestone May 6, 2022
@EverlastingBugstopper EverlastingBugstopper merged commit 9d5ce1b into main Jun 7, 2022
@EverlastingBugstopper EverlastingBugstopper deleted the avery/use-graphql-endpoint branch June 7, 2022 20:44
@EverlastingBugstopper EverlastingBugstopper added the fix 🩹 fixes a bug label Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix 🩹 fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants