[][src]Struct warpgrapher::engine::objects::Node

pub struct Node<GlobalCtx, RequestCtx> where
    GlobalCtx: GlobalContext,
    RequestCtx: Debug + RequestContext
{ /* fields omitted */ }

Represents a node in the graph data structure for auto-generated CRUD operations and custom resolvers.

Examples


fn custom_resolve(facade: ResolverFacade<(), ()>) -> ExecutionResult {
    let typename = "User";

    let mut props = HashMap::new();
    props.insert("role".to_string(), Value::String("Admin".to_string()));

    let n = facade.create_node(typename, props);

    facade.resolve_node(&n)
}

Implementations

impl<GlobalCtx, RequestCtx> Node<GlobalCtx, RequestCtx> where
    GlobalCtx: GlobalContext,
    RequestCtx: RequestContext
[src]

pub fn fields(&self) -> &HashMap<String, Value>[src]

Returns the fields of a Node.

Example

use warpgrapher::engine::objects::Node;

fn handle_node(n: Node<(),()>) {
    let properties = n.fields();
}

Trait Implementations

impl<GlobalCtx: Clone, RequestCtx: Clone> Clone for Node<GlobalCtx, RequestCtx> where
    GlobalCtx: GlobalContext,
    RequestCtx: Debug + RequestContext
[src]

impl<GlobalCtx: Debug, RequestCtx: Debug> Debug for Node<GlobalCtx, RequestCtx> where
    GlobalCtx: GlobalContext,
    RequestCtx: Debug + RequestContext
[src]

impl<GlobalCtx, RequestCtx> GraphQLType<DefaultScalarValue> for Node<GlobalCtx, RequestCtx> where
    GlobalCtx: GlobalContext,
    RequestCtx: RequestContext
[src]

type Context = GraphQLContext<GlobalCtx, RequestCtx>

The expected context type for this GraphQL type Read more

type TypeInfo = Info

Type that may carry additional schema information Read more

Auto Trait Implementations

impl<GlobalCtx, RequestCtx> RefUnwindSafe for Node<GlobalCtx, RequestCtx> where
    GlobalCtx: RefUnwindSafe,
    RequestCtx: RefUnwindSafe

impl<GlobalCtx, RequestCtx> Send for Node<GlobalCtx, RequestCtx>

impl<GlobalCtx, RequestCtx> Sync for Node<GlobalCtx, RequestCtx>

impl<GlobalCtx, RequestCtx> Unpin for Node<GlobalCtx, RequestCtx> where
    GlobalCtx: Unpin,
    RequestCtx: Unpin

impl<GlobalCtx, RequestCtx> UnwindSafe for Node<GlobalCtx, RequestCtx> where
    GlobalCtx: UnwindSafe,
    RequestCtx: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,