Skip to content

Commit

Permalink
Fix fatal error when GraphiQL tries to run introspection query
Browse files Browse the repository at this point in the history
  • Loading branch information
geshido authored Sep 15, 2016
1 parent dab3e52 commit 6b97439
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Type/Introspection.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,25 +282,25 @@ public static function _directive()
'deprecationReason' => 'Use `locations`.',
'type' => Type::nonNull(Type::boolean()),
'resolve' => function($d) {
return in_array(Directive::$directiveLocations['QUERY'], $d['locations']) ||
in_array(Directive::$directiveLocations['MUTATION'], $d['locations']) ||
in_array(Directive::$directiveLocations['SUBSCRIPTION'], $d['locations']);
return in_array(Directive::$directiveLocations['QUERY'], $d->locations) ||
in_array(Directive::$directiveLocations['MUTATION'], $d->locations) ||
in_array(Directive::$directiveLocations['SUBSCRIPTION'], $d->locations);
}
],
'onFragment' => [
'deprecationReason' => 'Use `locations`.',
'type' => Type::nonNull(Type::boolean()),
'resolve' => function($d) {
return in_array(Directive::$directiveLocations['FRAGMENT_SPREAD'], $d['locations']) ||
in_array(Directive::$directiveLocations['INLINE_FRAGMENT'], $d['locations']) ||
in_array(Directive::$directiveLocations['FRAGMENT_DEFINITION'], $d['locations']);
return in_array(Directive::$directiveLocations['FRAGMENT_SPREAD'], $d->locations) ||
in_array(Directive::$directiveLocations['INLINE_FRAGMENT'], $d->locations) ||
in_array(Directive::$directiveLocations['FRAGMENT_DEFINITION'], $d->locations);
}
],
'onField' => [
'deprecationReason' => 'Use `locations`.',
'type' => Type::nonNull(Type::boolean()),
'resolve' => function($d) {
return in_array(Directive::$directiveLocations['FIELD'], $d['locations']);
return in_array(Directive::$directiveLocations['FIELD'], $d->locations);
}
]
]
Expand Down

0 comments on commit 6b97439

Please sign in to comment.