Example #1
0
def test_typed_query(password_client):

    from bergen.query import TypedGQL

    nana = TypedGQL(
        '''query Nodes{
        nodes {
            id
        }
    }''', Node).run(ward=password_client.main_ward)

    assert len(nana) >= 1, "Your Arnheim Instance seems to have no nodes?"
Example #2
0
from bergen.schema import DataModel
from bergen.query import TypedGQL

HOST_GQL = TypedGQL(
    """
    mutation Host($identifier: String!, $extenders: [String]){
        host(identifier: $identifier, extenders: $extenders){
            id
            identifier
            extenders
            point {
                inward
            }
        }
    }
""", DataModel)
Example #3
0
from bergen.queries.delayed.node import DETAIL_NODE_FR
from bergen.schema import Assignation, Node, Peasent, Template, Pod, Provision, Transcript, VartPod, Volunteer
from bergen.query import TypedGQL

# Peasent Constants

SERVE_GQL = TypedGQL(
    """
    mutation Serve($name: String!){
        serve(name: $name){
            id
            name
            
        }
    }
""", Peasent)

OFFER_GQL = TypedGQL(
    """
    mutation Offer($node: ID!, $params: GenericScalar!, $policy: GenericScalar!){
        offer(node: $node, params: $params, policy: $policy){
            id
            name
            policy 
        }
    }
""", Template)

ACCEPT_GQL = TypedGQL(
    """
    mutation Accept($template: ID!, $provision: String!){