Last active
April 19, 2025 09:37
-
-
Save maxime-rainville/de1c1ef5d716551f0eb93b135c4c7105 to your computer and use it in GitHub Desktop.
Very simple Sliverstripe GraphQL schema set up (assumes you have installed silverstripe/frameworktest)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/_graphql/models/company.yml | |
SilverStripe\FrameworkTest\Model\Company: | |
fields: '*' | |
operations: | |
'*': true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/_config/graphql.yml | |
--- | |
Name: app-graphql | |
After: '#graphql' | |
--- | |
SilverStripe\GraphQL\Schema\Schema: | |
schemas: | |
default: | |
src: | |
- app/_graphql | |
SilverStripe\Core\Injector\Injector: | |
SilverStripe\GraphQL\Schema\Schema.default: | |
class: SilverStripe\GraphQL\Schema\Schema | |
constructor: | |
schemaKey: default | |
SilverStripe\GraphQL\Controller.default: | |
class: SilverStripe\GraphQL\Controller | |
constructor: | |
schema: default | |
handler: '%$SilverStripe\GraphQL\QueryHandler\QueryHandlerInterface.default' | |
SilverStripe\GraphQL\QueryHandler\QueryHandlerInterface.default: | |
class: SilverStripe\GraphQL\QueryHandler\QueryHandler | |
properties: | |
Middlewares: | |
httpMethod: '%$SilverStripe\GraphQL\Middleware\HTTPMethodMiddleware' | |
SilverStripe\Control\Director: | |
rules: | |
'graphql': | |
Controller: '%$SilverStripe\GraphQL\Controller.default' | |
# Add a description to the Company | |
SilverStripe\FrameworkTest\Model\Company: | |
class_description: Companies are big businesses. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment