pub struct CapabilitiesQuery { /* private fields */ }Expand description
A query that detects what capabilities a remote GraphQL server has, which can be used to determine what introspection query should be made against that server.
Currently this just determines which version of the specification the server supports, but it may be extended in the future to detect other capabilities e.g. which RFCs a server has implemented support for.
use cynic::{QueryBuilder, http::ReqwestExt};
use cynic_introspection::CapabilitiesQuery;
let data = reqwest::Client::new()
.post(url)
.run_graphql(CapabilitiesQuery::build(()))
.await
.unwrap()
.data
.unwrap();
let capabilities = data.capabilities();
println!("This server supports {capabilities:?}");Implementations§
Source§impl CapabilitiesQuery
impl CapabilitiesQuery
Sourcepub fn capabilities(&self) -> CapabilitySet
pub fn capabilities(&self) -> CapabilitySet
The capabilities that were detected by this query
Trait Implementations§
Source§impl Debug for CapabilitiesQuery
impl Debug for CapabilitiesQuery
Source§impl<'de> Deserialize<'de> for CapabilitiesQuery
impl<'de> Deserialize<'de> for CapabilitiesQuery
Source§fn deserialize<__D>(deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl QueryFragment for CapabilitiesQuery
impl QueryFragment for CapabilitiesQuery
Source§type SchemaType = Query
type SchemaType = Query
The type in a schema that this
QueryFragment representsSource§type VariablesFields = ()
type VariablesFields = ()
The variables that are required to execute this
QueryFragmentSource§fn query(builder: SelectionBuilder<'_, Self::SchemaType, Self::VariablesFields>)
fn query(builder: SelectionBuilder<'_, Self::SchemaType, Self::VariablesFields>)
Adds this fragment to the query being built by
builderAuto Trait Implementations§
impl Freeze for CapabilitiesQuery
impl RefUnwindSafe for CapabilitiesQuery
impl Send for CapabilitiesQuery
impl Sync for CapabilitiesQuery
impl Unpin for CapabilitiesQuery
impl UnwindSafe for CapabilitiesQuery
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more