diff --git a/src/Folklore/GraphQL/LumenServiceProvider.php b/src/Folklore/GraphQL/LumenServiceProvider.php index c0cad515..505f736b 100644 --- a/src/Folklore/GraphQL/LumenServiceProvider.php +++ b/src/Folklore/GraphQL/LumenServiceProvider.php @@ -9,7 +9,7 @@ class LumenServiceProvider extends ServiceProvider */ protected function getRouter() { - return $this->app; + return property_exists($this->app, 'router') ? $this->app->router : $this->app; } /** diff --git a/src/Folklore/GraphQL/Relay/Relay.php b/src/Folklore/GraphQL/Relay/Relay.php index d720334e..3d1fa31f 100644 --- a/src/Folklore/GraphQL/Relay/Relay.php +++ b/src/Folklore/GraphQL/Relay/Relay.php @@ -24,7 +24,7 @@ public function connectionField($config = []) public function connectionFieldFromEdgeType($edgeType, $config = []) { - $typeName = array_get($edgeType->config, 'name'); + $typeName = $edgeType->name ? $edgeType->name : get_class($edgeType); $connectionName = array_get($config, 'connectionTypeName', str_plural($typeName).'Connection'); $connectionType = new ConnectionType([