Skip to content

Commit 6e3f010

Browse files
committed
use namespace for instance key
1 parent 8919ca2 commit 6e3f010

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/LaravelServiceProvider.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function boot()
2323
$this->loadViewsFrom(realpath(__DIR__.'/Support/Console/Commands/stubs'), 'lighthouse');
2424

2525
if (config('lighthouse.controller')) {
26-
require_once __DIR__.'/Support/Http/routes.php';
26+
require __DIR__.'/Support/Http/routes.php';
2727
}
2828

2929
$this->registerNodes();
@@ -78,7 +78,7 @@ protected function registerSchema()
7878
if (is_callable($schema)) {
7979
$schema();
8080
} elseif (is_string($schema)) {
81-
require_once $schema;
81+
require $schema;
8282
}
8383
}
8484

src/Schema/Registrars/ConnectionRegistrar.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Nuwave\Lighthouse\Schema\Registrars;
44

5+
use ReflectionClass;
56
use GraphQL\Type\Definition\ObjectType;
67
use GraphQL\Type\Definition\InterfaceType;
78
use Nuwave\Lighthouse\Support\Definition\RelayConnectionType;
@@ -111,7 +112,7 @@ public function getInstance($name, ObjectType $nodeType)
111112
protected function instanceName($name)
112113
{
113114
if ($name instanceof Connection) {
114-
return strtolower(get_class($name));
115+
return (new ReflectionClass($name))->getName();
115116
}
116117

117118
return $name;

0 commit comments

Comments
 (0)