From 6e3f010e78152c28177553adf17e7e2d8eb7a5ea Mon Sep 17 00:00:00 2001 From: Christopher Moore Date: Sat, 27 Aug 2016 11:21:06 -0700 Subject: [PATCH] use namespace for instance key --- src/LaravelServiceProvider.php | 4 ++-- src/Schema/Registrars/ConnectionRegistrar.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/LaravelServiceProvider.php b/src/LaravelServiceProvider.php index 5ec6c1da1d..db71554777 100644 --- a/src/LaravelServiceProvider.php +++ b/src/LaravelServiceProvider.php @@ -23,7 +23,7 @@ public function boot() $this->loadViewsFrom(realpath(__DIR__.'/Support/Console/Commands/stubs'), 'lighthouse'); if (config('lighthouse.controller')) { - require_once __DIR__.'/Support/Http/routes.php'; + require __DIR__.'/Support/Http/routes.php'; } $this->registerNodes(); @@ -78,7 +78,7 @@ protected function registerSchema() if (is_callable($schema)) { $schema(); } elseif (is_string($schema)) { - require_once $schema; + require $schema; } } diff --git a/src/Schema/Registrars/ConnectionRegistrar.php b/src/Schema/Registrars/ConnectionRegistrar.php index 6513954d26..138944d59d 100644 --- a/src/Schema/Registrars/ConnectionRegistrar.php +++ b/src/Schema/Registrars/ConnectionRegistrar.php @@ -2,6 +2,7 @@ namespace Nuwave\Lighthouse\Schema\Registrars; +use ReflectionClass; use GraphQL\Type\Definition\ObjectType; use GraphQL\Type\Definition\InterfaceType; use Nuwave\Lighthouse\Support\Definition\RelayConnectionType; @@ -111,7 +112,7 @@ public function getInstance($name, ObjectType $nodeType) protected function instanceName($name) { if ($name instanceof Connection) { - return strtolower(get_class($name)); + return (new ReflectionClass($name))->getName(); } return $name;