11# Upgrade
22
33## Upgrade v0.7.x > v0.8.x
4+ All of those changes apply to those who extends various parts of this library.
5+ If you only use the library and don't try to extend it - everything should work without breaks.
46
5- ### AST node classes
6- AST node classes were renamed to disambiguate with types. e.g.:
77
8- ```
9- GraphQL\Language\AST\Field -> GraphQL\Language\AST\FieldNode
10- GraphQL\Language\AST\OjbectValue -> GraphQL\Language\AST\OjbectValueNode
11- ```
12- etc.
13-
14- Node kind constants were extracted from ` GraphQL\Language\AST\Node ` to ` GraphQL\Language\AST\NodeKind `
15-
16-
17- ### Custom directives handling
8+ ### Breaking: Custom directives handling
189When passing custom directives to schema, default directives (like ` @skip ` and ` @include ` )
19- are not added to schema automatically anymore. If you need them - add them explicitly with your other directives
10+ are not added to schema automatically anymore. If you need them - add them explicitly with
11+ your other directives.
2012
2113Before the change:
2214``` php
@@ -34,26 +26,31 @@ $schema = new Schema([
3426]);
3527```
3628
37- ### Protected property and method naming
38- In order to unify coding style, leading underscores were removed from all private and protected properties
39- and methods.
29+ ### Breaking: Schema protected property and methods visibility
30+ Most of the ` protected ` properties and methods of ` GraphQL\Schema ` were changed to ` private ` .
31+ Please use public interface instead.
4032
41- Example before the change:
42- ``` php
43- GraphQL\Schema::$_queryType;
44- ```
33+ ### Breaking: Node kind constants
34+ Node kind constants were extracted from ` GraphQL\Language\AST\Node ` to
35+ separate class ` GraphQL\Language\AST\NodeKind `
36+
37+ ### Non-breaking: AST node classes renamed
38+ AST node classes were renamed to disambiguate with types. e.g.:
4539
46- Correct usage after the change:
47- ``` php
48- GraphQL\Schema::$queryType;
4940```
41+ GraphQL\Language\AST\Field -> GraphQL\Language\AST\FieldNode
42+ GraphQL\Language\AST\OjbectValue -> GraphQL\Language\AST\OjbectValueNode
43+ ```
44+ etc.
5045
51- So if you rely on any protected properties or methods of any GraphQL class, make sure to
52- delete leading underscores .
46+ Old names are still available via ` class_alias ` defined in ` src/deprecated.php ` .
47+ This file is included automatically when using composer autoloading .
5348
5449### Deprecations
55- There are also several deprecations which still work, but trigger ` E_USER_DEPRECATED `
56- when used.
50+ There are several deprecations which still work, but trigger ` E_USER_DEPRECATED ` when used.
51+
52+ For example ` GraphQL\Executor\Executor::setDefaultResolveFn() ` is renamed to ` setDefaultResolver() `
53+ but still works with old name.
5754
5855## Upgrade v0.6.x > v0.7.x
5956
0 commit comments