Skip to content

Commit 5152e94

Browse files
authored
fix: DeferredValue support for Mutations (#67)
1 parent f506eb0 commit 5152e94

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

frappe_graphql/utils/execution/execution_context.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,20 @@ async def get_results() -> Dict[str, Any]:
149149

150150
return get_results()
151151

152+
def execute_fields_serially(self, *args, **kwargs):
153+
result = super().execute_fields_serially(*args, **kwargs)
154+
contains_deferred = False
155+
156+
for v in result.values():
157+
if isinstance(v, DeferredValue):
158+
contains_deferred = True
159+
break
160+
161+
if contains_deferred:
162+
return deferred_dict(result)
163+
164+
return result
165+
152166
def complete_value(
153167
self,
154168
return_type: GraphQLOutputType,

0 commit comments

Comments
 (0)