From 6b97439877750fb0a53854302d8eabf4bf735572 Mon Sep 17 00:00:00 2001
From: Yury <geshido@gmail.com>
Date: Thu, 15 Sep 2016 15:47:56 +0700
Subject: [PATCH] Fix fatal error when GraphiQL tries to run introspection
 query

---
 src/Type/Introspection.php | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/Type/Introspection.php b/src/Type/Introspection.php
index 7fec3bb..93a71c4 100644
--- a/src/Type/Introspection.php
+++ b/src/Type/Introspection.php
@@ -282,25 +282,25 @@ EOD;
                         '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);
                         }
                     ]
                 ]