From 70786345cdc0355e1fafe6767ad3d8fe2307a618 Mon Sep 17 00:00:00 2001 From: Radoslav Terezka Date: Mon, 28 Oct 2019 15:29:48 +0100 Subject: [PATCH] Allow to get field name from field context. --- src/GraphQL/Execution/FieldContext.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/GraphQL/Execution/FieldContext.php b/src/GraphQL/Execution/FieldContext.php index e2d762da1..16b8f8ab6 100644 --- a/src/GraphQL/Execution/FieldContext.php +++ b/src/GraphQL/Execution/FieldContext.php @@ -31,6 +31,13 @@ public function __construct(ResolveContext $context, ResolveInfo $info) { $this->info = $info; } + /** + * @return string + */ + public function getFieldName() { + return $this->info->fieldName; + } + /** * @return string */