8.0.0 🎉
#857
Replies: 1 comment 1 reply
-
Note: I did my best to provide a healthy release, but the amount of (also breaking) changes isn't easy to swallow at first! I did test drive the 8 cycle from day 0 also in production to find edge cases not covered in tests, but despite the necessary BC changes this has looked good so far. But again, it's possible something has slipped thus please ask any question here or report bugs via issues https://github.com/rebing/graphql-laravel/issues Thanks 🙏🏼 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
After quite some RC cycles, the next major release finally arrived!
Note: this new release contains a LOT of BREAKING CHANGES, please make sure to review the change changelog and test before you deploy!
High level changes:
Please find all the details below:
Breaking changes
Rewrite and simplify how schemas are handled
\Rebing\GraphQL\GraphQL::$schemas
now only holdsSchema
s and not amixture of strings or arrays
\Rebing\GraphQL\GraphQL::schema()
now only accepts a "schema name", but noad hoc
Schema
or "schema configs". To use ad hoc schemas, use\Rebing\GraphQL\GraphQL::buildSchemaFromConfig()
and\Rebing\GraphQL\GraphQL::addSchema()
\Rebing\GraphQL\GraphQL::queryAndReturnResult()
(and thus also\Rebing\GraphQL\GraphQL::query()
) does not accept ad hoc schemas via$opts['schema']
anymore; it now only can reference a schema via its name.\Rebing\GraphQL\GraphQL::addSchema()
now only acceptSchema
objects,where before it would support ad hoc schemas via array configuration.
Use
\Rebing\GraphQL\GraphQL::buildSchemaFromConfig()
for that now.\Rebing\GraphQL\GraphQL::getSchemaConfiguration()
has been removed due tothe simplifications.
\Rebing\GraphQL\GraphQL::getNormalizedSchemaConfiguration()
does notsupport ad hoc schemas anymore and only accepts the schema name.
\Rebing\GraphQL\GraphQLServiceProvider::bootSchemas()
has been removed dueto the simplifications.
The following methods now take a
\Illuminate\Contracts\Config\Repository
assecond argument:
\Rebing\GraphQL\GraphQL::__construct
\Rebing\GraphQL\GraphQLServiceProvider::applySecurityRules
As part of moving the architecture to an execution based middleware approach,
the following methods have been removed:
\Rebing\GraphQL\GraphQLController::handleAutomaticPersistQueries
has beenreplaced by the
AutomaticPersistedQueriesMiddleware
middleware\Rebing\GraphQL\GraphQLController::queryContext
has beenreplaced by the
AddAuthUserContextValueMiddleware
middlewareIf you relied on overriding
queryContext
to inject a custom context, younow need to create your own execution middleware and add to your
configuration
\Rebing\GraphQL\GraphQLController::executeQuery
has become obsolete, nodirect replacement.
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.middleware
=>graphql.route.middleware
graphql.route_group_attributes
=>graphql.route.group_attributes
graphiql group prefix (default schema)
'method'
argument must provide the HTTP methodverbs in uppercase like
POST
orGET
,post
orget
will not work.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
The parsing of GraphQL requests is now more strict:
GET
request, the GraphQL query has to be in the query parametersPOST
request, the GraphQL query needs to be in the bodyMixing of either isn't possible anymore
POST
requestsThis is due to
RequestParser
using\GraphQL\Server\Helper::parseRequestParams
which includes this checkFurther:
params_key
)GraphQLUploadMiddleware
has been removed (RequestParser
includes this functionality)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 anymore.Also, the default value for
$variables
has been changed tonull
to betterfit the how
OperationParams
works:old:
public function query(string $query, ?array $params = [], array $opts = []): array
new:
public function query(string $query, ?array $variables = null, array $opts = []): array
old:
public function queryAndReturnResult(string $query, ?array $params = [], array $opts = []): ExecutionResult
new:
public function queryAndReturnResult(string $query, ?array $variables = null, array $opts = []): ExecutionResult
\Rebing\GraphQL\Support\ResolveInfoFieldsAndArguments
has been removed$getSelectFields
closure no longer takes a depth parameterThe
$args
argument, of thehandle
method of the execution middlewares requiresarray
as type.Added
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.
ValidationException
is now formatted the same way as aValidationError
#748 / mfnChanged
config()
function and preferable use the repository or the Facade otherwise #774 / mfn$args
argument, of thehandle
method of the execution middlewares requiresarray
as type #843 / sforwardFixed
TypeNotFound
when an interface defined after another type where it is used #828 / kasian-sergeevRemoved
\Rebing\GraphQL\GraphQLServiceProvider::provides
was 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 🎉.
Beta Was this translation helpful? Give feedback.
All reactions