Skip to content

Commit 6b97439

Browse files
authored
Fix fatal error when GraphiQL tries to run introspection query
1 parent dab3e52 commit 6b97439

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Type/Introspection.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,25 +282,25 @@ public static function _directive()
282282
'deprecationReason' => 'Use `locations`.',
283283
'type' => Type::nonNull(Type::boolean()),
284284
'resolve' => function($d) {
285-
return in_array(Directive::$directiveLocations['QUERY'], $d['locations']) ||
286-
in_array(Directive::$directiveLocations['MUTATION'], $d['locations']) ||
287-
in_array(Directive::$directiveLocations['SUBSCRIPTION'], $d['locations']);
285+
return in_array(Directive::$directiveLocations['QUERY'], $d->locations) ||
286+
in_array(Directive::$directiveLocations['MUTATION'], $d->locations) ||
287+
in_array(Directive::$directiveLocations['SUBSCRIPTION'], $d->locations);
288288
}
289289
],
290290
'onFragment' => [
291291
'deprecationReason' => 'Use `locations`.',
292292
'type' => Type::nonNull(Type::boolean()),
293293
'resolve' => function($d) {
294-
return in_array(Directive::$directiveLocations['FRAGMENT_SPREAD'], $d['locations']) ||
295-
in_array(Directive::$directiveLocations['INLINE_FRAGMENT'], $d['locations']) ||
296-
in_array(Directive::$directiveLocations['FRAGMENT_DEFINITION'], $d['locations']);
294+
return in_array(Directive::$directiveLocations['FRAGMENT_SPREAD'], $d->locations) ||
295+
in_array(Directive::$directiveLocations['INLINE_FRAGMENT'], $d->locations) ||
296+
in_array(Directive::$directiveLocations['FRAGMENT_DEFINITION'], $d->locations);
297297
}
298298
],
299299
'onField' => [
300300
'deprecationReason' => 'Use `locations`.',
301301
'type' => Type::nonNull(Type::boolean()),
302302
'resolve' => function($d) {
303-
return in_array(Directive::$directiveLocations['FIELD'], $d['locations']);
303+
return in_array(Directive::$directiveLocations['FIELD'], $d->locations);
304304
}
305305
]
306306
]

0 commit comments

Comments
 (0)