How to use the sgqlc.types.Schema function in sgqlc

To help you get started, we’ve selected a few sgqlc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github profusion / sgqlc / tests / test-endpoint-requests.py View on Github external
def test_basic_operation_query(mock_requests_send):
    '[Requests] - Test if query with type sgqlc.operation.Operation() works'

    configure_mock_requests_send(mock_requests_send, graphql_response_ok)

    schema = Schema()

    # MyType and Query may be declared if doctests were processed by nose
    if 'MyType' in schema:
        schema -= schema.MyType

    if 'Query' in schema:
        schema -= schema.Query

    class MyType(Type):
        __schema__ = schema
        i = int

    class Query(Type):
        __schema__ = schema
        my_type = MyType
github profusion / sgqlc / tests / test-endpoint-websocket.py View on Github external
def test_operation_query(mock_websocket):
    'Test if query with type sgqlc.operation.Operation() or raw bytes works'

    schema = Schema()

    # MyType and Query may be declared if doctests were processed by nose
    if 'MyType' in schema:
        schema -= schema.MyType

    if 'Query' in schema:
        schema -= schema.Query

    class MyType(Type):
        __schema__ = schema
        i = int

    class Query(Type):
        __schema__ = schema
        my_type = MyType
github profusion / sgqlc / tests / test-endpoint-http.py View on Github external
def test_basic_operation_query(mock_urlopen):
    'Test if query with type sgqlc.operation.Operation() works'

    configure_mock_urlopen(mock_urlopen, graphql_response_ok)

    schema = Schema()

    # MyType and Query may be declared if doctests were processed by nose
    if 'MyType' in schema:
        schema -= schema.MyType

    if 'Query' in schema:
        schema -= schema.Query

    class MyType(Type):
        __schema__ = schema
        i = int

    class Query(Type):
        __schema__ = schema
        my_type = MyType
github chaoss / grimoirelab-sortinghat / sortinghat / cli / client / schema.py View on Github external
#
# Authors:
#     Santiago Dueñas 
#

"""
SortingHat client schema.

Automatically generated using sgqlc tools.
"""

import sgqlc.types
import sgqlc.types.datetime


sh_schema = sgqlc.types.Schema()


########################################################################
# Scalars and Enumerations
########################################################################
Boolean = sgqlc.types.Boolean

DateTime = sgqlc.types.datetime.DateTime


class GenericScalar(sgqlc.types.Scalar):
    __schema__ = sh_schema


ID = sgqlc.types.ID