(self, typ)
return self
Manually add a type to the schema.

        Types are automatically once their class is created. Only use
        this if you're copying a type from one schema to another.

        Note that the type name ``str(typ)`` must not exist in the
        schema, otherwise :class:`ValueError` is raised.

        To remove a type, use ``schema -= typ``.

        As explained in the :mod:`sgqlc.types` documentation, the
        newly created schema will inherit types from the base schema
        only at creation time:

        >>> my_schema = Schema(global_schema)
        >>> class MySchemaType(Type):
        ...     __schema__ = my_schema
        ...     i = int
        ...
        >>> 'MySchemaType' in global_schema
        False
        >>> 'MySchemaType' in my_schema
        True

        But ``__iadd__`` and ``__isub__`` can be used to add or remove
        types:

        >>> global_schema += MySchemaType
        >>> 'MySchemaType' in global_schema
        True
        >>> global_schema -= MySchemaType
        >>> 'MySchemaType' in global_schema
        False

        Note that different type with the same name can't be added:

        >>> my_schema2 = Schema(global_schema)
        >>> class MySchemaType(Type):   # redefining, different schema: ok
        ...     __schema__ = my_schema2
        ...     f = float
        ...
        >>> my_schema += MySchemaType
        Traceback (most recent call last):
          ...
        ValueError: Schema already has MySchemaType=MySchemaType
Manually add a type to the schema.
Manually add a type to the schema .
def __iadd__(self, typ):
        '''Manually add a type to the schema.

        Types are automatically once their class is created. Only use
        this if you're copying a type from one schema to another.

        Note that the type name ``str(typ)`` must not exist in the
        schema, otherwise :class:`ValueError` is raised.

        To remove a type, use ``schema -= typ``.

        As explained in the :mod:`sgqlc.types` documentation, the
        newly created schema will inherit types from the base schema
        only at creation time:

        >>> my_schema = Schema(global_schema)
        >>> class MySchemaType(Type):
        ...     __schema__ = my_schema
        ...     i = int
        ...
        >>> 'MySchemaType' in global_schema
        False
        >>> 'MySchemaType' in my_schema
        True

        But ``__iadd__`` and ``__isub__`` can be used to add or remove
        types:

        >>> global_schema += MySchemaType
        >>> 'MySchemaType' in global_schema
        True
        >>> global_schema -= MySchemaType
        >>> 'MySchemaType' in global_schema
        False

        Note that different type with the same name can't be added:

        >>> my_schema2 = Schema(global_schema)
        >>> class MySchemaType(Type):   # redefining, different schema: ok
        ...     __schema__ = my_schema2
        ...     f = float
        ...
        >>> my_schema += MySchemaType
        Traceback (most recent call last):
          ...
        ValueError: Schema already has MySchemaType=MySchemaType
        '''
        name = typ.__name__
        t = self.__all.setdefault(name, typ)
        if t is not typ:
            raise ValueError('%s already has %s=%s' %
                             (self.__class__.__name__, name, typ))
        self.__kinds.setdefault(typ.__kind__, ODict()).update({name: typ})
        if self.query_type is None and name == 'Query':
            self.query_type = t
        if self.mutation_type is None and name == 'Mutation':
            self.mutation_type = t
        if self.subscription_type is None and name == 'Subscription':
            self.subscription_type = t  # pragma: no cover
        return self
def __iadd__ ( self , typ ) : name = typ . __name__ t = self . __all . setdefault ( name , typ ) if t is not typ : raise ValueError ( '%s already has %s=%s' % ( self . __class__ . __name__ , name , typ ) ) self . __kinds . setdefault ( typ . __kind__ , ODict ( ) ) . update ( { name : typ } ) if self . query_type is None and name == 'Query' : self . query_type = t if self . mutation_type is None and name == 'Mutation' : self . mutation_type = t if self . subscription_type is None and name == 'Subscription' : self . subscription_type = t # pragma: no cover return self