diff --git a/docs/execution/middleware.rst b/docs/execution/middleware.rst index 203cd881..55efe730 100644 --- a/docs/execution/middleware.rst +++ b/docs/execution/middleware.rst @@ -57,7 +57,7 @@ logs the time it takes to resolve each field return_value = next(root, info, **args) duration = timer() - start logger.debug("{parent_type}.{field_name}: {duration} ms".format( - parent_type=root._meta.name if root else '', + parent_type=root._meta.name if root and hasattr(root, '_meta') else '', field_name=info.field_name, duration=round(duration * 1000, 2) ))