【发布时间】:2019-09-11 20:05:47
【问题描述】:
我是 python 新手(javascript 开发人员
我正在关注一个关于使用 python 和石墨烯的教程(这不是很好地解释原因)
我的问题是当我打印 result 我收到时
<graphql.execution.base.ExecutionResult object at 0x1071ad410>
在 javascript 中,当您控制台日志时,您可以看到结果变量中包含的内容,
但不知道为什么我不能在 python 中做同样的事情,除非我做错了?
从谷歌搜索,它看起来像返回数据,但实际记录并在终端中查看它会很有用,
import graphene
import json
class Query(graphene.ObjectType):
hello = graphene.String()
is_admin = graphene.Boolean()
def resolve_hello(self, info):
return "world"
def resolve_is_admin(self, info):
return True
schema = graphene.Schema(query=Query)
result = schema.execute(
'''
{
isAdmin
}
'''
)
print(type(result))
print(result)
i would expect to see the what is the result of the variable `result`
【问题讨论】: