Skip to content

Commit

Permalink
NEW GraphQL 4 Compatability (#72)
Browse files Browse the repository at this point in the history
* Initial compat for graphql4
* Fix graphql config
  • Loading branch information
Aaron Carlino authored Oct 22, 2020
1 parent fd800a3 commit 0302087
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 41 deletions.
59 changes: 59 additions & 0 deletions _config/graphql-legacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
Name: frameworktestgraphql-legacy
After: '#graphqlconfig'
Except:
classexists: 'SilverStripe\GraphQL\Schema\Schema'
---

SilverStripe\Core\Injector\Injector:
SilverStripe\GraphQL\Manager.frameworktest:
class: SilverStripe\GraphQL\Manager
constructor:
identifier: frameworktest
SilverStripe\GraphQL\Controller.frameworktest:
class: SilverStripe\GraphQL\Controller
constructor:
manager: '%$SilverStripe\GraphQL\Manager.frameworktest'

SilverStripe\Control\Director:
rules:
'frameworktest/graphql':
Controller: '%$SilverStripe\GraphQL\Controller.frameworktest'

SilverStripe\GraphQL\Manager:
schemas:
frameworktest:
typeNames:
SilverStripe\FrameworkTest\Model\Company: Company
SilverStripe\FrameworkTest\Model\Employee: Employee
scaffolding:
types:
SilverStripe\FrameworkTest\Model\Company:
fields:
- ID
- Name
- Category
- Revenue
- CEO
operations:
read: true
update: true
create: true
delete: true
readOne: true
nestedQueries:
Employees: true
PastEmployees: true
SilverStripe\FrameworkTest\Model\Employee:
fields:
- ID
- Name
- Biography
- DateOfBirth
- Category
operations:
read: true
update: true
create: true
delete: true
readOne: true
81 changes: 40 additions & 41 deletions _config/graphql.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,58 @@
---
Name: frameworktestgraphql
After: '#graphqlconfig'
Only:
classexists: 'SilverStripe\GraphQL\Schema\Schema'
---

SilverStripe\Core\Injector\Injector:
SilverStripe\GraphQL\Manager.frameworktest:
class: SilverStripe\GraphQL\Manager
SilverStripe\GraphQL\Schema\Schema.frameworktest:
class: SilverStripe\GraphQL\Schema\Schema
constructor:
identifier: frameworktest
schemaKey: frameworktest
SilverStripe\GraphQL\Controller.frameworktest:
class: SilverStripe\GraphQL\Controller
constructor:
manager: '%$SilverStripe\GraphQL\Manager.frameworktest'


schema: frameworktest

SilverStripe\Control\Director:
rules:
'frameworktest/graphql':
Controller: '%$SilverStripe\GraphQL\Controller.frameworktest'

SilverStripe\GraphQL\Manager:
SilverStripe\GraphQL\Schema\Schema:
schemas:
frameworktest:
typeNames:
SilverStripe\FrameworkTest\Model\Company: Company
SilverStripe\FrameworkTest\Model\Employee: Employee
scaffolding:
types:
SilverStripe\FrameworkTest\Model\Company:
fields:
- ID
- Name
- Category
- Revenue
- CEO
operations:
read: true
update: true
create: true
delete: true
readOne: true
nestedQueries:
Employees: true
PastEmployees: true
SilverStripe\FrameworkTest\Model\Employee:
fields:
- ID
- Name
- Biography
- DateOfBirth
- Category
operations:
read: true
update: true
create: true
delete: true
readOne: true
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

0 comments on commit 0302087

Please sign in to comment.