- Determine the current version (
composer info ...
) - Choose the wanted version
- Follow the instructions
- ??????
- PROFIT
For example, if the current version is 2.x
and you want to migrate to 5.x
, you need to perform all steps in the following order:
- "Upgrade from v2"
- "Upgrade from v3"
- "Upgrade from v4"
Please also see changelog to find all changes.
🤝 | Backward-compatible change. Please note that despite you can ignore it now, but it will be mandatory in the future. |
---|
Tip
Maybe a good idea to add test (at least) with GraphQLAssertions::assertGraphQLSchemaEquals()
assertion before the upgrade 🤗
- Laravel v10 is not supported anymore. Migrate to the newer version.
-
PHP 8.1 is not supported anymore. Migrate to the newer version.
-
Direct usages of
Container::getInstances()
were replaced by explicit constructor parameters. You may need to update your code accordingly (#151).
-
Package config now uses objects instead of an array, it is recommended to migrate to the new format. 🤝
-
The
JsonStringType
is not implementTypeDefinition
anymore. To add the scalar into the Schema, you can use@type
/@scalar
directive, or create a custom implementation ofTypeDefinition
contract to use withBuilder
/Manipulator
.
-
Following traits required
app()
method to get access to the Container (#151)protected function app(): Application { return $this->app; }
-
GraphQLAssertions
methods updated to allownull
for$message
argument.
This section is actual only if you are extending the package. Please review and update (listed the most significant changes only):
-
TypeDefinition::getTypeDefinition()
return type changed. -
💀\LastDragon_ru\LaraASP\GraphQL\Builder\Traits\WithManipulator
removed, create instance by hand instead (reason #151). -
Use
PackageProvider
instead of💀Provider
.
- Laravel v9 is not supported anymore. Migrate to the newer version.
- Input type auto-generation reworked and may include more/fewer fields. Please check the documentation and update the schema if needed.
-
enum SearchByTypeFlag { yes }
=>enum SearchByTypeFlag { Yes }
. 🤝 -
@searchByOperators
=>@searchByExtendOperators
. 🤝 -
@searchByOperatorRelation
=>@searchByOperatorRelationship
(and class too; generated types will be named asSearchByRelationship*
instead ofSearchByComplex*
). 🤝 -
💀\LastDragon_ru\LaraASP\GraphQL\SearchBy\Operators::Condition
=>\LastDragon_ru\LaraASP\GraphQL\SearchBy\Operators::Object
. -
Scalars to add operators were renamed
-
SearchByCondition
=>SearchByOperatorsObject
-
SearchByNull
=>SearchByOperatorsNull
-
SearchByExtra
=>SearchByOperatorsExtra
-
SearchByNumber
=>SearchByOperatorsNumber
-
SearchByEnum
=>SearchByOperatorsEnum
-
-
Added the root type that will contain only extra operators and newly added
field
operator. The new query syntax is:query { # WHERE name = "LastDragon" users(where: { field: { name: {equal: "LastDragon"} } }) { id } }
If you want to use old query syntax, you need:
-
Add following bindings into application provider:
$this->app->bind( LastDragon_ru\LaraASP\GraphQL\SearchBy\Types\Condition\Root::class, LastDragon_ru\LaraASP\GraphQL\SearchBy\Types\Condition\V5::class, ); $this->app->bind( LastDragon_ru\LaraASP\GraphQL\SearchBy\Types\Condition\Condition::class, LastDragon_ru\LaraASP\GraphQL\SearchBy\Types\Condition\V5::class, );
-
Disable
SearchByOperatorFieldDirective
operator to avoid possible conflict with field names (via schema or config)extend scalar SearchByOperatorsDisabled @searchByOperatorField
-
-
If you define additional operators via
scalar SearchBy*
useextend scalar SearchBy*
instead (or you will getTypeDefinitionAlreadyDefined
error).
-
enum SortByTypeFlag { yes }
=>enum SortByTypeFlag { Yes }
. 🤝 -
enum SortByTypeDirection { asc, desc }
=>enum SortByTypeDirection { Asc, Desc }
. 🤝 -
If you are testing generated queries, you need to update
sort_by_*
alias tolara_asp_graphql__sort_by__*
. -
If you are overriding Extra operators, you should to add
SortByOperators::Extra
to use new built-in:extend scalar SortByOperatorsExtra @sortByExtendOperators @sortByOperatorRandom
$settings = [ 'sort_by' => [ 'operators' => [ SortByOperators::Extra => [ SortByOperators::Extra, SortByOperatorRandomDirective::class, ], ], ], ];
-
If you are using
💀FieldResolver
, useBuilderFieldResolver
instead. 🤝 -
Added the root type that will contain only extra operators and newly added
field
operator. The new query syntax is:query { # ORDER BY user.name ASC, text DESC comments(order: [ {field: {user: {name: asc}}} {field: {text: desc}} ]) }
If you want to use old query syntax, you need:
-
Add following bindings into application provider:
$this->app->bind( LastDragon_ru\LaraASP\GraphQL\SortBy\Types\Clause\Root::class, LastDragon_ru\LaraASP\GraphQL\SortBy\Types\Clause\V5::class, ); $this->app->bind( LastDragon_ru\LaraASP\GraphQL\SortBy\Types\Clause\Clause::class, LastDragon_ru\LaraASP\GraphQL\SortBy\Types\Clause\V5::class, );
-
Disable
SortByOperatorFieldDirective
operator to avoid possible conflict with field names (via schema or config)extend scalar SortByOperatorsDisabled @sortByOperatorField
-
-
@sortByOperatorRandom
cannot be added toFIELD_DEFINITION
anymore. -
If you define addition operators via
scalar SortBy*
useextend scalar SortBy*
instead (or you will getTypeDefinitionAlreadyDefined
error). -
Scalars to add operators were renamed
-
SortByExtra
=>SortByOperatorsExtra
-
This section is actual only if you are extending the package. Please review and update (listed the most significant changes only):
-
\LastDragon_ru\LaraASP\GraphQL\Builder\Contracts\Operator
must explicitly implement concreteScope
(used to filter available directive-operators, previously was required implicitly). -
💀\LastDragon_ru\LaraASP\GraphQL\Builder\Exceptions\Client\ConditionTooManyProperties
=>ConditionTooManyFields
-
💀\LastDragon_ru\LaraASP\GraphQL\Builder\Exceptions\TypeUnknown
removed -
-
BuilderInfo
removed. To getBuilderInfo
instance within Operator theContext
should be used instead$context->get(LastDragon_ru\LaraASP\GraphQL\Builder\Context\HandlerContextBuilderInfo::class)?->value
-
getPlaceholderTypeDefinitionNode()
removed =>AstManipulator::getOriginType()
-
getTypeOperators()
/getOperator()
removed. To get operators theContext
should be used instead$context->get(LastDragon_ru\LaraASP\GraphQL\Builder\Context\HandlerContextOperators::class)?->value
-
-
💀\LastDragon_ru\LaraASP\GraphQL\Builder\Directives\PropertyDirective
removed -
LastDragon_ru\LaraASP\GraphQL\Builder\Sources\*
-
💀\LastDragon_ru\LaraASP\GraphQL\Builder\Traits\PropertyOperator
=>HandlerOperator
-
LastDragon_ru\LaraASP\GraphQL\SortBy\Builders\*
=>LastDragon_ru\LaraASP\GraphQL\SortBy\Sorters\*
-
💀\LastDragon_ru\LaraASP\GraphQL\SearchBy\Operators\BaseOperator
=>\LastDragon_ru\LaraASP\GraphQL\SortBy\Operators\Operator
-
💀\LastDragon_ru\LaraASP\GraphQL\SortBy\Operators\BaseOperator
=>\LastDragon_ru\LaraASP\GraphQL\SortBy\Operators\Operator
-
💀\LastDragon_ru\LaraASP\GraphQL\SearchBy\Operators\Traits\ScoutSupport
=>WithScoutSupport
-
@searchByOperatorCondition
=>@searchByOperatorChild
(and class too) -
@searchByOperatorProperty
=>@searchByOperatorCondition
(and class too) -
@sortByOperatorProperty
=>@sortByOperatorChild
(and class too) -
@sortByOperatorField
=>@sortByOperatorSort
(and class too) -
💀\LastDragon_ru\LaraASP\GraphQL\Stream\Contracts\StreamFactory::enhance()
removed