wasmer_registry/graphql/
queries.rs

1//! Low-level GraphQL queries used by this crate.
2//!
3//! If possible, users should prefer the high-level functions exposed under
4//! [`crate`].
5//!
6//! This module is primarily used in combination with
7//! [`crate::graphql::execute_query()`] as an "escape hatch" for accessing
8//! information that may not be exposed via the high-level functions.
9//!
10//! # Backwards Compatibility
11//!
12//! Queries won't be deleted or have breaking changes to their inputs during
13//! patch releases, however new fields may be added to the response types
14//! generated by `graphql_client` at any time.
15//!
16//! Users should treat all response types as if they had the `#[non_exhaustive]`
17//! attribute.
18
19use graphql_client::GraphQLQuery;
20
21#[derive(GraphQLQuery)]
22#[graphql(
23    schema_path = "graphql/schema.graphql",
24    query_path = "graphql/queries/get_package_version.graphql",
25    response_derives = "Debug"
26)]
27pub(crate) struct GetPackageVersionQuery;
28
29#[derive(GraphQLQuery)]
30#[graphql(
31    schema_path = "graphql/schema.graphql",
32    query_path = "graphql/queries/get_package_by_command.graphql",
33    response_derives = "Debug"
34)]
35pub(crate) struct GetPackageByCommandQuery;
36
37#[derive(GraphQLQuery)]
38#[graphql(
39    schema_path = "graphql/schema.graphql",
40    query_path = "graphql/queries/test_if_registry_present.graphql",
41    response_derives = "Debug"
42)]
43pub(crate) struct TestIfRegistryPresent;
44
45#[derive(GraphQLQuery)]
46#[graphql(
47    schema_path = "graphql/schema.graphql",
48    query_path = "graphql/queries/get_bindings.graphql",
49    response_derives = "Debug,Clone,PartialEq,Eq"
50)]
51pub(crate) struct GetBindingsQuery;
52
53#[derive(GraphQLQuery)]
54#[graphql(
55    schema_path = "graphql/schema.graphql",
56    query_path = "graphql/queries/get_signed_url.graphql",
57    response_derives = "Debug, Clone"
58)]
59pub(crate) struct GetSignedUrl;
60
61#[derive(GraphQLQuery)]
62#[graphql(
63    schema_path = "graphql/schema.graphql",
64    query_path = "graphql/queries/get_interface_version.graphql",
65    response_derives = "Debug"
66)]
67pub(crate) struct GetInterfaceVersionQuery;
68
69#[derive(GraphQLQuery)]
70#[graphql(
71    schema_path = "graphql/schema.graphql",
72    query_path = "graphql/queries/whoami.graphql",
73    response_derives = "Debug"
74)]
75pub struct WhoAmIQuery;