---
Name: 'graphql-schema-admin'
Only:
  classexists: 'SilverStripe\GraphQL\Schema\Schema'
---
SilverStripe\Core\Injector\Injector:
  SilverStripe\GraphQL\Controller.admin:
    class: SilverStripe\GraphQL\Controller
    constructor:
      schema: admin
  ## Add an event handler to transcribe the types for Apollo
  SilverStripe\EventDispatcher\Dispatch\Dispatcher:
    properties:
      handlers:
        graphqlTranscribe:
          on: [ graphqlSchemaBuild.admin ]
          handler: '%$SilverStripe\GraphQL\Schema\Services\SchemaTranscribeHandler'

SilverStripe\GraphQL\Schema\Schema:
  schemas:
    admin:
      config:
        modelConfig:
          DataObject:
            operations:
              read:
                plugins:
                  filter:
                    before: paginateList
                  sort:
                    before: paginateList
              readOne:
                plugins:
                  filter: true
                  sort: true
            nested_query_plugins:
              paginateList: true
              filter:
                before: paginateList
              sort:
                before: paginateList
              canView:
                after: paginateList
