Skip to content

Commit e9f8b8d

Browse files
committed
Fix codestyle and revert unrelated changes
1 parent 023ab07 commit e9f8b8d

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

src/Support/SelectFields.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,7 @@ protected static function handleFields(array $requestedFields, GraphqlType $pare
164164
if (isset($parentType->config['model'])) {
165165
// Get the next parent type, so that 'with' queries could be made
166166
// Both keys for the relation are required (e.g 'id' <-> 'user_id')
167-
168167
$relationsKey = Arr::get($fieldObject->config, 'alias', $key);
169-
170168
$relation = call_user_func([app($parentType->config['model']), $relationsKey]);
171169

172170
// Add the foreign key here, if it's a 'belongsTo'/'belongsToMany' relation

tests/Database/SelectFields/NestedRelationLoadingTests/NestedRelationLoadingTest.php

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ public function testQueryNoSelectFields(): void
5656

5757
$result = GraphQL::query($graphql);
5858

59-
$this->assertSqlQueries(
60-
<<<'SQL'
59+
$this->assertSqlQueries(<<<'SQL'
6160
select * from "users" order by "users"."id" asc;
6261
select * from "posts" where "posts"."user_id" = ? and "posts"."user_id" is not null order by "posts"."id" asc;
6362
select * from "comments" where "comments"."post_id" = ? and "comments"."post_id" is not null order by "comments"."id" asc;
@@ -198,8 +197,7 @@ public function testQuerySelect(): void
198197

199198
$result = GraphQL::query($graphql);
200199

201-
$this->assertSqlQueries(
202-
<<<'SQL'
200+
$this->assertSqlQueries(<<<'SQL'
203201
select "users"."id", "users"."name" from "users" order by "users"."id" asc;
204202
select * from "posts" where "posts"."user_id" = ? and "posts"."user_id" is not null order by "posts"."id" asc;
205203
select * from "comments" where "comments"."post_id" = ? and "comments"."post_id" is not null order by "comments"."id" asc;
@@ -340,8 +338,7 @@ public function testQueryWith(): void
340338

341339
$result = GraphQL::query($graphql);
342340

343-
$this->assertSqlQueries(
344-
<<<'SQL'
341+
$this->assertSqlQueries(<<<'SQL'
345342
select * from "users" order by "users"."id" asc;
346343
select "posts"."body", "posts"."id", "posts"."title", "posts"."user_id" from "posts" where "posts"."user_id" in (?, ?) order by "posts"."id" asc;
347344
select "comments"."body", "comments"."id", "comments"."title", "comments"."post_id" from "comments" where "comments"."post_id" in (?, ?, ?, ?) order by "comments"."id" asc;
@@ -478,8 +475,7 @@ public function testQuerySelectAndWith(): void
478475

479476
$result = GraphQL::query($graphql);
480477

481-
$this->assertSqlQueries(
482-
<<<'SQL'
478+
$this->assertSqlQueries(<<<'SQL'
483479
select "users"."id", "users"."name" from "users" order by "users"."id" asc;
484480
select "posts"."body", "posts"."id", "posts"."title", "posts"."user_id" from "posts" where "posts"."user_id" in (?, ?) order by "posts"."id" asc;
485481
select "comments"."body", "comments"."id", "comments"."title", "comments"."post_id" from "comments" where "comments"."post_id" in (?, ?, ?, ?) order by "comments"."id" asc;
@@ -629,8 +625,7 @@ public function testQuerySelectAndWithAndSubArgs(): void
629625

630626
$result = GraphQL::query($graphql);
631627

632-
$this->assertSqlQueries(
633-
<<<'SQL'
628+
$this->assertSqlQueries(<<<'SQL'
634629
select "users"."id", "users"."name" from "users" order by "users"."id" asc;
635630
select "posts"."body", "posts"."id", "posts"."title", "posts"."user_id" from "posts" where "posts"."user_id" in (?, ?) and "posts"."flag" = ? order by "posts"."id" asc;
636631
select "comments"."body", "comments"."id", "comments"."title", "comments"."post_id" from "comments" where "comments"."post_id" in (?, ?) order by "comments"."id" asc;
@@ -756,8 +751,7 @@ public function testQuerySelectAndWithAndNestedSubArgs(): void
756751

757752
$result = GraphQL::query($graphql);
758753

759-
$this->assertSqlQueries(
760-
<<<'SQL'
754+
$this->assertSqlQueries(<<<'SQL'
761755
select "users"."id", "users"."name" from "users" order by "users"."id" asc;
762756
select "posts"."body", "posts"."id", "posts"."title", "posts"."user_id" from "posts" where "posts"."user_id" in (?, ?) and "posts"."flag" = ? order by "posts"."id" asc;
763757
select "comments"."body", "comments"."id", "comments"."title", "comments"."post_id" from "comments" where "comments"."post_id" in (?, ?) and "comments"."flag" = ? order by "comments"."id" asc;
@@ -840,8 +834,7 @@ public function testRelationshipAlias(): void
840834

841835
$result = GraphQL::query($graphql);
842836

843-
$this->assertSqlQueries(
844-
<<<'SQL'
837+
$this->assertSqlQueries(<<<'SQL'
845838
select "users"."id", "users"."name" from "users" order by "users"."id" asc;
846839
select "posts"."body", "posts"."id", "posts"."title", "posts"."user_id" from "posts" where "posts"."user_id" in (?) and "posts"."flag" = ? order by "posts"."id" asc;
847840
SQL

0 commit comments

Comments
 (0)