Skip to content

Commit

Permalink
Fix git branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Carlino committed Nov 2, 2020
1 parent c3beac2 commit 61b8e99
Show file tree
Hide file tree
Showing 20 changed files with 11 additions and 33 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ before_script:

# Install composer
- composer validate
- composer require silverstripe/recipe-cms:$RECIPE_VERSION --no-update
- composer require silverstripe/recipe-cms:$RECIPE_VERSION --no-update --prefer-dist
# Fix for running phpunit 5 on php 7.4+
- composer require --no-update sminnee/phpunit-mock-objects:^3
- if [[ $DB == PGSQL ]]; then composer require silverstripe/postgresql:^2 --no-update; fi
- composer update --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile $COMPOSER_ARG

# Remove once everything is merged
- cd vendor/silverstripe/graphql
- git checkout -t origin/master
- cd vendor/silverstripe
- rm -rf graphql
- git clone https://github.com/silverstripe/silverstripe-graphql graphql
- cd graphql
- git checkout master
- if [[ $BACKWARD_COMPAT ]]; then git remote add -f uc https://github.com/unclecheese/silverstripe-graphql && git checkout pulls/3/schemageddon-compat; fi
- cd ../admin
- git remote add -f uc https://github.com/unclecheese/silverstripe-admin
- git checkout pulls/1/schemageddon
- cd ../../../
- 'if [[ ! $BACKWARD_COMPAT ]]; then composer require webonyx/graphql-php:"14.0 as 0.12.6"; fi'
########################################################
Expand Down
6 changes: 2 additions & 4 deletions src/GraphQL/Operations/AbstractPublishOperationCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ abstract class AbstractPublishOperationCreator implements OperationCreator
public function createOperation(
SchemaModelInterface $model,
string $typeName,
array $config = [])
: ?ModelOperation
{
array $config = []
): ?ModelOperation {
if (!Extensible::has_extension($model->getSourceClass(), Versioned::class)) {
return null;
}
Expand All @@ -68,7 +67,6 @@ public function createOperation(
->addResolverContext('action', $this->getAction())
->addResolverContext('dataClass', $model->getSourceClass())
->addArg('id', 'ID!');

}

abstract protected function createOperationName(string $typeName): string;
Expand Down
1 change: 0 additions & 1 deletion src/GraphQL/Operations/CopyToStageCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use SilverStripe\Versioned\GraphQL\Resolvers\VersionedResolver;
use SilverStripe\Versioned\Versioned;


if (!interface_exists(OperationCreator::class)) {
return;
}
Expand Down
1 change: 0 additions & 1 deletion src/GraphQL/Operations/PublishCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ protected function getAction(): string
{
return AbstractPublishOperationCreator::ACTION_PUBLISH;
}

}
1 change: 0 additions & 1 deletion src/GraphQL/Operations/UnpublishCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ protected function getAction(): string
{
return AbstractPublishOperationCreator::ACTION_UNPUBLISH;
}

}
2 changes: 0 additions & 2 deletions src/GraphQL/Plugins/UnpublishOnDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace SilverStripe\Versioned\GraphQL\Plugins;


use SilverStripe\Core\Extensible;
use SilverStripe\GraphQL\QueryHandler\QueryHandler;
use SilverStripe\GraphQL\Schema\Field\ModelMutation;
Expand Down Expand Up @@ -78,5 +77,4 @@ public static function unpublishOnDelete(array $context)
});
};
}

}
4 changes: 2 additions & 2 deletions src/GraphQL/Plugins/VersionedDataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function apply(ModelType $type, Schema $schema, array $config = []): void
->addPlugin(Paginator::IDENTIFIER, [
'connection' => $type->getName() . 'Versions',
]);
});
});
}

/**
Expand All @@ -109,7 +109,7 @@ public function apply(ModelType $type, Schema $schema, array $config = []): void
public static function sortVersions(array $config): Closure
{
$fieldName = $config['fieldName'];
return function (Sortable $list, array $args) use($fieldName) {
return function (Sortable $list, array $args) use ($fieldName) {
$versionSort = $args[$fieldName]['version'] ?? null;
if ($versionSort) {
$list = $list->sort('Version', $versionSort);
Expand Down
1 change: 0 additions & 1 deletion src/GraphQL/Plugins/VersionedRead.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace SilverStripe\Versioned\GraphQL\Plugins;


use SilverStripe\Core\Extensible;
use SilverStripe\GraphQL\Schema\Field\ModelQuery;
use SilverStripe\GraphQL\Schema\Interfaces\ModelQueryPlugin;
Expand Down
4 changes: 1 addition & 3 deletions src/GraphQL/Resolvers/VersionedResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace SilverStripe\Versioned\GraphQL\Resolvers;


use GraphQL\Type\Definition\ResolveInfo;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\GraphQL\QueryHandler\QueryHandler;
Expand Down Expand Up @@ -42,7 +41,7 @@ class VersionedResolver extends DefaultResolverProvider
public static function resolveVersionFields(DataObject $obj, array $args, array $context, ResolveInfo $info)
{
/* @var DataObject&Versioned $obj */
switch($info->fieldName) {
switch ($info->fieldName) {
case 'author':
return $obj->Author();
case 'publisher':
Expand Down Expand Up @@ -103,7 +102,6 @@ public static function resolveVersionedRead(DataList $list, array $args, array $

return Injector::inst()->get(VersionFilters::class)
->applyToList($list, $args['versioning']);

}

/**
Expand Down
1 change: 0 additions & 1 deletion src/GraphQL/_legacy/Operations/ReadVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function __construct($dataObjectClass, $versionTypeName)

// Allow clients to sort the versions list by Version ID
$this->addArg('sort', 'VersionSortType');

}

public function resolve($object, array $args, $context, ResolveInfo $info)
Expand Down
1 change: 0 additions & 1 deletion src/GraphQL/_legacy/Types/VersionSortType.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace SilverStripe\Versioned\GraphQL\Types;


use SilverStripe\Core\Injector\Injector;
use SilverStripe\GraphQL\Pagination\SortDirectionTypeCreator;
use SilverStripe\GraphQL\TypeCreator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ protected function setUp()
if (class_exists(Schema::class)) {
$this->markTestSkipped('Skipped GraphQL 3 test ' . __CLASS__);
}

}

public function testDataObjectScaffolderAddsVersionedFields()
Expand Down
1 change: 0 additions & 1 deletion tests/php/GraphQL/Legacy/Extensions/ReadExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ protected function setUp()
if (class_exists(Schema::class)) {
$this->markTestSkipped('Skipped GraphQL 3 test ' . __CLASS__);
}

}

public function testReadExtensionAppliesFilters()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ protected function setUp()
if (class_exists(Schema::class)) {
$this->markTestSkipped('Skipped GraphQL 3 test ' . __CLASS__);
}

}

public function testReadOneExtensionAppliesFilters()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ protected function setUp()
if (class_exists(Schema::class)) {
$this->markTestSkipped('Skipped GraphQL 3 test ' . __CLASS__);
}

}

public function testSchemaScaffolderEnsuresMemberType()
Expand Down
1 change: 0 additions & 1 deletion tests/php/GraphQL/Legacy/Operations/CopyToStageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ protected function setUp()
if (class_exists(Schema::class)) {
$this->markTestSkipped('Skipped GraphQL 3 test ' . __CLASS__);
}

}


Expand Down
1 change: 0 additions & 1 deletion tests/php/GraphQL/Legacy/Operations/PublishTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ protected function setUp()
if (class_exists(Schema::class)) {
$this->markTestSkipped('Skipped GraphQL 3 test ' . __CLASS__);
}

}

public function testPublish()
Expand Down
1 change: 0 additions & 1 deletion tests/php/GraphQL/Legacy/Operations/ReadVersionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ protected function setUp()
if (class_exists(Schema::class)) {
$this->markTestSkipped('Skipped GraphQL 3 test ' . __CLASS__);
}

}


Expand Down
2 changes: 0 additions & 2 deletions tests/php/GraphQL/Plugins/VersionedDataObjectPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,4 @@ public function testItReadsVersions()
$this->assertEquals(1, $result->first()->Version);
$this->assertEquals(3, $result->last()->Version);
}


}
1 change: 0 additions & 1 deletion tests/php/GraphQL/Plugins/VersionedReadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,4 @@ public function testReadOneExtensionAppliesFilters()
$this->assertCount(1, $query->getArgs());
$this->assertEquals('versioning', $query->getArgs()[0]);
}

}

0 comments on commit 61b8e99

Please sign in to comment.