How to use the tartiflette.language.ast.base.Node function in tartiflette

To help you get started, we’ve selected a few tartiflette 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 tartiflette / tartiflette / tartiflette / language / ast / base.py View on Github external
__slots__ = ()


class TypeDefinitionNode(TypeSystemDefinitionNode):
    __slots__ = ()


class TypeExtensionNode(TypeSystemExtensionNode):
    __slots__ = ()


class SelectionNode(Node):
    __slots__ = ()


class ValueNode(Node):
    __slots__ = ()


class TypeNode(Node):
    __slots__ = ()
github tartiflette / tartiflette / tartiflette / language / ast / operation_type_definition.py View on Github external
from typing import Any, Optional

from tartiflette.language.ast.base import Node

__all__ = ("OperationTypeDefinitionNode",)


class OperationTypeDefinitionNode(Node):
    """
    AST node representing a GraphQL operation type definition.
    """

    __slots__ = ("operation_type", "type", "location")

    def __init__(
        self,
        operation_type: str,
        type: "NamedTypeNode",  # pylint: disable=redefined-builtin
        location: Optional["Location"] = None,
    ) -> None:
        """
        :param operation_type: operation type of the operation type definition
        :param type: type of the operation type definition
        :param location: location of the operation type definition in the
github tartiflette / tartiflette / tartiflette / language / ast / input_value_definition.py View on Github external
from typing import Any, List, Optional

from tartiflette.language.ast.base import Node

__all__ = ("InputValueDefinitionNode",)


class InputValueDefinitionNode(Node):
    """
    AST node representing a GraphQL input value definition.
    """

    __slots__ = (
        "description",
        "name",
        "type",
        "default_value",
        "directives",
        "location",
    )

    def __init__(
        self,
        name: "NameNode",
github tartiflette / tartiflette / tartiflette / language / ast / base.py View on Github external
"ExecutableDefinitionNode",
    "TypeSystemDefinitionNode",
    "TypeSystemExtensionNode",
    "TypeDefinitionNode",
    "TypeExtensionNode",
    "SelectionNode",
    "ValueNode",
    "TypeNode",
)


class Node:
    __slots__ = ()


class DefinitionNode(Node):
    __slots__ = ()


class ExecutableDefinitionNode(DefinitionNode):
    __slots__ = ()


class TypeSystemDefinitionNode(DefinitionNode):
    __slots__ = ()


class TypeSystemExtensionNode(DefinitionNode):
    __slots__ = ()


class TypeDefinitionNode(TypeSystemDefinitionNode):
github tartiflette / tartiflette / tartiflette / language / ast / description.py View on Github external
from typing import Any, Optional

from tartiflette.language.ast.base import Node

__all__ = ("DescriptionNode",)


class DescriptionNode(Node):
    """
    AST node representing a GraphQL description.
    """

    __slots__ = ("value", "location")

    def __init__(
        self, value: str, location: Optional["Location"] = None
    ) -> None:
        """
        :param value: value of the description
        :param location: location of the description in the query/SDL
        :type value: str
        :type location: Optional[Location]
        """
        self.value = value
github tartiflette / tartiflette / tartiflette / language / ast / base.py View on Github external
__slots__ = ()


class TypeExtensionNode(TypeSystemExtensionNode):
    __slots__ = ()


class SelectionNode(Node):
    __slots__ = ()


class ValueNode(Node):
    __slots__ = ()


class TypeNode(Node):
    __slots__ = ()
github tartiflette / tartiflette / tartiflette / language / ast / name.py View on Github external
from typing import Any, Optional

from tartiflette.language.ast.base import Node

__all__ = ("NameNode",)


class NameNode(Node):
    """
    AST node representing a GraphQL name.
    """

    __slots__ = ("value", "location")

    def __init__(
        self, value: str, location: Optional["Location"] = None
    ) -> None:
        """
        :param value: value of the name
        :param location: location of the name in the query/SDL
        :type value: str
        :type location: Optional[Location]
        """
        self.value = value
github tartiflette / tartiflette / tartiflette / language / ast / base.py View on Github external
__slots__ = ()


class TypeSystemExtensionNode(DefinitionNode):
    __slots__ = ()


class TypeDefinitionNode(TypeSystemDefinitionNode):
    __slots__ = ()


class TypeExtensionNode(TypeSystemExtensionNode):
    __slots__ = ()


class SelectionNode(Node):
    __slots__ = ()


class ValueNode(Node):
    __slots__ = ()


class TypeNode(Node):
    __slots__ = ()
github tartiflette / tartiflette / tartiflette / language / ast / directive.py View on Github external
from typing import Any, List, Optional

from tartiflette.language.ast.base import Node

__all__ = ("DirectiveNode",)


class DirectiveNode(Node):
    """
    AST node representing a GraphQL directive.
    """

    __slots__ = ("name", "arguments", "location")

    def __init__(
        self,
        name: "NameNode",
        arguments: Optional[List["ArgumentNode"]] = None,
        location: Optional["Location"] = None,
    ) -> None:
        """
        :param name: name of the directive
        :param arguments: arguments of the directive
        :param location: location of the directive in the query/SDL
github tartiflette / tartiflette / tartiflette / language / ast / variable_definition.py View on Github external
from typing import Any, Optional

from tartiflette.language.ast.base import Node

__all__ = ("VariableDefinitionNode",)


class VariableDefinitionNode(Node):
    """
    AST node representing a GraphQL variable definition.
    """

    __slots__ = ("variable", "type", "default_value", "location")

    def __init__(
        self,
        variable: "VariableNode",
        type: "TypeNode",  # pylint: disable=redefined-builtin
        default_value: Optional["ValueNode"] = None,
        location: Optional["Location"] = None,
    ) -> None:
        """
        :param variable: variable of the variable definition
        :param type: type of the variable definition