Releases: silverstripe/silverstripe-graphql
3.7.0
What's Changed
- NEW: Field formatting API, forward compatibility by @unclecheese in #313
- MNT Use correct versions by @emteknetnz in #357
- BUGFIX: Ensure referential equality of two connection types by @unclecheese in #378
- API Block older version module from using this minor by @maxime-rainville in #379
- MNT Block a few more pre-1.8 module from being installed by @maxime-rainville in #381
- MNT Require recipe 4.x-dev, bump frameworktest by @emteknetnz in #383
- BUGFIX: Replace graceful failure of field access on dataobjects by @unclecheese in #399
- fix: typo in code example by @freezernick in #402
- Add query filter check & compatibility with graphsql 3 by @satrun77 in #411
- API phpunit9 support by @emteknetnz in #409
New Contributors
- @freezernick made their first contribution in #402
- @satrun77 made their first contribution in #411
Full Changelog: 3.4.1...3.7.0
3.5.2
What's Changed
- [CVE-2021-28661] Add a CanViewPermissionChecker if permission checker is null by @maxime-rainville in #407
Full Changelog: 3.5.1...3.5.2
4.0.0-alpha3
What's Changed
- Add access to belongs_many_many relation by @bummzack in #394
- NEW: Force low-level errors to throw in dev by @unclecheese in #397
- NEW: DBField arguments, Enum, Composite support by @unclecheese in #398
Full Changelog: 4.0.0-alpha2...4.0.0-alpha3
3.5.1: BUGFIX: Replace graceful failure of field access on dataobjects (#399)
* BUGFIX: Replace graceful failure of field access on dataobjects * Revise per steve feedback
4.0.0-alpha2
- ENH Remove basic-auth (Steve Boyd) - 0e91cfb
- NEW Add TestSessionEnvironmentExtension to support behat tests (Steve Boyd) - 2a121e2
- BUGFIX: Allow mapFieldByClassName to be authoritative (Aaron Carlino) - 0dc90fe
- MINOR: Improve version constraint for silverstripe/event-dispatcher (Aaron Carlino) - baa89d1
- MINOR: Update event-dispatcher dependency (Aaron Carlino) - d38230c
- FIX: NestedInputBuilder correctly builds filters for models with multiple relations of the same type (#363) (Matthias Leutenegger) - a53aea5
- FIX: input building in cyclic graphs (#371) (Matthias Leutenegger) - eace0fa
- BUGFIX: insufficient args passed in resolveType (Aaron Carlino) - 8b48b80
- MINOR: Make paginator injectable (#368) (Aaron Carlino) - fbf75e8
- MINOR: Remove exclude directive from mutation input types (Aaron Carlino) - 290abb8
- BUGFIX: Malformed cache instance causing pollution and build errors (Aaron Carlino) - 4011f0d
3.5.0-beta1
- API Block older version module from using this minor (#379) (Maxime Rainville) - f8ac3f7
- MNT Use correct versions (Steve Boyd) - 11e9bad
- Update build status badge (Steve Boyd) - 2f000b6
- Removed non-functional scrutinizer badge (Ingo Schommer) - c1db445
- NEW: Field formatting API, forward compatibility (#313) (Aaron Carlino) - 25f654c
4.0.0 alpha 1
This is the first alpha release of GraphQL 4
Changelog
For more a high-level view of what has changed in GraphQL 4, see the upgrade guide.
Changes since 3 Feb 2021
-
Refactor context provider API so that they now plug into
QueryHandlerInterface
. They
can set and get their own context based on their own internal logic. Before:
$user = $context['currentUser'];
after:$user = UserContextProvider::get($context)
-
BuildState
API is gone. Use newSchemaContextProvider
in resolvers. PassSchemaContext
objects to the small number of classes that needed it in their internals. -
AbstractNestedInputPlugin
is gone. This never made any sense to tie something
so utilitarian to an arbitrary inheritance chain. It has been refactored asNestedInputBuilder
and is far more single-purpose. No longer concerned with model and field mapping, but rather
just building recursive input types and adding them to the schema. -
Refactor
QuerySort
,QueryFilter
to use input builder -
Field mapping is no longer exhaustively encoded in the resolvers. New
SchemaContextProvider
allows resolvers to look at the schema as persisted to a
PHP array in the code gen and invoke methods like$schema->mapField($type, $fieldName)
-
No more
resolveContext
for DataObject\Resolver since field mapping is handled externally now -
Migrate type
Controller::introspectTypes
to standalone service (SchemaTranscriber
)
invoked through event dispatcher -
Remove
IntrospectionProvider
extension. Static only. Leaving it to the user to decide never made any sense, and it just slowed down the UI in the CMS. Now that we're doing code gen, it seems like the static solution is more consistent. -
Remove
ModelConfigurationProvider
: Didn't make any sense. Models are now
responsible for fetching their own configurations. -
Remove
defaultResolver
: Didn't make any sense. Just set a defaultresolver
property and allow it to be overridden. -
Resolver discovery is now lazy to avoid race conditions in config. If resolvers
are null at code gen time, discovery is invoked and applied. -
Controller now only accepts a schema key and uses
SchemaFactory
to boot. -
Schema::quiet()
is gone. Schema is quiet by default to better support autobuilding
and test suites. Opt into verbose withsetVerbose(true)
. -
CSRFMiddleware
andHTTPMethodMiddleware
now rely on new ContextProviders
to better encapsulate their state concerns. -
Better error reporting:
- QueryHandler now pretty prints the stack trace
- Resolver level errors now throw
ResolverFailure
which express tons of useful
context, including the query path, the field, the type, the args, and most importantly,
the resolver chain. No more guessing which closure failed. - ResolverFailure relies on new
resolverComposition
field in encoded types. - Updates to code gen templates to support the above, and other tidiness like
variable assignment to save code execution and comments to show closing bracket relationships.
-
ComposedResolver is now stateful, mostly for diagnostic purposes. Before:
ComposedResolver::create(): Closure
after:ComposedResolver::create($list)->toClosure()
-
All resolvers use
ComposedResolver
for consistency, even when no middle/afterwares -
ComposedResolver
no longer needs separate arguments for primary, before, and after
resolvers. Just a stack that leaves ordering a concern of the code composing the class.
(this was a @todo annotation FWIW) -
SchemaModelInterface
now must declaregetPropertyForField
(gql field -> object property mapping) -
SchemaModelInterface
now must declaregetSchemaContext
andgetModelConfiguration
-
New
hasNativeField
inFieldAccessor
helps with knowing what fields are
filterable/sortable. Basically ORM insight. -
Fields using the
model
property (a bit of a polymorphic hack to support
cases like CMS needing to know what the SiteTree model is named), will
get just-in-time assignment before code generation time to prevent race conditions
in the config. -
New suite of relational
FakeProduct
objects for testing nested queries, filters, mutations. -
New top-to-bottom integration test that creates, updates, and reads nested data structures with filters/sorting, field aliases, etc.
-
NB:
CodeGenerationStore
is now responsible for type mapping and field mapping. This
is a leaky abstraction as it's tightly coupled to SchemaContext now. -
New
StorableSchema
layer eliminates unpredictable state ofSchema
throughprocess()
. The readonly value object returned bycreateStorableSchema()
is expected to
be a complete set of primitive objects that are consumable by a storage service. -
SchemaFactory
is nowSchemaBuilder
, which has four clearly defined functions, and eliminates the confusion around usingSchema
at query time:getConfig(string $schemaKey): ?SchemaContext
-- Get the cached configuration of a Schema. Useful for resolversboot(string $schemaKey): Schema
-- Load all the configuration in to a Schema object. Useful for the configuration/build process.getSchema(string $schemaKey): ?GraphQLSchema
-- Retrieve a queryable graphql-php Schema object from the storage service. Useful at query time.build(Schema $schema, bool $clear = false)
: GraphQLSchema -- put theSchema
through a storage service and return its queryable schema
-
SchemaStorageInterface is now the concern of
SchemaBuilder
rather thanSchema
, which results in a diminished API surface forSchema
. -
Validation of Schema moved to
StorableSchema
, as this is the only time the schema truly needs to be valid (before storage) -
Type/field mapping done just-in-time for schema storage
-
Prefer event dispatcher over extend() hooks in controller
-
SchemaContext
is nowSchemaConfig
-
Schema
has newgetState()
for persisting state during build -
Improved handling of "empty" schemas that shouldn't be built, but also shouldn't error (e.g.
default
out of the box)
3.2.3
MINOR: add result to onAfterMiddlware hook (#258)
3.2.1
Merge pull request #243 from silverstripe-terraformers/feature/after-…
0.2.1
API Update graphql to use new config (#81)