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
Version 10 focuses on safer production defaults, cleaner core architecture, and moving the optional Eloquent query-selection machinery into its own package.
Before upgrading, read the Upgrade Guide. For the complete RC-by-RC history and pull request references, see the Changelog.
For most users, this is enough. The package keeps the original namespaces and reads the same field config keys such as model, alias, selectable, always, is_relation, and query.
Core removals related to this extraction:
Rebing\GraphQL\Support\SelectFields removed from core
Closure type-hint in resolve() no longer auto-injects a SelectFields factory unless the external package is installed
Field::selectFieldClass() removed
Field::instanciateSelectFields() removed
Generated query/mutation stubs no longer include SelectFields boilerplate
Security defaults are stricter
Version 10 changes several defaults to be safer for production deployments:
Schemas now default to POST only
Batching is disabled by default
Batch size is limited by batching.max_batch_size, default 10
Introspection is disabled by default
Query depth defaults to 13
Query complexity defaults to 500
Authorization now runs before validation
authorize() must return exactly true
If you previously relied on open defaults, explicitly configure them during upgrade.
To re-enable introspection, for example in development:
GRAPHQL_DISABLE_INTROSPECTION=false
To re-enable GET requests:
'method' => ['GET', 'POST'],
If you enable GET, also enable ReadOnlyOperationMiddleware after AutomaticPersistedQueriesMiddleware so mutations and subscriptions are rejected on GET requests.
Privacy signatures changed
Privacy::validate() now receives the parent/root object and field arguments:
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.
graphql-laravel 10.0.0
This is the stable release of the 10.x series.
Version 10 focuses on safer production defaults, cleaner core architecture, and moving the optional Eloquent query-selection machinery into its own package.
Before upgrading, read the Upgrade Guide. For the complete RC-by-RC history and pull request references, see the Changelog.
Most Important Upgrade Notes
SelectFields moved to a separate package
SelectFieldsis no longer part of core.If you use
SelectFields, install the new package:For most users, this is enough. The package keeps the original namespaces and reads the same field config keys such as
model,alias,selectable,always,is_relation, andquery.Core removals related to this extraction:
Rebing\GraphQL\Support\SelectFieldsremoved from coreClosuretype-hint inresolve()no longer auto-injects a SelectFields factory unless the external package is installedField::selectFieldClass()removedField::instanciateSelectFields()removedSecurity defaults are stricter
Version 10 changes several defaults to be safer for production deployments:
POSTonlybatching.max_batch_size, default1013500authorize()must return exactlytrueIf you previously relied on open defaults, explicitly configure them during upgrade.
To re-enable introspection, for example in development:
To re-enable GET requests:
If you enable GET, also enable
ReadOnlyOperationMiddlewareafterAutomaticPersistedQueriesMiddlewareso mutations and subscriptions are rejected on GET requests.Privacy signatures changed
Privacy::validate()now receives the parent/root object and field arguments:Privacy closures receive the same shape:
The old first argument represented root query arguments. The new
$fieldArgscontains the field's own arguments.Middleware signatures changed
Resolver middleware now declares native
mixedparameter and return types. Custom middleware overridinghandle()must match:authorize()signature changedThe unused
$getSelectFieldsparameter was removed:Highlights
OpenTelemetry tracing support
Version 10 adds tracing infrastructure with an OpenTelemetry driver.
New tracing components include:
TracingDriverTracingManagerTracingExecutionMiddlewareTracingResolverMiddlewareOpenTelemetryTracingDriverTracing is disabled by default and can be enabled globally or per schema.
CSRF protection middleware
A new opt-in HTTP middleware is available:
Use this for GraphQL endpoints that rely on cookie/session authentication, including Laravel session auth or Sanctum cookie mode.
Read-only GET enforcement
A new opt-in execution middleware rejects mutations and subscriptions submitted through GET:
This is especially relevant if you enable GET for CDN-cacheable persisted queries.
Extensible resolver parameter injection
External packages can now hook into resolver parameter injection through:
Rebing\GraphQL\Support\Contracts\ResolverParameterInjectorField::registerParameterInjector()Field::clearParameterInjectors()This is what allows the external SelectFields package to restore SelectFields injection without keeping it in core.
Fixes And Behavior Improvements
config()inside the config fileOperationParamsnow copiesoriginalInputandreadOnlyAddAuthUserContextValueMiddlewarenow resolves the guard from schema/global route configprivacyon nested/sub-type fields is now enforced through field resolversGraphQL::type()has a narrower PHPStan return typemake:graphql:executionMiddlewareis now registered correctlywebonyx/graphql-phpversion is now^15.31.0Links
This discussion was created from the release 10.0.0.
All reactions