当前位置: 首页>>代码示例>>Python>>正文


Python graphene.Interface方法代码示例

本文整理汇总了Python中graphene.Interface方法的典型用法代码示例。如果您正苦于以下问题:Python graphene.Interface方法的具体用法?Python graphene.Interface怎么用?Python graphene.Interface使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在graphene的用法示例。


在下文中一共展示了graphene.Interface方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init_subclass_with_meta__

# 需要导入模块: import graphene [as 别名]
# 或者: from graphene import Interface [as 别名]
def __init_subclass_with_meta__(cls, _meta=None, **options):
        if not _meta:
            _meta = InterfaceOptions(cls)

        fields = {}
        for base in reversed(cls.__mro__):
            fields.update(yank_fields_from_attrs(base.__dict__, _as=Field))

        if _meta.fields:
            _meta.fields.update(fields)
        else:
            _meta.fields = fields

        super(Interface, cls).__init_subclass_with_meta__(_meta=_meta, **options) 
开发者ID:graphql-python,项目名称:graphene,代码行数:16,代码来源:interface.py

示例2: __init__

# 需要导入模块: import graphene [as 别名]
# 或者: from graphene import Interface [as 别名]
def __init__(self, *args, **kwargs):
        raise Exception("An Interface cannot be initialized") 
开发者ID:graphql-python,项目名称:graphene,代码行数:4,代码来源:interface.py

示例3: test_pynamo_interface

# 需要导入模块: import graphene [as 别名]
# 或者: from graphene import Interface [as 别名]
def test_pynamo_interface():
    assert issubclass(Node, Interface)
    assert issubclass(Node, Node) 
开发者ID:yfilali,项目名称:graphql-pynamodb,代码行数:5,代码来源:test_types.py

示例4: __init__

# 需要导入模块: import graphene [as 别名]
# 或者: from graphene import Interface [as 别名]
def __init__(self):
        self._typeMap = {}
        self.Field = create_registry_field(self)
        self.Argument = create_registry_argument(self)
        self.List = create_registry_list(self)
        self.NonNull = create_registry_nonnull(self)
        registering_metaclass = create_registering_metaclass(self)
        self.Union = create_union(registering_metaclass, self)
        self.Enum = create_enum(registering_metaclass)
        self.Mutation = graphene.Mutation

        # Not looping over GRAPHENE_TYPES in order to not fool lint
        self.ObjectType = create_registering_class(graphene.ObjectType, registering_metaclass)
        self.InputObjectType = create_registering_class(
            graphene.InputObjectType, registering_metaclass
        )
        self.Interface = create_registering_class(graphene.Interface, registering_metaclass)
        self.Scalar = create_registering_class(graphene.Scalar, registering_metaclass)

        # Not looping over GRAPHENE_BUILTINS in order to not fool lint
        self.String = graphene.String
        self.addType(graphene.String)
        self.Int = graphene.Int
        self.addType(graphene.Int)
        self.Float = graphene.Float
        self.addType(graphene.Float)
        self.Boolean = graphene.Boolean
        self.addType(graphene.Boolean)
        self.ID = graphene.ID
        self.addType(graphene.ID)
        self.GenericScalar = GenericScalar
        self.addType(GenericScalar) 
开发者ID:dagster-io,项目名称:dagster,代码行数:34,代码来源:dauphin_registry.py

示例5: test_mongoengine_interface

# 需要导入模块: import graphene [as 别名]
# 或者: from graphene import Interface [as 别名]
def test_mongoengine_interface():
    assert issubclass(Node, Interface)
    assert issubclass(Node, Node) 
开发者ID:graphql-python,项目名称:graphene-mongo,代码行数:5,代码来源:test_types.py

示例6: test_django_interface

# 需要导入模块: import graphene [as 别名]
# 或者: from graphene import Interface [as 别名]
def test_django_interface():
    assert issubclass(Node, Interface)
    assert issubclass(Node, Node) 
开发者ID:graphql-python,项目名称:graphene-django,代码行数:5,代码来源:test_types.py


注:本文中的graphene.Interface方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。