@@ -57,7 +57,7 @@ public function __construct(string $elementType, Service $graphQlService)
5757 */
5858 public function resolveTag ($ value = null , $ args = [], $ context = [], ResolveInfo $ resolveInfo = null )
5959 {
60- $ element = ElementService::getElementById ($ this ->elementType , $ value ['id ' ]);
60+ $ element = $ value [ElementInterface::class] ?? ElementService::getElementById ($ this ->elementType , $ value ['id ' ]);
6161
6262 if ($ element ) {
6363 $ result = $ this ->getTags ('document ' , $ element ->getId ());
@@ -82,7 +82,7 @@ public function resolveTag($value = null, $args = [], $context = [], ResolveInfo
8282 public function resolveProperties ($ value = null , array $ args = [], array $ context = [], ResolveInfo $ resolveInfo = null )
8383 {
8484 $ elementId = $ value ['id ' ];
85- $ element = ElementService::getElementById ($ this ->elementType , $ elementId );
85+ $ element = $ value [ElementInterface::class] ?? ElementService::getElementById ($ this ->elementType , $ elementId );
8686
8787 if (!$ element ) {
8888 throw new ClientSafeException ('element ' . $ this ->elementType . ' ' . $ elementId . ' not found ' );
@@ -116,7 +116,7 @@ public function resolveProperties($value = null, array $args = [], array $contex
116116 */
117117 public function resolveParent ($ value = null , $ args = [], $ context = [], ResolveInfo $ resolveInfo = null )
118118 {
119- $ element = ElementService::getElementById ($ this ->elementType , $ value ['id ' ]);
119+ $ element = $ value [ElementInterface::class] ?? ElementService::getElementById ($ this ->elementType , $ value ['id ' ]);
120120 if ($ element ) {
121121 $ parent = $ element ->getParent ();
122122 if ($ parent ) {
@@ -139,7 +139,8 @@ public function resolveParent($value = null, $args = [], $context = [], ResolveI
139139 */
140140 public function resolveChildren ($ value = null , $ args = [], $ context = [], ResolveInfo $ resolveInfo = null )
141141 {
142- $ element = ElementService::getElementById ($ this ->elementType , $ value ['id ' ]);
142+ $ element = $ value [ElementInterface::class] ?? ElementService::getElementById ($ this ->elementType , $ value ['id ' ]);
143+
143144 if ($ element ) {
144145 $ arguments = $ this ->composeArguments ($ args );
145146
@@ -161,7 +162,7 @@ public function resolveChildren($value = null, $args = [], $context = [], Resolv
161162 */
162163 public function resolveSiblings ($ value = null , $ args = [], $ context = [], ResolveInfo $ resolveInfo = null )
163164 {
164- $ element = ElementService::getElementById ($ this ->elementType , $ value ['id ' ]);
165+ $ element = $ value [ElementInterface::class] ?? ElementService::getElementById ($ this ->elementType , $ value ['id ' ]);
165166 if ($ element ) {
166167 $ arguments = $ this ->composeArguments ($ args );
167168
0 commit comments