Module schemadiff.changes.schema

Expand source code
from schemadiff.changes import Change, Criticality


class SchemaChange(Change):
    criticality = Criticality.breaking('Changing a root type is a breaking change')

    def __init__(self, old_type, new_type):
        self.old_type = old_type
        self.new_type = new_type

    @property
    def path(self):
        return self.new_type


class SchemaQueryTypeChanged(SchemaChange):

    @property
    def message(self):
        return f"Schema query root has changed from `{self.old_type}` to `{self.new_type}`"


class SchemaMutationTypeChanged(SchemaChange):

    @property
    def message(self):
        return f"Schema mutation root has changed from `{self.old_type}` to `{self.new_type}`"


class SchemaSubscriptionTypeChanged(SchemaChange):

    @property
    def message(self):
        return f"Schema subscription root has changed from `{self.old_type}` to `{self.new_type}`"

Classes

class SchemaChange (old_type, new_type)

Common interface of all schema changes

This class offers the common operations and properties of all schema changes. You may use it as a type hint to get better suggestions in your editor of choice.

Expand source code
class SchemaChange(Change):
    criticality = Criticality.breaking('Changing a root type is a breaking change')

    def __init__(self, old_type, new_type):
        self.old_type = old_type
        self.new_type = new_type

    @property
    def path(self):
        return self.new_type

Ancestors

Subclasses

Class variables

var criticalityCriticality

Inherited members

class SchemaMutationTypeChanged (old_type, new_type)

Common interface of all schema changes

This class offers the common operations and properties of all schema changes. You may use it as a type hint to get better suggestions in your editor of choice.

Expand source code
class SchemaMutationTypeChanged(SchemaChange):

    @property
    def message(self):
        return f"Schema mutation root has changed from `{self.old_type}` to `{self.new_type}`"

Ancestors

Inherited members

class SchemaQueryTypeChanged (old_type, new_type)

Common interface of all schema changes

This class offers the common operations and properties of all schema changes. You may use it as a type hint to get better suggestions in your editor of choice.

Expand source code
class SchemaQueryTypeChanged(SchemaChange):

    @property
    def message(self):
        return f"Schema query root has changed from `{self.old_type}` to `{self.new_type}`"

Ancestors

Inherited members

class SchemaSubscriptionTypeChanged (old_type, new_type)

Common interface of all schema changes

This class offers the common operations and properties of all schema changes. You may use it as a type hint to get better suggestions in your editor of choice.

Expand source code
class SchemaSubscriptionTypeChanged(SchemaChange):

    @property
    def message(self):
        return f"Schema subscription root has changed from `{self.old_type}` to `{self.new_type}`"

Ancestors

Inherited members