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
- Upgrade to graphql-php 15 [\#953 / mfn](https://github.com/rebing/graphql-laravel/pull/953)\
10
+
This includes possible breaking changes also outside of this package, see also https://github.com/webonyx/graphql-php/releases/tag/v15.0.0\
11
+
Known breaking changes:
12
+
- non-standard error related data keys are not included directly in
13
+
`errors.*.<non-standard error key>` any more, but have been moved to
14
+
`errors.*.extensions.<non-standard error key>`.\
15
+
Also new keys may appear here from upstream.
16
+
- The `errors.*.extensions.category` has been removed upstream, but we try to
17
+
keep it alive with the interface
18
+
`\Rebing\GraphQL\Error\ProvidesErrorCategory` as it can be a useful
19
+
discriminator on the client side in certain cases. But only the cases from
20
+
_this_ library are preserved, e.g. categories like `request`, `graphql` or
21
+
`internal` are gone.
22
+
- The `\Rebing\GraphQL\Support\OperationParams` has added required types due to
23
+
its base class changes:
24
+
- Old: `public function getOriginalInput($key)`\
25
+
new: `public function getOriginalInput(string $key)`
26
+
- Old: `public function isReadOnly()`\
27
+
new: `public function isReadOnly(): bool`
28
+
29
+
Some BC may happen also if you extended code originating in graphql-php,
30
+
some examples:
31
+
- if you implement custom types, you now have to use property types for e.g.
32
+
`$name` or `$description`
33
+
- If you used any `\GraphQL\Validator\DocumentValidator` in your code
34
+
directly, you now need use FQCN to reference them and not the shortened
35
+
string names.
36
+
-`->getWrappedType(true)` was replaced with `->getInnermostType()`
37
+
- the class `\GraphQL\Type\Definition\FieldArgument` has been renamed to
38
+
`\GraphQL\Type\Definition\Argument`
39
+
40
+
### Removed
41
+
- Remove support for eager loading (=non-lazy loading) of types\
42
+
Lazy loading has been introduced in 2.0.0 (2019-08) and has been made the
43
+
default since 8.0.0 (2021-11).\
44
+
The practical impact is that types are always going to be resolved using a
45
+
type loader and therefore cannot use aliases anymore. Types and their type
46
+
name have to match.
47
+
- Remove integrated GraphiQL support in favour of https://github.com/mll-lab/laravel-graphiql[\#986 / mfn](https://github.com/rebing/graphql-laravel/pull/986)
48
+
- Laravel 6 is no longer supported [\#967 / mfn](https://github.com/rebing/graphql-laravel/pull/967)
49
+
50
+
## Changed
51
+
- The type resolver is now able to resolve the top level types 'Query',
52
+
'Mutation' and 'Subscription'
53
+
7
54
2023-02-18, 8.6.0
8
55
-----------------
9
56
### Added
10
-
- Add Laravl 10 support [\#983 / jasonvarga](https://github.com/rebing/graphql-laravel/pull/983)
57
+
- Add Laravel 10 support [\#983 / jasonvarga](https://github.com/rebing/graphql-laravel/pull/983)
[](https://join.slack.com/t/rebing-graphql/shared_invite/enQtNTE5NjQzNDI5MzQ4LTdhNjk0ZGY1N2U1YjE4MGVlYmM2YTc2YjQ0MmIwODY5MWMwZWIwYmY1MWY4NTZjY2Q5MzdmM2Q3NTEyNDYzZjc)
8
8
9
-
Use Facebook's GraphQL with PHP 7.4+ on Laravel 6.0 & 8.0+. It is based on the [PHP port of GraphQL reference implementation](https://github.com/webonyx/graphql-php). You can find more information about GraphQL in the [GraphQL Introduction](https://reactjs.org/blog/2015/05/01/graphql-introduction.html) on the [React](https://reactjs.org/) blog or you can read the [GraphQL specifications](https://spec.graphql.org/).
9
+
Use Facebook's GraphQL with PHP 7.4+ on Laravel 8.0+. It is based on the [PHP port of GraphQL reference implementation](https://github.com/webonyx/graphql-php). You can find more information about GraphQL in the [GraphQL Introduction](https://reactjs.org/blog/2015/05/01/graphql-introduction.html) on the [React](https://reactjs.org/) blog or you can read the [GraphQL specifications](https://spec.graphql.org/).
10
10
11
11
* Allows creating **queries** and **mutations** as request endpoints
12
12
* Supports multiple schemas
@@ -56,8 +56,6 @@ Review the configuration file:
56
56
config/graphql.php
57
57
```
58
58
59
-
The default GraphiQL view makes use of the global `csrf_token()` helper function.
60
-
61
59
## Usage
62
60
63
61
-[Laravel GraphQL](#laravel-graphql)
@@ -69,7 +67,6 @@ The default GraphiQL view makes use of the global `csrf_token()` helper function
69
67
-[Concepts](#concepts)
70
68
-[A word on declaring a field `nonNull`](#a-word-on-declaring-a-field-nonnull)
As with queries/mutations, you can use an alias name (though again this prevents
451
-
it from taking advantage of lazy type loading):
452
-
```php
453
-
'schemas' => [
454
-
'default' => [
455
-
// ...
456
-
457
-
'types' => [
458
-
'Useralias' => App\GraphQL\Types\UserType::class,
459
-
],
460
-
```
461
-
462
425
Then you need to define a query that returns this type (or a list). You can also specify arguments that you can use in the resolve method.
463
426
```php
464
427
namespace App\GraphQL\Queries;
@@ -2696,9 +2659,6 @@ To prevent such scenarios, you can add the `UnusedVariablesMiddleware` to your
2696
2659
-`batching`\
2697
2660
- 'enable'\
2698
2661
Whether to support GraphQL batching or not
2699
-
-`lazyload_types`\
2700
-
The types will be loaded on demand. Enabled by default as it improves
2701
-
performance. Cannot be used with type aliasing.
2702
2662
-`error_formatter`\
2703
2663
This callable will be passed the Error object for each errors GraphQL catch.
2704
2664
The method should return an array representing the error.
@@ -2715,19 +2675,6 @@ To prevent such scenarios, you can add the `UnusedVariablesMiddleware` to your
2715
2675
You can define your own pagination type.
2716
2676
-`simple_pagination_type`\
2717
2677
You can define your own simple pagination type.
2718
-
-`graphiql`\
2719
-
Config for GraphiQL (see (https://github.com/graphql/graphiql)
2720
-
-`prefix`\
2721
-
The route prefix
2722
-
-`controller`\
2723
-
The controller / method to handle the route
2724
-
-`middleware`\
2725
-
Any middleware to be run before invoking the controller
2726
-
-`view`\
2727
-
Which view to use
2728
-
-`display`\
2729
-
Whether to enable it or not.\
2730
-
**Note:** it's recommended to disable this in production!
2731
2678
-`defaultFieldResolver`\
2732
2679
Overrides the default field resolver, see http://webonyx.github.io/graphql-php/data-fetching/#default-field-resolver
2733
2680
-`headers`\
@@ -2809,7 +2756,7 @@ The following is not a bullet-proof list but should serve as a guide. It's not a
2809
2756
-`composer remove folklore/graphql`
2810
2757
- if you've a custom ServiceProvider or did include it manually, remove it. The point is that the existing GraphQL code should not be triggered to run.
2811
2758
-`composer require rebing/graphql-laravel`
2812
-
- Publish `config/graphql.php` and adapt it (prefix, middleware, schemas, types, mutations, queries, security settings, graphiql)
2759
+
- Publish `config/graphql.php` and adapt it (prefix, middleware, schemas, types, mutations, queries, security settings)
2813
2760
- Removed settings
2814
2761
-`domain`
2815
2762
-`resolvers`
@@ -2824,24 +2771,6 @@ The following is not a bullet-proof list but should serve as a guide. It's not a
2824
2771
2825
2772
## Performance considerations
2826
2773
2827
-
### Lazy loading of types
2828
-
2829
-
Lazy loading of types is a way of improving the start up performance.
2830
-
2831
-
If you are declaring types using aliases, this is not supported and you need to
2832
-
set `lazyload_types` set to `false`.
2833
-
2834
-
#### Example of aliasing **not** supported by lazy loading
2835
-
2836
-
I.e. you cannot have a query class `ExampleQuery` with the `$name` property
2837
-
`example` but register it with a different one; this will **not** work:
2838
-
2839
-
```php
2840
-
'query' => [
2841
-
'aliasedExample' => ExampleQuery::class,
2842
-
],
2843
-
```
2844
-
2845
2774
### Wrap Types
2846
2775
2847
2776
You can wrap types to add more information to the queries and mutations. Similar as the pagination is working you can do the same with your extra data that you want to inject ([see test examples](https://github.com/rebing/graphql-laravel/tree/master/tests/Unit/WithTypeTests)). For instance, in your query:
@@ -2870,4 +2799,4 @@ public function resolve($root, array $args)
2870
2799
2871
2800
## GraphQL testing clients
2872
2801
-[Firecamp](https://firecamp.io/graphql)
2873
-
-[GraphiQL](https://github.com/graphql/graphiql)
2802
+
-[GraphiQL](https://github.com/graphql/graphiql)[integration via laravel-graphiql](https://github.com/mll-lab/laravel-graphiql)
0 commit comments