【发布时间】:2018-07-17 15:32:42
【问题描述】:
我开始研究 GraphQL,因为我来自 python 背景,所以我将 GraphQL 与 Python 一起使用。 我按照Link 此处提供的步骤操作,但仍然遇到问题。
An error occurred while resolving field Query.hello
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/graphql/execution/executor.py", line 311, in resolve_or_error
return executor.execute(resolve_fn, source, info, **args)
File "/usr/local/lib/python3.5/dist-packages/graphql/execution/executors/sync.py", line 7, in execute
return fn(*args, **kwargs)
TypeError: resolve_hello() missing 2 required positional arguments: 'context' and 'info'
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/graphql/execution/executor.py", line 330, in complete_value_catching_error
exe_context, return_type, field_asts, info, result)
File "/usr/local/lib/python3.5/dist-packages/graphql/execution/executor.py", line 383, in complete_value
raise GraphQLLocatedError(field_asts, original_error=result)
graphql.error.located_error.GraphQLLocatedError: resolve_hello() missing 2 required positional arguments: 'context' and 'info'
None
请帮我解决问题。
【问题讨论】:
标签: python graphql graphene-python