Skip to content
Merged

2.0 #133

Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added context into ResolveInfo
  • Loading branch information
syrusakbary committed Jul 27, 2017
commit e25a92d74a50053d650ecdbfa4e5700dcaaf48e4
5 changes: 3 additions & 2 deletions graphql/execution/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,10 @@ def get_field_entry_key(node):

class ResolveInfo(object):
__slots__ = ('field_name', 'field_asts', 'return_type', 'parent_type',
'schema', 'fragments', 'root_value', 'operation', 'variable_values')
'schema', 'fragments', 'root_value', 'operation', 'variable_values', 'context')

def __init__(self, field_name, field_asts, return_type, parent_type,
schema, fragments, root_value, operation, variable_values):
schema, fragments, root_value, operation, variable_values, context):
self.field_name = field_name
self.field_asts = field_asts
self.return_type = return_type
Expand All @@ -285,6 +285,7 @@ def __init__(self, field_name, field_asts, return_type, parent_type,
self.root_value = root_value
self.operation = operation
self.variable_values = variable_values
self.context = context


def default_resolve_fn(source, args, context, info):
Expand Down
1 change: 1 addition & 0 deletions graphql/execution/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def resolve_field(exe_context, parent_type, source, field_asts):
root_value=exe_context.root_value,
operation=exe_context.operation,
variable_values=exe_context.variable_values,
context=context
)

executor = exe_context.executor
Expand Down
1 change: 1 addition & 0 deletions graphql/execution/experimental/fragment.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def get_resolvers(context, type, field_asts):
root_value=context and context.root_value,
operation=context and context.operation,
variable_values=context and context.variable_values,
context=context
)
if isinstance(field_base_type, GraphQLObjectType):
field_fragment = Fragment(
Expand Down