Skip to content

Latest commit

 

History

History
426 lines (340 loc) · 21 KB

CHANGELOG.md

File metadata and controls

426 lines (340 loc) · 21 KB

CHANGELOG

Breaking changes

  • Support for Lumen has been removed
  • Integrate laragraph/utils RequestParser #739 / mfn
    • batched queries will only work with POST requests This is due to RequestParser using \GraphQL\Server\Helper::parseRequestParams which includes this check
    • Drop support for configuration the name of the variable for the variables
    • GraphQLUploadMiddleware has been removed (RequestParser includes this functionality)
    • Empty GraphQL queries now return a proper validated GraphQL error
    • Signature changes In \Rebing\GraphQL\GraphQLController:
      • old: protected function executeQuery(string $schema, array $input): array new: protected function executeQuery(string $schema, OperationParams $params): array
      • old: protected function queryContext(string $query, ?array $params, string $schema) new: protected function queryContext(string $query, ?array $variables, string $schema)
      • old: 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:
    • old: protected function executeQuery(string $schema, OperationParams $params): array new: protected function executeQuery(string $schemaName, OperationParams $params): array
    • old: 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 name what was supposed to params_key has gone and thus the name isn't fitting anymore
    • old: public function query(string $query, ?array $params = [], array $opts = []): array new: public function query(string $query, ?array $variables = [], array $opts = []): array
    • old: 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:
    • In \Rebing\GraphQL\GraphQLController, the following signature changed:
      • old: protected function handleAutomaticPersistQueries(string $schemaName, OperationParams $operation): string new: protected function handleAutomaticPersistQueries(string $schemaName, OperationParams $operation): array
    • In \Rebing\GraphQL\GraphQL, the following signature changed:
      • old: public function query(string $query, ?array $variables = [], array $opts = []): array new: public function query($query, ?array $variables = [], array $opts = []): array
      • old: public function queryAndReturnResult(string $query, ?array $variables = [], array $opts = []): ExecutionResult new: public function queryAndReturnResult($query, ?array $variables = [], array $opts = []): ExecutionResult

Added

  • 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

2021-04-10, 7.2.0

Added

2021-04-08, 7.1.0

Added

2021-04-03, 7.0.1

Added

2021-04-03, 7.0.0

Breaking changes

  • Signature of \Rebing\GraphQL\Support\Privacy::validate changed, now it accepts both query/mutation arguments and the query/mutation context. Update your existing privacy policies this way:
    -public function validate(array $queryArgs): bool
    +public function validate(array $queryArgs, $queryContext = null): bool

Added

  • Ability to pass query/mutation context to the field privacy handler (both closure and class) #727 / torunar

2021-04-03, 6.5.0

Fixed

2021-03-31, 6.4.0

Added

2021-03-12, 6.3.0

Added

2021-03-12, 6.2.0

Fixed

2020-11-30, 6.1.0

Same as 6.1.0-rc1!

Added

2020-11-27, 6.1.0-rc1

Added

2020-11-26, 6.0.0

Fixed

  • Implemented generation of a SyntaxError instead of a hard Exception for empty single/batch queries #685 / plivius

2020-11-13, 6.0.0-rc1

Breaking changes

Added

2020-11-26, 5.1.5

Fixed

  • Implemented generation of a SyntaxError instead of a hard Exception for empty single/batch queries #685 / plivius

2020-11-16, 5.1.5-rc1

Added

2020-09-03, 5.1.4

Hotfix release to replace 5.1.3

Apologies for the rushed 5.1.3 release causing trouble, it was in fact cut from the wrong branch and it was current state for the upcoming 6.x series 😬

5.1.4 intends to correct this.

Added

2020-09-02, 5.1.3

Added

2020-07-02, 5.1.2

Added

  • Re-added support for validation in field arguments (with breaking change fix) #630 / crissi

2020-04-23, 5.1.1

Fixed

2020-04-22, 5.1.0

Added

2020-04-03, 5.0.0

Added

Fixed

  • Fix the infinite loop as well as sending the correct matching input data to the rule-callback #579 / crissi
  • Fix selecting not the correct columns for interface fields #607 / illambo

Changed

  • Refactor route files with the goal of making adding subscription support easier #575 / crissi

Removed

  • Official support for Laravel 5.8 has been removed #596 / mfn

2019-12-09, 4.0.0

Added

  • Allow passing through an instance of a Field #521 / georgeboot
  • Add the ability to alias query and mutations arguments as well as input objects #517 / crissi
  • Classes can now be injected in the Resolve method from the query/mutation similarly to Laravel controller methods #520 / crissi

Fixed

  • Fix validation rules for non-null list of non-null objects #511 / crissi
  • Add morph type to returned models #503 / crissi
  • Querying same field multiple times causes an error (e.g. via fragments) #537 / edgarsn
  • Fixed the custom query not being handled by interface's relations #486 / EdwinDayot

Changed

2019-10-23, 3.1.0

Added

2019-10-20, 3.0.0

Added

  • Add wrapType(), allowing to add more information for queries/mutations #496 / albertcito

Changed

  • The signature of authorize changed, receiving not the exact same argumenst the resolver would #489 / mfn
    • before: public function authorize(array $args)
    • after: public function authorize($root, array $args, $ctx, ResolveInfo $resolveInfo = null, Closure $getSelectFields = null): bool
  • Forward PHP engine errors to the application error handler #487 / mfn

2019-08-27, 2.1.0

Added

  • The custom 'query' now receives the GraphQL context as the 3rd arg (same as any resolver) #464 / mfn
  • Allow to load deeper nested queries by allowing to change the depth when calling $getSelectFields(int $depth) #472 / mfn

2019-08-18, 2.0.1

Added

Changed

Fixed

  • Support adding Schema objects directly #449 / mfn
  • Input arguments are properly parsed when objects or lists are passed #419 / sowork

2019-08-05, 2.0.0

Breaking changes

  • The UploadType now has to be added manually to the types in your schema if you want to use it
    • The ::getInstance() method is gone
  • The order and arguments/types for resolvers has changed:
    • before: resolve($root, $array, SelectFields $selectFields, ResolveInfo $info)
    • after: resolve($root, $array, $context, ResolveInfo $info, Closure $getSelectFields)
  • Added PHP types / phpdoc to all methods / properties #331
    • Changes in method signatures will require small adaptions.
  • Validation errors are moved from error.validation to error.extensions.validation as per GraphQL spec recommendation #294
  • SelectFields on interface types now only selects specific fields instead of all #294
    • Although this could be considered a bug fix, it changes what columns are selected and if your code as a side effect dependent on all columns being selected, it will break

Added

  • Added support for lazy loading types (config lazyload_types), improve performance on large type systems #405 but doesn't work together with type aliases or paginate().
  • A migration guide for the Folklore library as part of the readme
  • New make:graphql:input command
  • New make:graphql:union command
  • New make:graphql:interface command
  • New make:graphql:field command
  • New make:graphql:enum command and dedicated EnumType, deprecating $enumObject=true in the Type class
  • New make:graphql:scalar command and add more information regarding scalars to the readme
  • TypeConvertible interface requiring to implement toType(): \GraphQL\Type\Definition\Type Existing types are not affected because they already made use of the same method/signature, but custom Scalar GraphQL types work differently and benefit from the interface
  • alias is now also supported for relationships #367
  • InputType support class which eventually replace $inputObject=true #363
  • Support DB::raw() in alias fields
  • GraphiQL: use regenerated CSRF from server if present #332
  • Internal
    • Added declare(strict_types=1) directive to all files
    • Test suite has been refactored and now features Database (SQLite) tests too

Changed

  • Types and Schemas are now only booted when the graphql service is requested, improving performance when having this library installed but not using it in certain workloads (pure artisan commands, non-GraphQL web requests, etc.) #427
  • Follow Laravel convention and use plural for namespaces (e.g. new queries are placed in App\GraphQL\Queries, not App\GraphQL\Query anymore); make commands have been adjusted
  • Made the following classes abstract: Support\Field, Support\InterfaceType, Support\Mutation, Support\Query, Support\Type, Support\UnionType #357
  • Updated GraphiQL to 0.13.0 #335
    • If you're using CSP, be sure to allow cdn.jsdelivr.net and cdnjs.cloudflare.com
  • ValidatorError: remove setter and make it a constructor arg, add getter and rely on contracts
  • Replace global helper is_lumen with static class call \Rebing\GraphQL\Helpers::isLumen

Fixed

  • The Paginator correctly inherits the types model so it can be used with SelectFields and still generates correct SQL queries #415
  • Arguments are now validated before they're passed to authorize() #413
  • File uploads now correctly work with batched requests #397
  • Path multi-level support for Schemas works again #358
  • SelectFields correctly passes field arguments to the custom query #327
    • This also applies to privacy checks on fields, the callback now receives the field arguments too
    • Previously the initial query arguments would be used everywhere

Removed

  • Removed \Fluent dependency on \Rebing\GraphQL\Support\Field #431
  • Removed \Fluent dependency on \Rebing\GraphQL\Support\Type #389
  • Unused static field \Rebing\GraphQL\Support\Type::$instances
  • Unused field \Rebing\GraphQL\Support\Type::$unionType

2019-06-10, v1.24.0

Changed

  • Prefix named GraphiQL routes with graphql. for compatibility with Folklore #360

2019-06-10, v1.23.0

Added

  • New config options headers to send custom HTTP headers and json_encoding_options for encoding the JSON response #293

Fixed

  • SelectFields now works with wrapped types (nonNull, listOf) #315

2019-05-31, v1.22.0

Added

  • Auto-resolve aliased fields #283
  • This project has a changelog \o/

2019-03-07, v1.21.2

  • Allow configuring a custom default field resolver #266
  • Routes have now given names, so they can be referenced #264
  • Expose more fields on the default pagination type #262
  • Mongodb support #257
  • Add support for MorphOne relationships #238
  • Checks for lumen when determining schema #247
  • Internal changes:
    • Replace deprecated global array_* and str_* helpers with direct Arr::* and Str::* calls
    • Code style now enforced via StyleCI

2019-03-07, v1.20.2

  • Fixed infinite recursion for InputTypeObject self reference #230

2019-03-03, v1.20.1

  • Laravel 5.8 support

2019-02-04, v1.19.1

  • Don't report certain GraphQL Errors

2019-02-03, v1.18.1

  • Mutation routes fix

2019-01-29, v1.18.0

  • Fix to allow recursive input objects #158

2019-01-24, v1.17.6

  • Fixed default error handler

2018-12-17, v1.17.3

  • Bump webonxy/graphql-php version requirement
  • Add support for custom error handler config handle_errors

2018-12-17, v1.16.0

  • Fixed validation

2018-07-20, v1.14.2

  • Validation error messages Can now add custom validation error messages to Queries and Mutations

2018-05-16, v1.13.0

  • Added support for query complexity and depth (more details)
  • Also added support for InputObjectType rules validation.

2018-04-20, v1.12.0

2018-04-10, v1.11.0

  • Rules supported for all Fields Added rules support for Query fields

2018-02-28, v1.9.5

  • Allow subscription types to be added Supports creating the schema, but the underlying PHP functionality does not do anything.

2018-01-05, v1.8.2

  • Updating route and controller to give us the ability to create multilevel URI names #69

2017-10-31, v1.7.3

  • Composer fix

2017-10-04, v1.7.1

  • SelectFields fix

2017-09-23, v1.6.1

  • GET routes

2017-08-27, v1.5.0

  • Enum types

2017-08-20, v1.4.9

  • Privacy validation optimized

2017-03-27, v1.4

  • Initial release