How to use the tartiflette.types.exceptions.tartiflette.ImproperlyConfigured 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 / schema / schema.py View on Github external
def get_field_by_name(self, name: str) -> "GraphQLField":
        """
        Returns the field corresponding to the filled in name.
        :param name: name of the field with the following format "Parent.field"
        :type name: str
        :return: the field corresponding to the filled in name
        :rtype: GraphQLField
        """
        try:
            parent_name, field_name = name.split(".")
        except ValueError:
            raise ImproperlyConfigured(
                "field name must be of the format `TypeName.fieldName` got "
                f"`{name}`."
            )

        try:
            return self.type_definitions[parent_name].find_field(field_name)
        except (AttributeError, KeyError):
            raise UnknownSchemaFieldResolver(
                f"field `{name}` was not found in GraphQL schema."
            )
github tartiflette / tartiflette / tartiflette / schema / registry.py View on Github external
Resolver,
                TypeResolver,
                Scalar,
                Subscription,
            ]
        ]
        """
        if not obj:
            return

        SchemaRegistry._schemas.setdefault(schema_name, {}).setdefault(
            where, {}
        )

        if obj.name in SchemaRegistry._schemas[schema_name][where]:
            raise ImproperlyConfigured(
                "Can't register < %s > to < %s > %s because it's already "
                "registered" % (obj.name, schema_name, where)
            )

        SchemaRegistry._schemas[schema_name][where][obj.name] = obj
github tartiflette / tartiflette / tartiflette / types / exceptions / tartiflette.py View on Github external
pass


class GraphQLSchemaError(TartifletteError):
    pass


class GraphQLSyntaxError(TartifletteError):
    pass


class NonCallable(ImproperlyConfigured):
    pass


class NonCoroutine(ImproperlyConfigured):
    pass


class NonAwaitableResolver(ImproperlyConfigured):
    pass


class NonAsyncGeneratorSubscription(ImproperlyConfigured):
    pass


class NotSubscriptionField(ImproperlyConfigured):
    pass


class UnknownSchemaFieldResolver(TartifletteError):
github tartiflette / tartiflette / tartiflette / types / exceptions / tartiflette.py View on Github external
pass


class NonCallable(ImproperlyConfigured):
    pass


class NonCoroutine(ImproperlyConfigured):
    pass


class NonAwaitableResolver(ImproperlyConfigured):
    pass


class NonAsyncGeneratorSubscription(ImproperlyConfigured):
    pass


class NotSubscriptionField(ImproperlyConfigured):
    pass


class UnknownSchemaFieldResolver(TartifletteError):
    pass


class UnknownDirectiveDefinition(TartifletteError):
    pass


class UnknownScalarDefinition(TartifletteError):
github tartiflette / tartiflette / tartiflette / engine.py View on Github external
:param sdl: SDL with complementary content from already baked modules
    :param schema_name: schema name to link with
    :type imported_modules: List[object]
    :type sdl: str
    :type schema_name: str
    :return: couple list of imported modules instance/final SDL
    :rtype: Tuple[List[object], str]
    """
    for module in _BUILTINS_MODULES:
        try:
            module = import_module(module)
            sdl = "{sdl}\n{msdl}".format(
                sdl=sdl, msdl=await _bake_module(module, schema_name)
            )
            imported_modules.append(module)
        except ImproperlyConfigured:
            pass

    return imported_modules, sdl
github tartiflette / tartiflette / tartiflette / types / exceptions / tartiflette.py View on Github external
pass


class GraphQLSyntaxError(TartifletteError):
    pass


class NonCallable(ImproperlyConfigured):
    pass


class NonCoroutine(ImproperlyConfigured):
    pass


class NonAwaitableResolver(ImproperlyConfigured):
    pass


class NonAsyncGeneratorSubscription(ImproperlyConfigured):
    pass


class NotSubscriptionField(ImproperlyConfigured):
    pass


class UnknownSchemaFieldResolver(TartifletteError):
    pass


class UnknownDirectiveDefinition(TartifletteError):
github tartiflette / tartiflette / tartiflette / types / exceptions / tartiflette.py View on Github external
pass


class UnknownScalarDefinition(TartifletteError):
    pass


class UnknownFieldDefinition(TartifletteError):
    pass


class UnknownTypeDefinition(TartifletteError):
    pass


class MissingImplementation(ImproperlyConfigured):
    pass


class RedefinedImplementation(TartifletteError):
    pass


class CoercionError(TartifletteError):
    pass