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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ CHANGELOG
35
35
- Test suite has been refactored and now features Database (SQLite) tests too
36
36
37
37
### Changed
38
-
- 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
38
+
- Follow Laravel convention and use plural for namspaces (e.g. new queries are placed in `App\GraphQL\Queries`, not `App\GraphQL\Query` anymore); make commands have been adjusted
39
39
- Made the following classes _abstract_: `Support\Field`, `Support\InterfaceType`, `Support\Mutation`, `Support\Query`, `Support\Type`, `Support\UnionType`[\#357](https://github.com/rebing/graphql-laravel/pull/357)
40
40
- Updated GraphiQL to 0.13.0 [\#335](https://github.com/rebing/graphql-laravel/pull/335)
41
41
- If you're using CSP, be sure to allow `cdn.jsdelivr.net` and `cdnjs.cloudflare.com`
@@ -44,7 +44,7 @@ CHANGELOG
44
44
45
45
### Fixed
46
46
- The Paginator correctly inherits the types model so it can be used with `SelectFields` and still generates correct SQL queries [\#415](https://github.com/rebing/graphql-laravel/pull/415)
47
-
- Arguments are now validation before they're passed to `authorize()`[\#413](https://github.com/rebing/graphql-laravel/pull/413)
47
+
- Arguments are now validated before they're passed to `authorize()`[\#413](https://github.com/rebing/graphql-laravel/pull/413)
48
48
- File uploads now correctly work with batched requests [\#397](https://github.com/rebing/graphql-laravel/pull/397)
49
49
- Path multi-level support for Schemas works again [\#358](https://github.com/rebing/graphql-laravel/pull/358)
50
50
- SelectFields correctly passes field arguments to the custom query [\#327](https://github.com/rebing/graphql-laravel/pull/327)
@@ -521,7 +523,13 @@ public function validationErrorMessages(array $args = []): array
521
523
522
524
This library provides a middleware compliant with the spec at https://github.com/jaydenseric/graphql-multipart-request-spec .
523
525
524
-
You have to add the `\Rebing\GraphQL\Support\UploadType` first to your `config/graphql` schema types definition.
526
+
You have to add the `\Rebing\GraphQL\Support\UploadType` first to your `config/graphql` schema types definition:
527
+
528
+
```php
529
+
'types' => [
530
+
\Rebing\GraphQL\Support\UploadType::class,
531
+
],
532
+
```
525
533
526
534
It is relevant that you send the request as `multipart/form-data`:
527
535
@@ -1505,6 +1513,52 @@ The parameters received are your regular "resolve" function signature.
1505
1513
1506
1514
## Guides
1507
1515
1516
+
### Upgrading from v1 to v2
1517
+
1518
+
Although version 2 builds on the same code base and does not radically change how the library itself works, many things were improved, sometimes leading to incompatible changes.
1519
+
1520
+
- Step 0: make a backup!
1521
+
- Re-publish the configuration file to learn about all the new settings
1522
+
- The order and arguments/types for resolvers has changed:
- If you now want to use SelectFields, you've to first request it: `$selectFields = $getSelectFields();`. The primary reason for this is performance. SelectFields is an optional feature but consumes resources to traverse the GraphQL request AST and introspect all the types for their configuration to apply its magic. In the past it was always constructed and thus consumed resources, even when not requested. This has been changed to an explicit form.
1526
+
- Many method signature declarations changed to improve type safety, which have to be adapted:
1527
+
- The signature of the method fields changed:
1528
+
- from `public function fields()`
1529
+
- to `public function fields(): array`
1530
+
- The signature of the method toType changed:
1531
+
- from `public function toType()`
1532
+
- to `public function toType(): \GraphQL\Type\Definition\Type`
1533
+
- The signature of the method getFields changed:
1534
+
- from `public function getFields()`
1535
+
- to `public function getFields(): array`
1536
+
- The signature of the method interfaces changed:
1537
+
- from `public function interfaces()`
1538
+
- to `public function interfaces(): array`
1539
+
- The signature of the method types changed:
1540
+
- from `public function types()`
1541
+
- to `public function types(): array`
1542
+
- The signature of the method type changed:
1543
+
- from `public function type()`
1544
+
- to `public function type(): \GraphQL\Type\Definition\Type`
1545
+
- The signature of the method args changed:
1546
+
- from `public function args()`
1547
+
- to `public function args(): array`
1548
+
- The signature of the method queryContext changed:
1549
+
- from `protected function queryContext($query, $variables, $schema)`
1550
+
- to `protected function queryContext()`
1551
+
- The signature of the controller method query changed:
1552
+
- from `function query($query, $variables = [], $opts = [])`
- the signature of the method parseLiteral changed (due to upgrade of the webonxy library):
1556
+
- from `public function parseLiteral($ast)`
1557
+
- to `public function parseLiteral($valueNode, ?array $variables = null)`
1558
+
- 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, you simple reference it like any other type via `GraphQL::type('Upload')`.
1559
+
- Follow Laravel convention and use plural for namspaces (e.g. new queries are placed in `App\GraphQL\Queries`, not `App\GraphQL\Query` anymore); the respective `make` commands have been adjusted. This will not break any existing code, but code generates will use the new schema.
1560
+
- Be sure to read the [Changelog](CHANGELOG.md) for more details
1561
+
1508
1562
### Migrating from Folklore
1509
1563
https://github.com/folkloreinc/laravel-graphql, formerly also known as https://github.com/Folkloreatelier/laravel-graphql
1510
1564
@@ -1528,39 +1582,9 @@ The following is not a bullet-proof list but should serve as a guide. It's not a
1528
1582
- Change namespace references:
1529
1583
- from `Folklore\`
1530
1584
- to `Rebing\`
1531
-
- The signature of the method fields changed:
1532
-
- from `public function fields()`
1533
-
- to `public function fields(): array`
1534
-
- The signature of the method toType changed:
1535
-
- from `public function toType()`
1536
-
- to `public function toType(): \GraphQL\Type\Definition\Type`
1537
-
- The signature of the method getFields changed:
1538
-
- from `public function getFields()`
1539
-
- to `public function getFields(): array`
1540
-
- The signature of the method interfaces changed:
1541
-
- from `public function interfaces()`
1542
-
- to `public function interfaces(): array`
1543
-
- The signature of the method types changed:
1544
-
- from `public function types()`
1545
-
- to `public function types(): array`
1546
-
- The signature of the method type changed:
1547
-
- from `public function type()`
1548
-
- to `public function type(): \GraphQL\Type\Definition\Type`
1549
-
- The signature of the method args changed:
1550
-
- from `public function args()`
1551
-
- to `public function args(): array`
1552
-
- The signature of the method queryContext changed:
1553
-
- from `protected function queryContext($query, $variables, $schema)`
1554
-
- to `protected function queryContext()`
1555
-
- The signature of the controller method query changed:
1556
-
- from `function query($query, $variables = [], $opts = [])`
0 commit comments