Python GraphenePython 的 GraphQL 框架
Graphene 是 Python 的 GraphQL 框架,用于快速輕松構(gòu)建 GraphQL schemas/types 。支持多種數(shù)據(jù)源,包括 SQL(Django、SQLAlchemy)、NoSQL、自定義 Python 對(duì)象等等。
示例代碼:
import graphene
class Query(graphene.ObjectType):
hello = graphene.String()
def resolve_hello(self, args, context, info):
return 'World'
schema = graphene.Schema(query=Query)
schema.execute('''
query {
hello
}
''')評(píng)論
圖片
表情
