pub struct GraphQLAdapter { /* private fields */ }Expand description
GraphQL adapter for GraphQL queries and mutations
Handles GraphQL protocol-specific request/response transformation.
Implementations§
Source§impl GraphQLAdapter
impl GraphQLAdapter
Sourcepub fn new() -> GraphQLAdapter
pub fn new() -> GraphQLAdapter
Create a new GraphQL adapter
Sourcepub fn query(&mut self, name: &str, handler: &str) -> &mut GraphQLAdapter
pub fn query(&mut self, name: &str, handler: &str) -> &mut GraphQLAdapter
Register a GraphQL query
Sourcepub fn mutation(&mut self, name: &str, handler: &str) -> &mut GraphQLAdapter
pub fn mutation(&mut self, name: &str, handler: &str) -> &mut GraphQLAdapter
Register a GraphQL mutation
Sourcepub fn match_operation(
&self,
operation_type: OperationType,
name: &str,
) -> Option<&GraphQLOperation>
pub fn match_operation( &self, operation_type: OperationType, name: &str, ) -> Option<&GraphQLOperation>
Find a matching operation by name and type
Sourcepub fn parse_query(
&self,
query: &str,
) -> Result<(OperationType, String), String>
pub fn parse_query( &self, query: &str, ) -> Result<(OperationType, String), String>
Parse a GraphQL query string
Extracts operation type and operation name from a GraphQL query. Supports:
- Named queries: “query GetUser { user }”
- Shorthand queries: “{ user }”
- Named mutations: “mutation CreateUser { createUser }”
Sourcepub fn generate_schema(&self) -> String
pub fn generate_schema(&self) -> String
Generate GraphQL schema for registered operations
Generates GraphQL Schema Definition Language (SDL) from registered operations.
Trait Implementations§
Source§impl Default for GraphQLAdapter
impl Default for GraphQLAdapter
Source§fn default() -> GraphQLAdapter
fn default() -> GraphQLAdapter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GraphQLAdapter
impl RefUnwindSafe for GraphQLAdapter
impl Send for GraphQLAdapter
impl Sync for GraphQLAdapter
impl Unpin for GraphQLAdapter
impl UnwindSafe for GraphQLAdapter
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