You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make it easier to extend select fields #799 / crissi
Fix TypeNotFound when an interface defined after another type where it is used #828 / kasian-sergeev
Full ChangeLog since 7.2.0
Breaking changes
Rewrite and simplify how schemas are handled
\Rebing\GraphQL\GraphQL::$schemas now only holds Schemas and not a
mixture of strings or arrays
\Rebing\GraphQL\GraphQL::schema() now only accepts a "schema name", but no
ad 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 accept Schema 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 to
the simplifications.
\Rebing\GraphQL\GraphQL::getNormalizedSchemaConfiguration() does not
support ad hoc schemas anymore and only accepts the schema name.
\Rebing\GraphQL\GraphQLServiceProvider::bootSchemas() has been removed due
to the simplifications.
The following methods now take a \Illuminate\Contracts\Config\Repository as
second argument:
As part of moving the architecture to an execution based middleware approach,
the following methods have been removed:
\Rebing\GraphQL\GraphQLController::handleAutomaticPersistQueries has been
replaced by the AutomaticPersistedQueriesMiddleware middleware
\Rebing\GraphQL\GraphQLController::queryContext has been
replaced by the AddAuthUserContextValueMiddleware middleware
If you relied on overriding queryContext to inject a custom context, you
now need to create your own execution middleware and add to your
configuration
\Rebing\GraphQL\GraphQLController::executeQuery has become obsolete, no
direct replacement.
Routing has been rewritten and simplified #757 / mfn
All routing related configuration is now within the top level route
configuration key
The following configuration options have been removed:
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
The following configuration options have been moved/renamed:
graphql.prefix => graphql.route.prefix
graphql.controllers => graphql.route.controller
Further, providing a controller action for query or mutation is not
supported anymore.
1 route for each schema + 1 route for the group prefix (default schema)
If GraphiQL is enabled: 1 route graphiql route for each schema + 1 for the
graphiql group prefix (default schema)
If provided, the 'method' argument must provide the HTTP method
verbs in uppercase like POST or GET, post or get will not work.
It's now possible to prevent the registering of any routes by making the top
level route an empty array or null
\Rebing\GraphQL\GraphQL::routeNameTransformer has been removed
It's now possible to register schemas with a - in their name
Routes are now properly cacheable
Remove the \Rebing\GraphQL\GraphQLController::$app property #755 / mfn
Injecting 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 / mfn
Instead in your code, extend \Rebing\GraphQL\Support\InputType and \Rebing\GraphQL\Support\EnumType directly
Support for Lumen has been removed
Integrate laragraph/utils RequestParser #739 / mfn
The parsing of GraphQL requests is now more strict:
if you send a GET request, the GraphQL query has to be in the query parameters
if you send a POST request, the GraphQL query needs to be in the body
Mixing of either isn't possible anymore
batched queries will only work with POST requests
This is due to RequestParser using \GraphQL\Server\Helper::parseRequestParams which includes this check
Further:
Drop support for configuration the name of the variable for the variables (params_key)
GraphQLUploadMiddleware has been removed (RequestParser includes this functionality)
Empty GraphQL queries now return a proper validated GraphQL error
In \Rebing\GraphQL\GraphQL, renamed remaining instances of $params to $variables
After switching to RequestParser, the support for changing the variable name
what was supposed to params_key has gone and thus the name isn't fitting anymore.
Also, the default value for $variables has been changed to null to better
fit 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 parameter
The $args argument, of the handle method of the execution middlewares requires array as type.
Added
Command to make an execution middleware #772 / mfn
The primary execution of the GraphQL request is now piped through middlewares #762 / crissi and mfn
This allows greater flexibility for enabling/disabling certain functionality
as well as bringing in new features without having to open up the library.
Primarily register \Rebing\GraphQL\GraphQL as service and keep 'graphql' as alias #768 / mfn
Automatic Persisted Queries (APQ) now cache the parsed query #740 / mfn
This avoids having to re-parse the same queries over and over again.
Add ability to detect unused GraphQL variables #660 / mfn
Laravel's ValidationException is now formatted the same way as a ValidationError#748 / mfn
Changed
Internally webonyx query plan feature is now used for retrieving information about a query #793 / crissi)
Rewrite and simplify how schemas are handled #779 / mfn
Internally stop using the global config() function and preferable use the repository or the Facade otherwise #774 / mfn
Don't silence broken schemas when normalizing them for generating routes #766 / mfn
Lazy loading types has been enabled by default #758 / mfn
Make it easier to extend select fields #799 / crissi
The $args argument, of the handle method of the execution middlewares requires array as type #843 / sforward
Fixed
Fix TypeNotFound when an interface defined after another type where it is used #828 / kasian-sergeev
Removed
The method \Rebing\GraphQL\GraphQLServiceProvider::provides was removed #769 / mfn
It's only relevant for deferred providers which ours however isn't (and can't
be made into with the current Laravel architecture).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Changes since the last RC
$argsargument, of thehandlemethod of the execution middlewares requiresarrayas type #843 / sforwardTypeNotFoundwhen an interface defined after another type where it is used #828 / kasian-sergeevFull ChangeLog since 7.2.0
Breaking changes
Rewrite and simplify how schemas are handled
\Rebing\GraphQL\GraphQL::$schemasnow only holdsSchemas and not amixture of strings or arrays
\Rebing\GraphQL\GraphQL::schema()now only accepts a "schema name", but noad hoc
Schemaor "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 acceptSchemaobjects,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\Repositoryassecond argument:
\Rebing\GraphQL\GraphQL::__construct\Rebing\GraphQL\GraphQLServiceProvider::applySecurityRulesAs 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.middleware=>graphql.route.middlewaregraphql.route_group_attributes=>graphql.route.group_attributesgraphiql group prefix (default schema)
'method'argument must provide the HTTP methodverbs in uppercase like
POSTorGET,postorgetwill not work.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:old:
public function query(string $query, ?array $params = [], array $opts = []): arraynew:
public function query(string $query, ?array $variables = null, array $opts = []): arrayold:
public function queryAndReturnResult(string $query, ?array $params = [], array $opts = []): ExecutionResultnew:
public function queryAndReturnResult(string $query, ?array $variables = null, array $opts = []): ExecutionResult\Rebing\GraphQL\Support\ResolveInfoFieldsAndArgumentshas been removed$getSelectFieldsclosure no longer takes a depth parameterThe
$argsargument, of thehandlemethod of the execution middlewares requiresarrayas 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.
ValidationExceptionis now formatted the same way as aValidationError#748 / mfnChanged
config()function and preferable use the repository or the Facade otherwise #774 / mfn$argsargument, of thehandlemethod of the execution middlewares requiresarrayas type #843 / sforwardFixed
TypeNotFoundwhen an interface defined after another type where it is used #828 / kasian-sergeevRemoved
\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-rc5 / final RC before release 🤞.
Beta Was this translation helpful? Give feedback.
All reactions