diff --git a/src/GraphQL.php b/src/GraphQL.php index f8c7ede2e2..4f82bb663a 100644 --- a/src/GraphQL.php +++ b/src/GraphQL.php @@ -119,7 +119,7 @@ public function type($name, $fresh = false) public function connection($name, $parent = null, $fresh = false) { $connection = $this->schema()->connectionInstance($name, $parent, $fresh); - $connectionName = $name instanceof Connection ? $name->name() : $name; + $connectionName = $name instanceof Connection ? $name->type() : $name; if (! $this->connections()->has($connectionName)) { $this->schema()->connection($connectionName, $connection); diff --git a/src/Schema/Registrars/ConnectionRegistrar.php b/src/Schema/Registrars/ConnectionRegistrar.php index 9dd159905d..4b443f1f4d 100644 --- a/src/Schema/Registrars/ConnectionRegistrar.php +++ b/src/Schema/Registrars/ConnectionRegistrar.php @@ -110,7 +110,7 @@ public function getInstance($name, ObjectType $nodeType) protected function getName($name) { if ($name instanceof Connection) { - return $name->name(); + return $name->type(); } return $name; diff --git a/src/Support/Interfaces/Connection.php b/src/Support/Interfaces/Connection.php index 9f2cf8c5c5..e3461b00ff 100644 --- a/src/Support/Interfaces/Connection.php +++ b/src/Support/Interfaces/Connection.php @@ -11,7 +11,7 @@ interface Connection * * @return string */ - public function name(); + public function type(); /** * Get available arguments for connection. diff --git a/tests/Support/GraphQL/Connections/TaskConnection.php b/tests/Support/GraphQL/Connections/TaskConnection.php index a5af4a37b0..3a674eb741 100644 --- a/tests/Support/GraphQL/Connections/TaskConnection.php +++ b/tests/Support/GraphQL/Connections/TaskConnection.php @@ -13,7 +13,7 @@ class TaskConnection implements Connection * * @return string */ - public function name() + public function type() { return 'task'; }