-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3360: Introduce a "wasmer_registry::queries" module with all GraphQL queries r=fschutt a=Michael-F-Bryan This makes all queries used in the `wasmer-registry` crate public. See #3355 (comment) for some more context. Co-authored-by: Michael-F-Bryan <[email protected]>
- Loading branch information
Showing
3 changed files
with
76 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
//! Low-level GraphQL queries used by this crate. | ||
//! | ||
//! If possible, users should prefer the high-level functions exposed under | ||
//! [`crate`]. | ||
//! | ||
//! This module is primarily used in combination with | ||
//! [`crate::graphql::execute_query()`] as an "escape hatch" for accessing | ||
//! information that may not be exposed via the high-level functions. | ||
//! | ||
//! # Backwards Compatibility | ||
//! | ||
//! Queries won't be deleted or have breaking changes to their inputs during | ||
//! patch releases, however new fields may be added to the response types | ||
//! generated by `graphql_client` at any time. | ||
//! | ||
//! Users should treat all response types as if they had the `#[non_exhaustive]` | ||
//! attribute. | ||
use graphql_client::*; | ||
|
||
/// The GraphQL schema exposed by the WAPM backend. | ||
pub const SCHEMA: &str = include_str!("../graphql/schema.graphql"); | ||
|
||
#[derive(GraphQLQuery)] | ||
#[graphql( | ||
schema_path = "graphql/schema.graphql", | ||
query_path = "graphql/queries/get_package_version.graphql", | ||
response_derives = "Debug" | ||
)] | ||
pub struct GetPackageVersionQuery; | ||
|
||
#[derive(GraphQLQuery)] | ||
#[graphql( | ||
schema_path = "graphql/schema.graphql", | ||
query_path = "graphql/queries/whoami.graphql", | ||
response_derives = "Debug" | ||
)] | ||
pub struct WhoAmIQuery; | ||
|
||
#[derive(GraphQLQuery)] | ||
#[graphql( | ||
schema_path = "graphql/schema.graphql", | ||
query_path = "graphql/queries/get_package_by_command.graphql", | ||
response_derives = "Debug" | ||
)] | ||
pub struct GetPackageByCommandQuery; | ||
|
||
#[derive(GraphQLQuery)] | ||
#[graphql( | ||
schema_path = "graphql/schema.graphql", | ||
query_path = "graphql/queries/test_if_registry_present.graphql", | ||
response_derives = "Debug" | ||
)] | ||
pub struct TestIfRegistryPresent; | ||
|
||
#[derive(GraphQLQuery)] | ||
#[graphql( | ||
schema_path = "graphql/schema.graphql", | ||
query_path = "graphql/queries/get_bindings.graphql", | ||
response_derives = "Debug,Clone,PartialEq,Eq" | ||
)] | ||
pub struct GetBindingsQuery; |