Skip to content

Commit e25a92d

Browse files
committed
Added context into ResolveInfo
1 parent cb9ea88 commit e25a92d

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

graphql/execution/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,10 @@ def get_field_entry_key(node):
272272

273273
class ResolveInfo(object):
274274
__slots__ = ('field_name', 'field_asts', 'return_type', 'parent_type',
275-
'schema', 'fragments', 'root_value', 'operation', 'variable_values')
275+
'schema', 'fragments', 'root_value', 'operation', 'variable_values', 'context')
276276

277277
def __init__(self, field_name, field_asts, return_type, parent_type,
278-
schema, fragments, root_value, operation, variable_values):
278+
schema, fragments, root_value, operation, variable_values, context):
279279
self.field_name = field_name
280280
self.field_asts = field_asts
281281
self.return_type = return_type
@@ -285,6 +285,7 @@ def __init__(self, field_name, field_asts, return_type, parent_type,
285285
self.root_value = root_value
286286
self.operation = operation
287287
self.variable_values = variable_values
288+
self.context = context
288289

289290

290291
def default_resolve_fn(source, args, context, info):

graphql/execution/executor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ def resolve_field(exe_context, parent_type, source, field_asts):
182182
root_value=exe_context.root_value,
183183
operation=exe_context.operation,
184184
variable_values=exe_context.variable_values,
185+
context=context
185186
)
186187

187188
executor = exe_context.executor

graphql/execution/experimental/fragment.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def get_resolvers(context, type, field_asts):
5757
root_value=context and context.root_value,
5858
operation=context and context.operation,
5959
variable_values=context and context.variable_values,
60+
context=context
6061
)
6162
if isinstance(field_base_type, GraphQLObjectType):
6263
field_fragment = Fragment(

0 commit comments

Comments
 (0)