Skip to content

Releases: Ecodev/graphql-doctrine

10.0.1

16 Jul 04:29
10.0.1
58d3509
Compare
Choose a tag to compare

Changes

  • Can use type ID in API\Input

10.0.0

17 Jun 11:15
10.0.0
087f559
Compare
Choose a tag to compare

BREAKING CHANGE

  • New TypesInterface::loadType()

9.0.0

02 Nov 06:07
9.0.0
5acf016
Compare
Choose a tag to compare

BREAKING CHANGE

8.1.2

28 Sep 09:39
8.1.2
9b0cfdb
Compare
Choose a tag to compare

Changes

  • Not found entity will throw a UserError, not an Error

8.1.1

15 Sep 02:53
8.1.1
85206bc
Compare
Choose a tag to compare

Changes

  • Minimal version is PHP 8.2

8.1.0

10 May 15:19
8.1.0
21415a6
Compare
Choose a tag to compare

Added

  • Add new emptyStringAsHighest to sorting

8.0.1

26 Apr 03:51
8.0.1
4c370af
Compare
Choose a tag to compare

Changes

  • Slighlty improve attribute documentation and typing

8.0.0

25 Apr 09:25
8.0.0
9642833
Compare
Choose a tag to compare

BREAKING CHANGE

All previously existing annotations are now PHP native Attribute. This is a major breaking change and all annotations must be migrated to the new attributes.

Notable changes:

  • API\Argument is now declared on the parameter itself
  • API\Filter is used directly, possibly multiple times, without wrapping in API\Filters
  • API\Filters is not necessary anymore and was dropped
  • API\Sorting requires a single class name, but can be used multiple times

Partially automated migration

The following is a configuration file for Rector that will migrate both Doctrine annotations and also GraphQL Doctrine annotations to attributes.

The migration for GraphQL Doctrine is imperfect, so Sorting and Argument will have to be adjusted manually afterward.

<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Class_\AnnotationToAttributeRector;
use Rector\Php80\Rector\Property\NestedAnnotationToAttributeRector;
use Rector\Php80\ValueObject\AnnotationPropertyToAttributeClass;
use Rector\Php80\ValueObject\AnnotationToAttribute;
use Rector\Php80\ValueObject\NestedAnnotationToAttribute;

return static function (RectorConfig $rectorConfig): void {
    $rectorConfig->parallel();

    $rectorConfig->sets([
        \Rector\Doctrine\Set\DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
    ]);

    $rectorConfig->ruleWithConfiguration(NestedAnnotationToAttributeRector::class, [
        new NestedAnnotationToAttribute('GraphQL\\Doctrine\\Annotation\\Filters', [new AnnotationPropertyToAttributeClass('GraphQL\\Doctrine\\Attribute\\Filter')], \true),
        new NestedAnnotationToAttribute('GraphQL\\Doctrine\\Annotation\\Sorting', [new AnnotationPropertyToAttributeClass('GraphQL\\Doctrine\\Attribute\\Sorting', 'classes', \true)]),
        new NestedAnnotationToAttribute('API\Filters', [new AnnotationPropertyToAttributeClass('GraphQL\\Doctrine\\Attribute\\Filter')], \true),
        new NestedAnnotationToAttribute('API\Sorting', [new AnnotationPropertyToAttributeClass('GraphQL\\Doctrine\\Attribute\\Sorting', 'classes', \true)]),
    ]);

    $rectorConfig->ruleWithConfiguration(AnnotationToAttributeRector::class, [
        new AnnotationToAttribute('GraphQL\\Doctrine\\Annotation\\Argument', 'GraphQL\\Doctrine\\Attribute\\Argument'),
        new AnnotationToAttribute('GraphQL\\Doctrine\\Annotation\\Exclude', 'GraphQL\\Doctrine\\Attribute\\Exclude'),
        new AnnotationToAttribute('GraphQL\\Doctrine\\Annotation\\Field', 'GraphQL\\Doctrine\\Attribute\\Field'),
        new AnnotationToAttribute('GraphQL\\Doctrine\\Annotation\\FilterGroupCondition', 'GraphQL\\Doctrine\\Attribute\\FilterGroupCondition'),
        new AnnotationToAttribute('GraphQL\\Doctrine\\Annotation\\Filter', 'GraphQL\\Doctrine\\Attribute\\Filter'),
        new AnnotationToAttribute('GraphQL\\Doctrine\\Annotation\\Input', 'GraphQL\\Doctrine\\Attribute\\Input'),
        new AnnotationToAttribute('API\Argument', 'GraphQL\\Doctrine\\Attribute\\Argument'),
        new AnnotationToAttribute('API\Exclude', 'GraphQL\\Doctrine\\Attribute\\Exclude'),
        new AnnotationToAttribute('API\Field', 'GraphQL\\Doctrine\\Attribute\\Field'),
        new AnnotationToAttribute('API\FilterGroupCondition', 'GraphQL\\Doctrine\\Attribute\\FilterGroupCondition'),
        new AnnotationToAttribute('API\Filter', 'GraphQL\\Doctrine\\Attribute\\Filter'),
        new AnnotationToAttribute('API\Input', 'GraphQL\\Doctrine\\Attribute\\Input'),
    ]);
};

Special thanks

Special thanks to @themasch for starting this work.

7.3.0

11 Nov 14:10
7.3.0
631ad00
Compare
Choose a tag to compare

Added

  • Support Collection<MyType> syntax for PhpDoc

7.2.4

10 Nov 18:12
7.2.4
10f5e31
Compare
Choose a tag to compare

Changes

  • Update PHP deps