Skip to content

Commit

Permalink
Merge pull request #87 from creative-commoners/pulls/4/graphql4-fix-a…
Browse files Browse the repository at this point in the history
…nd-tablenames

FIX GraphQL4 config, add table names to pages
  • Loading branch information
chillu authored Feb 25, 2021
2 parents 5dd2c79 + 3c83a61 commit 4412afe
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 33 deletions.
67 changes: 34 additions & 33 deletions _config/graphql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,37 @@ SilverStripe\Control\Director:
SilverStripe\GraphQL\Schema\Schema:
schemas:
frameworktest:
modelConfig:
type_mapping:
SilverStripe\FrameworkTest\Model\Company: Company
SilverStripe\FrameworkTest\Model\Employee: Employee
models:
SilverStripe\FrameworkTest\Model\Company:
fields:
ID: true
Name: true
Category: true
Revenue: true
CEO: true
Employees: true
PastEmployees: true
operations:
read: true
update: true
create: true
delete: true
readOne: true
SilverStripe\FrameworkTest\Model\Employee:
fields:
ID: true
Name: true
Biography: true
DateOfBirth: true
Category: true
operations:
read: true
update: true
create: true
delete: true
readOne: true
config:
modelConfig:
type_mapping:
SilverStripe\FrameworkTest\Model\Company: Company
SilverStripe\FrameworkTest\Model\Employee: Employee
models:
SilverStripe\FrameworkTest\Model\Company:
fields:
ID: true
Name: true
Category: true
Revenue: true
CEO: true
Employees: true
PastEmployees: true
operations:
read: true
update: true
create: true
delete: true
readOne: true
SilverStripe\FrameworkTest\Model\Employee:
fields:
ID: true
Name: true
Biography: true
DateOfBirth: true
Category: true
operations:
read: true
update: true
create: true
delete: true
readOne: true
2 changes: 2 additions & 0 deletions code/multitab-validation/MultiTabPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
class MultiTabPage extends Page
{
private static $table_name = 'MultiTabPage';

private static $db = [
'SecondTabFirstField' => 'Varchar(50)',
'ThirdTabFirstField' => 'Varchar(50)',
Expand Down
2 changes: 2 additions & 0 deletions code/multitab-validation/SingleTabPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*/
class SingleTabPage extends Page
{
private static $table_name = 'SingleTabPage';

public function getCMSValidator()
{
return new RequiredFields([
Expand Down

0 comments on commit 4412afe

Please sign in to comment.