Skip to content
Advertisement

Error in graphQL python example code

I am starting working on GraphQL and as I am from python background I am using GraphQL with Python. I followed the steps provided here Link but I am still facing issues.

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

Please, help me resolve the issue.

Advertisement

Answer

You are not giving much information here, maybe the code that triggers the error would be helpful, but googling I found some related posts

https://github.com/graphql-python/graphene/issues/601

https://github.com/graphql-python/graphene-django/issues/282

Maybe check the versions that you are using as they mention on the first link

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement