Replies: 2 comments
-
heads up: thanks to @crissi we're likely to add a "execution middleware" which will bring even more (also breaking) changes but OTOH might obsolete some of these documented here, see #762 |
Beta Was this translation helpful? Give feedback.
0 replies
-
RC2 has been release, see the new discussion at #770 |
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 and embracing of a more standardized approach how to process the GraphQL request using https://github.com/laragraph/utils , a few breaking changes were made for this next major version.
To be clear (see below for details): you will need to adapt your configuration file
Breaking changes
Routing has been rewritten and simplified #757 / mfn
route
configuration key
graphql.routes
It'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.prefix
graphql.controllers
=>graphql.route.controller
Further, providing a controller action for
query
ormutation
is notsupported anymore.
graphql.middlware
=>graphql.route.middleware
graphql.route_group_attributes
=>graphql.route.group_attributes
graphiql group prefix (default schema)
level
route
an empty array or null\Rebing\GraphQL\GraphQL::routeNameTransformer
has been removed-
in their nameRemove the
\Rebing\GraphQL\GraphQLController::$app
property #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::$inputObject
and\Rebing\GraphQL\Support\Type::$enumObject
properties #752 / mfnInstead in your code, extend
\Rebing\GraphQL\Support\InputType
and\Rebing\GraphQL\Support\EnumType
directlySupport for Lumen has been removed
Integrate laragraph/utils RequestParser #739 / mfn
POST
requestsThis is due to
RequestParser
using\GraphQL\Server\Helper::parseRequestParams
which includes this checkparams_key
)GraphQLUploadMiddleware
has been removed (RequestParser
includes this functionality)\Rebing\GraphQL\GraphQLController
:protected function executeQuery(string $schema, array $input): array
new:
protected function executeQuery(string $schema, OperationParams $params): array
protected function queryContext(string $query, ?array $params, string $schema)
new:
protected function queryContext(string $query, ?array $variables, string $schema)
protected function handleAutomaticPersistQueries(string $schemaName, array $input): string
new:
protected function handleAutomaticPersistQueries(string $schemaName, OperationParams $operation): string
In
\Rebing\GraphQL\GraphQLController
, renamed all occurrences of$schema
to$schemaName
This is to reduce the confusion as the code in some other places uses
$schema
for the actual schema itself (either as an object or array form).
This changes the signature on the following methods:
protected function executeQuery(string $schema, OperationParams $params): array
new:
protected function executeQuery(string $schemaName, OperationParams $params): array
protected function queryContext(string $query, ?array $variables, string $schema)
new:
protected function queryContext(string $query, ?array $variables, string $schemaName)
In
\Rebing\GraphQL\GraphQL
, renamed remaining instances of$params
to$variables
After switching to
RequestParser
, the support for changing the variable namewhat was supposed to
params_key
has gone and thus the name isn't fitting anymorepublic function query(string $query, ?array $params = [], array $opts = []): array
new:
public function query(string $query, ?array $variables = [], array $opts = []): array
public function queryAndReturnResult(string $query, ?array $params = [], array $opts = []): ExecutionResult
new:
public function queryAndReturnResult(string $query, ?array $variables = [], array $opts = []): ExecutionResult
As part of APQ parsed query support #740 / mfn:
\Rebing\GraphQL\GraphQLController
, the following signature changed:protected function handleAutomaticPersistQueries(string $schemaName, OperationParams $operation): string
new:
protected function handleAutomaticPersistQueries(string $schemaName, OperationParams $operation): array
\Rebing\GraphQL\GraphQL
, the following signature changed:public function query(string $query, ?array $variables = [], array $opts = []): array
new:
public function query($query, ?array $variables = [], array $opts = []): array
public function queryAndReturnResult(string $query, ?array $variables = [], array $opts = []): ExecutionResult
new:
public function queryAndReturnResult($query, ?array $variables = [], array $opts = []): ExecutionResult
Added
This avoids having to re-parse the same queries over and over again.
ValidationException
is now formatted the same way as aValidationError
#748 / mfnChanged
This discussion was created from the release 8.0.0-rc1 / Breaking Changes incoming!.
Beta Was this translation helpful? Give feedback.
All reactions