Skip to content

Commit f432344

Browse files
committed
chore : adjust linter
1 parent 0142c40 commit f432344

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

src/Dtos/GraphQLQueryBuilder.php

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,37 @@
3030
trait GraphQLQueryBuilder
3131
{
3232
private array $selectedFields = [];
33+
34+
/**
35+
* Get available query fields
36+
*
37+
* @return array Array of available field names
38+
*/
3339
abstract protected function getQueryFields(): array;
40+
41+
/**
42+
* Get the GraphQL query name
43+
*
44+
* @return string The query name
45+
*/
3446
abstract protected function getQueryName(): string;
47+
48+
/**
49+
* Get the GraphQL operation name
50+
*
51+
* @return string The operation name
52+
*/
3553
abstract protected function getOperationName(): string;
3654

55+
/**
56+
* Select specific fields for the GraphQL query
57+
*
58+
* @param string ...$fields The field names to select
59+
*
60+
* @return self Returns the current instance for method chaining
61+
*
62+
* @throws ParameterException When invalid fields are provided
63+
*/
3764
public function select(string ...$fields): self
3865
{
3966
$queryFields = $this->getQueryFields();
@@ -50,6 +77,11 @@ public function select(string ...$fields): self
5077
return $this;
5178
}
5279

80+
/**
81+
* Convert the query to a GraphQL query string
82+
*
83+
* @return string The formatted GraphQL query string
84+
*/
5385
public function toGraphQLQueryString(): string
5486
{
5587
$fields = empty($this->selectedFields)
@@ -67,8 +99,13 @@ public function toGraphQLQueryString(): string
6799
);
68100
}
69101

102+
/**
103+
* Get selected properties as GraphQL fields
104+
*
105+
* @return array Array of field names
106+
*/
70107
private function getSelectedPropertiesAsFields(): array
71108
{
72109
return $this->getQueryFields();
73110
}
74-
}
111+
}

0 commit comments

Comments
 (0)