Skip to content

Commit

Permalink
First pass at graphql 4 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Carlino committed Aug 5, 2020
1 parent 5aabb33 commit e0cb01b
Show file tree
Hide file tree
Showing 31 changed files with 886 additions and 1,014 deletions.
31 changes: 0 additions & 31 deletions _config/graphql.yml

This file was deleted.

9 changes: 9 additions & 0 deletions _config/graphql_operations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
Name: versioned-graphql-dataobject
---
SilverStripe\GraphQL\Schema\DataObject\DataObjectModel:
operations:
copyToStage: 'SilverStripe\Versioned\GraphQL\Operations\CopyToStageCreator'
publish: 'SilverStripe\Versioned\GraphQL\Operations\PublishCreator'
unpublish: 'SilverStripe\Versioned\GraphQL\Operations\UnpublishCreator'
rollback: 'SilverStripe\Versioned\GraphQL\Operations\RollbackCreator'
24 changes: 24 additions & 0 deletions _config/graphql_plugins.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
Name: versioned-graphql-plugins
Only:
moduleexists: 'silverstripe/graphql'
---
SilverStripe\Core\Injector\Injector:
SilverStripe\GraphQL\Schema\Registry\PluginRegistry:
constructor:
versionedDataobject: '%$SilverStripe\Versioned\GraphQL\Plugins\VersionedDataObject'
unpublishOnDelete: '%$SilverStripe\Versioned\GraphQL\Plugins\UnpublishOnDelete'
readVersionedDataObject: '%$SilverStripe\Versioned\GraphQL\Plugins\VersionedRead'

# Ensure all dataobject types get the versioned plugin
SilverStripe\GraphQL\Schema\DataObject\DataObjectModel:
default_plugins:
versionedDataObject: true

SilverStripe\GraphQL\Schema\DataObject\ReadCreator:
default_plugins:
readVersionedDataObject: true

SilverStripe\GraphQL\Schema\DataObject\DeleteCreator:
default_plugins:
unpublishOnDelete: true
81 changes: 81 additions & 0 deletions _config/graphql_schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
Name: versioned-graphql-schema
Only:
moduleexists: 'silverstripe/graphql'
---
SilverStripe\GraphQL\Schema\Schema:
schemas:
'*':
enums:
VersionedStage:
description: The stage to read from or write to
values:
DRAFT:
value: Stage
description: The draft stage
LIVE:
value: Live
description: The live stage
VersionedQueryMode:
description: The versioned mode to use
values:
ARCHIVE:
value: archive
description: Read from a specific date of the archive
LATEST:
value: latest_versions
description: Read the latest version
DRAFT:
value: Stage
description: Read from the draft stage
LIVE:
value: Live
description: Read from the live stage
STATUS:
value: status
description: Read only records with a specific status
VERSION:
value: version
description: Read a specific version
VersionedStatus:
description: The stage to read from or write to
values:
PUBLISHED:
value: published
description: Only published records
DRAFT:
value: draft
description: Only draft records
ARCHIVED:
value: archived
description: Only records that have been archived
MODIFIED:
value: modified
description: Only records that have unpublished changes
types:
CopyToStageInputType:
input: true
fields:
id:
type: ID!
description: The ID of the record to copy
fromVersion:
type: Int
description: The source version number to copy
fromStage:
type: VersionedStage
description: The source stage to copy
toStage:
type: VersionedStage
description: The destination state to copy to
VersionedInputType:
input: true
fields:
mode: VersionedQueryMode = Stage
archiveDate:
type: String
description: The date to use for archive
status:
type: '[VersionedStatus]'
description: If mode is STATUS, specify which versioned statuses
version: Int
97 changes: 0 additions & 97 deletions src/GraphQL/Extensions/DataObjectScaffolderExtension.php

This file was deleted.

44 changes: 0 additions & 44 deletions src/GraphQL/Extensions/DeleteExtension.php

This file was deleted.

31 changes: 0 additions & 31 deletions src/GraphQL/Extensions/ManagerExtension.php

This file was deleted.

40 changes: 0 additions & 40 deletions src/GraphQL/Extensions/ReadExtension.php

This file was deleted.

Loading

0 comments on commit e0cb01b

Please sign in to comment.