-
Notifications
You must be signed in to change notification settings - Fork 94
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
Conversation
✅ Deploy Preview for apollo-cli-docs canceled.
|
}"#; | ||
|
||
fn query(fetch_document: bool) -> Result<(String, Option<String>)> { | ||
let graphql_endpoint = option_env!("APOLLO_GRAPHQL_SCHEMA_URL") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 😄
5906488
to
465075e
Compare
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