Replies: 1 comment
-
|
Running it in production already, I was already running RC1 so the only thing I really had to adjust was:
No issues so far |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Due to some longer standing cleanups, embracing of a more standardized approach how to process the GraphQL request using https://github.com/laragraph/utils, and adding a execution middleware, breaking changes were made for this next major version.
Note: the "breaking changes" between 8.0.0-rc1 and rc2 changed, again; please see the full and current changelog below
To be clear (see below for details): you will need to adapt your configuration file
Breaking changes
As part of moving the architecture to an execution based middleware approach,
the following methods have been removed:
\Rebing\GraphQL\GraphQLController::handleAutomaticPersistQuerieshas beenreplaced by the
AutomaticPersistedQueriesMiddlewaremiddleware\Rebing\GraphQL\GraphQLController::queryContexthas beenreplaced by the
AddAuthUserContextValueMiddlewaremiddlewareIf you relied on overriding
queryContextto inject a custom context, younow need to create your own execution middleware and add to your
configuration
\Rebing\GraphQL\GraphQLController::executeQueryhas become obsolete, nodirect replacement.
Routing has been rewritten and simplified #757 / mfn
routeconfiguration key
graphql.routesIt's therefore also not possible anymore to register different routes for
queries and mutations within a schema. Each schema gets only one route
(except for the default schema, which is registered for the global prefix
route as well as under its name).
If necessary, this can be emulated with different schemas and multi-level
paths
graphql.prefix=>graphql.route.prefixgraphql.controllers=>graphql.route.controllerFurther, providing a controller action for
queryormutationis notsupported anymore.
graphql.middlware=>graphql.route.middlewaregraphql.route_group_attributes=>graphql.route.group_attributesgraphiql group prefix (default schema)
method(aka HTTP method)is not supported anymore
level
routean empty array or null\Rebing\GraphQL\GraphQL::routeNameTransformerhas been removed-in their nameRemove the
\Rebing\GraphQL\GraphQLController::$appproperty #755 / mfnInjecting the application container early is incompatible when running within
an application server like laravel/octane, as it's not guaranteed that the
container received contains all the bindings. If you relied on this property
when extending the classes, invoke the container directly via
Container::getInstance().Remove deprecated
\Rebing\GraphQL\Support\Type::$inputObjectand\Rebing\GraphQL\Support\Type::$enumObjectproperties #752 / mfnInstead in your code, extend
\Rebing\GraphQL\Support\InputTypeand\Rebing\GraphQL\Support\EnumTypedirectlySupport for Lumen has been removed
Integrate laragraph/utils RequestParser #739 / mfn
The parsing of GraphQL requests is now more strict:
GETrequest, the GraphQL query has to be in the query parametersPOSTrequest, the GraphQL query needs to be in the bodyMixing of either isn't possible anymore
POSTrequestsThis is due to
RequestParserusing\GraphQL\Server\Helper::parseRequestParamswhich includes this checkFurther:
params_key)GraphQLUploadMiddlewarehas been removed (RequestParserincludes this functionality)In
\Rebing\GraphQL\GraphQL, renamed remaining instances of$paramsto$variablesAfter switching to
RequestParser, the support for changing the variable namewhat was supposed to
params_keyhas gone and thus the name isn't fitting anymore.Also, the default value for
$variableshas been changed tonullto betterfit the how
OperationParamsworks:public function query(string $query, ?array $params = [], array $opts = []): arraynew:
public function query(string $query, ?array $variables = null, array $opts = []): arraypublic function queryAndReturnResult(string $query, ?array $params = [], array $opts = []): ExecutionResultnew:
public function queryAndReturnResult(string $query, ?array $variables = null, array $opts = []): ExecutionResultAdded
This allows greater flexibility for enabling/disabling certain functionality
as well as bringing in new features without having to open up the library.
'graphql'as alias #768 / mfnThis avoids having to re-parse the same queries over and over again.
ValidationExceptionis now formatted the same way as aValidationError#748 / mfnChanged
Removed
\Rebing\GraphQL\GraphQLServiceProvider::provideswas removed #769 / mfnIt's only relevant for deferred providers which ours however isn't (and can't
be made into with the current Laravel architecture).
This discussion was created from the release 8.0.0-rc2 / More Breaking Changes incoming!.
Beta Was this translation helpful? Give feedback.
All reactions