Skip to content

Commit def6d5c

Browse files
authored
Add migration guide for release 5.0.0 #585 (#615)
1 parent c5e2e51 commit def6d5c

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

docs/migration-to-5.0.0.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
Some breaking changes were introduced
2+
in [Release 5.0.0](https://github.com/kobylynskyi/graphql-java-codegen/releases/tag/v5.0.0). So if you were using
3+
version 4.x.x then please follow steps below. Note: if you are migrating from version 3.x.x or earlier, then please also
4+
follow [4.0.0 migration guide](migration-to-4.0.0.md) first.
5+
6+
## NOTE
7+
**Migration from 4.x.x to 5.0.0 is required only if you were using
8+
[external mapping configuration](codegen-options.md#external-mapping-configuration)**.
9+
Otherwise - feel free to use graphql-java-codegen-5.0.0 without any breaking changes.
10+
11+
## Migration steps
12+
13+
### 1. Update plugin and library versions
14+
15+
As per plugin description:
16+
[Gradle](https://github.com/kobylynskyi/graphql-java-codegen/tree/master/plugins/gradle),
17+
[Maven](https://github.com/kobylynskyi/graphql-java-codegen/tree/master/plugins/maven),
18+
[SBT](https://github.com/kobylynskyi/graphql-java-codegen/tree/master/plugins/sbt)
19+
20+
### 2. Rename jsonConfigurationFile => configurationFiles
21+
22+
#### Maven
23+
24+
```xml
25+
<configuration>
26+
<!--OLD APPROACH-->
27+
<jsonConfigurationFile>src/main/resources/mappingConfig.json</jsonConfigurationFile>
28+
<!--OLD APPROACH-->
29+
30+
<!--NEW APPROACH-->
31+
<configurationFiles>
32+
<configurationFile>src/main/resources/mappingConfig.json</configurationFile>
33+
</configurationFiles>
34+
<!--NEW APPROACH-->
35+
</configuration>
36+
```
37+
38+
#### Gradle
39+
40+
```groovy
41+
// OLD APPROACH
42+
jsonConfigurationFile="src/main/resources/mappingConfig.json"
43+
// OLD APPROACH
44+
45+
// NEW APPROACH
46+
configurationFiles=["src/main/resources/mappingConfig.json"]
47+
// NEW APPROACH
48+
```
49+
50+
#### SBT
51+
52+
```sbt
53+
// OLD APPROACH
54+
jsonConfigurationFile := Some("src/main/resources/mappingConfig.json")
55+
// OLD APPROACH
56+
57+
// NEW APPROACH
58+
configurationFiles := List("src/main/resources/mappingConfig.json")
59+
// NEW APPROACH
60+
```
61+
62+
### 3. Regenerate the code
63+
64+
Run project build so that GraphQL classes are regenerated and your code compiles.
65+
66+
67+
---
68+
69+
Feel free to ask any questions in [GitHub Discussions](https://github.com/kobylynskyi/graphql-java-codegen/discussions)
70+
or [create an issue](https://github.com/kobylynskyi/graphql-java-codegen/issues) if you discover some problems.

0 commit comments

Comments
 (0)