Skip to content

v2.0.0-RC3

Pre-release
Pre-release
Compare
Choose a tag to compare
@mfn mfn released this 10 Jul 22:40
· 1426 commits to master since this release
1ec5cfa

Quick on the heels of RC2, here's the third Release Candidate of the v2 release line!

There was only a minor change since the last release but nevertheless one important to reach people about the possible impact.

Changes since the last Release Candidate

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

Please report and issues you find or hop on slack and give us feedback!

Full Changelog since the latest v1 release

This covers the changes since the last stable release of the v1 release line, v1.24.0

Breaking changes

  • 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 consider 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

  • 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

  • Follow Laravel convention and use plural for namspaces (e.g. new queries are place 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

  • 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\Type
  • Unused static field \Rebing\GraphQL\Support\Type::$instances
  • Unused field \Rebing\GraphQL\Support\Type::$unionType