@@ -50,7 +50,9 @@ public function addFields(callable $fields): void
5050 public function getField ($ name ): FieldDefinition
5151 {
5252 if ($ this ->status === MutableInterface::STATUS_PENDING ) {
53- throw new RuntimeException ('You must freeze() a MutableObjectType before fetching its fields. ' );
53+ throw new RuntimeException (
54+ 'You must freeze() the MutableObjectType, ' . $ this ->className . ', before fetching its fields. ' ,
55+ );
5456 }
5557
5658 return parent ::getField ($ name );
@@ -64,7 +66,9 @@ public function getField($name): FieldDefinition
6466 public function hasField ($ name ): bool
6567 {
6668 if ($ this ->status === MutableInterface::STATUS_PENDING ) {
67- throw new RuntimeException ('You must freeze() a MutableObjectType before fetching its fields. ' );
69+ throw new RuntimeException (
70+ 'You must freeze() the MutableObjectType, ' . $ this ->className . ', before fetching its fields. ' ,
71+ );
6872 }
6973
7074 return parent ::hasField ($ name );
@@ -79,7 +83,9 @@ public function getFields(): array
7983 {
8084 if ($ this ->finalFields === null ) {
8185 if ($ this ->status === MutableInterface::STATUS_PENDING ) {
82- throw new RuntimeException ('You must freeze() a MutableObjectType before fetching its fields. ' );
86+ throw new RuntimeException (
87+ 'You must freeze() the MutableObjectType, ' . $ this ->className . ', before fetching its fields. ' ,
88+ );
8389 }
8490
8591 $ this ->finalFields = parent ::getFields ();
0 commit comments