Skip to content

Commit

Permalink
Renamed types to prefix type name instead of suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHAnderson committed Mar 27, 2024
1 parent 702461c commit 155c75c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function connection(string $id): ObjectType
$objectType = $this->type($id);

return $this->get(Type\TypeManager::class)
->build(Type\Connection::class, $objectType->name . '_Connection', $objectType);
->build(Type\Connection::class, 'Connection_' . $objectType->name, $objectType);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Filter/FilterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public function get(
array|null $associationMetadata = null,
): GraphQLInputObjectType {
$typeName = $owningEntity ?
$owningEntity->getTypeName() . '_' . $associationName . '_filter'
: $targetEntity->getTypeName() . '_filter';
'Filter_' . $owningEntity->getTypeName() . '_' . $associationName
: 'Filter_' . $targetEntity->getTypeName();

if ($this->typeManager->has($typeName)) {
return $this->typeManager->get($typeName);
Expand Down
2 changes: 1 addition & 1 deletion src/Type/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(AbstractContainer $container, string $typeName, arra
'description' => 'Connection for ' . $typeName,
'fields' => [
'edges' => Type::listOf($container
->build(Node::class, $typeName . '_Node', $objectType)),
->build(Node::class, 'Node_' . $typeName, $objectType)),
'totalCount' => Type::nonNull(Type::int()),
'pageInfo' => $container->get('PageInfo'),
],
Expand Down
2 changes: 1 addition & 1 deletion src/Type/Entity/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ protected function addAssociations(array &$fields): void
return [
'type' => $this->typeManager->build(
Connection::class,
$shortName . '_Connection',
'Connection_' . $shortName,
$entity->getObjectType(),
),
'args' => [
Expand Down

0 comments on commit 155c75c

Please sign in to comment.