Skip to content

Commit ebbc3dc

Browse files
authored
Merge pull request #7 from moufmouf/better_method_names
Changing method names to avoid confusion
2 parents aca3b6a + f3a939a commit ebbc3dc

6 files changed

+9
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ $posts = $db->table('posts')->graphqlType();
3939

4040
// You can pass a new 'v1' or 'v4' parameter to uuid().
4141
// This will generate a @UUID TDBM annotation that will help TDBM autogenerate the UUID
42-
$posts = $db->table('posts')->string('title')->graphql() // The column is a GraphQL field
42+
$posts = $db->table('posts')->string('title')->graphqlField() // The column is a GraphQL field
4343
->fieldName('the_title') // Let's set the name of the field to a different value
4444
->logged() // The user must be logged to view the field
4545
->right('CAN_EDIT') // The user must have the 'CAN_EDIT' right to view the field
4646
->failWith(null) // If the user is not logged or has no right, let's serve 'null'
4747
->endGraphql();
4848

49-
$db->junctionTable('posts', 'users')->graphql(); // Expose the many-to-many relationship as a GraphQL field.
49+
$db->junctionTable('posts', 'users')->graphqlField(); // Expose the many-to-many relationship as a GraphQL field.
5050
```

src/TdbmFluidColumnOptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function column(string $name): TdbmFluidColumn
102102
return $this->tdbmFluidTable->column($name);
103103
}
104104

105-
public function graphql(): TdbmFluidColumnGraphqlOptions
105+
public function graphqlField(): TdbmFluidColumnGraphqlOptions
106106
{
107107
$this->tdbmFluidTable->graphqlType();
108108
return new TdbmFluidColumnGraphqlOptions($this, $this->fluidColumn);

src/TdbmFluidJunctionTableOptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __construct(TdbmFluidTable $tdbmFluidTable)
2020
$this->tdbmFluidTable = $tdbmFluidTable;
2121
}
2222

23-
public function graphql(): TdbmFluidJunctionTableGraphqlOptions
23+
public function graphqlField(): TdbmFluidJunctionTableGraphqlOptions
2424
{
2525
$this->tdbmFluidTable->addAnnotation('TheCodingMachine\\GraphQLite\\Annotations\\Field');
2626
return new TdbmFluidJunctionTableGraphqlOptions($this, $this->tdbmFluidTable);

tests/TdbmFluidColumnGraphqlOptionsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function testGraphql()
1818
$column = $posts->column('foo');
1919
$columnOptions = $column->integer();
2020

21-
$graphqlOptions = $columnOptions->graphql();
21+
$graphqlOptions = $columnOptions->graphqlField();
2222

2323
$graphqlOptions->fieldName('bar')
2424
->logged(true)
@@ -45,11 +45,11 @@ public function testGraphql()
4545

4646
$this->assertContains('@TheCodingMachine\GraphQLite\Annotations\Type', $schema->getTable('posts')->getOptions()['comment']);
4747

48-
$idColumn = $posts->id()->graphql();
48+
$idColumn = $posts->id()->graphqlField();
4949
$this->assertContains('outputType = "ID"', $schema->getTable('posts')->getColumn('id')->getComment());
5050

5151
$users = $fluid->table('users');
52-
$uuidColumn = $users->uuid()->graphql();
52+
$uuidColumn = $users->uuid()->graphqlField();
5353
$this->assertContains('outputType = "ID"', $schema->getTable('users')->getColumn('uuid')->getComment());
5454

5555
}

tests/TdbmFluidJunctionTableGraphqlOptionsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function testGraphql()
1717
$fluid->table('users')->uuid();
1818

1919
$junctionTableOptions = $fluid->junctionTable('posts', 'users');
20-
$graphqlOptions = $junctionTableOptions->graphql();
20+
$graphqlOptions = $junctionTableOptions->graphqlField();
2121

2222
$graphqlOptions->logged(true)
2323
->right('CAN_EDIT')

tests/TdbmFluidJunctionTableOptionsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function testGraphql()
1616
$fluid->table('posts')->uuid();
1717
$fluid->table('users')->uuid();
1818

19-
$fluid->junctionTable('posts', 'users')->graphql();
19+
$fluid->junctionTable('posts', 'users')->graphqlField();
2020

2121
$this->assertSame("\n@TheCodingMachine\\GraphQLite\\Annotations\\Field", $schema->getTable('posts_users')->getOptions()['comment']);
2222
}

0 commit comments

Comments
 (0)