Skip to content

Commit

Permalink
rename connection name to type
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissm79 committed Aug 27, 2016
1 parent d15d8a5 commit 8803849
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/GraphQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/Registrars/ConnectionRegistrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Support/Interfaces/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface Connection
*
* @return string
*/
public function name();
public function type();

/**
* Get available arguments for connection.
Expand Down
2 changes: 1 addition & 1 deletion tests/Support/GraphQL/Connections/TaskConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class TaskConnection implements Connection
*
* @return string
*/
public function name()
public function type()
{
return 'task';
}
Expand Down

0 comments on commit 8803849

Please sign in to comment.