Merge pull request #653 from dkleissa/master

Update middleware example to support introspection
This commit is contained in:
Syrus Akbary 2018-01-24 19:25:53 -08:00 committed by GitHub
commit e94716d94a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
))