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
Add some more details in the main README to align with the Expedia Group OSS templates and provide some more details to first time viewers. Also update the CONTRIBUTING doc with more details
`graphql-kotlin` is open source and welcomes contributions. We do ask that you help us maintain a clean library and create the best code for everyone to use.
3
+
We'd love to accept your patches and contributions to this project. There are just a few guidelines you need to follow which are described in detail below.
4
+
5
+
## Fork this repo
6
+
7
+
You should create a fork of this project in your account and work from there. You can create a fork by clicking the fork button in GitHub.
8
+
9
+
## One feature, one branch
10
+
11
+
Work for each new feature/issue should occur in its own branch. To create a new branch from the command line:
12
+
```shell
13
+
git checkout -b my-new-feature
14
+
```
15
+
where "my-new-feature" describes what you're working on.
16
+
17
+
## Verify your changes locally
4
18
5
-
## Build
6
19
You can use Maven to build all the modules from the root directory
7
20
8
21
```shell script
9
22
mvn clean install
10
23
```
11
24
12
-
Or you can navigate to each module to build them
25
+
Or you can navigate to each module to build them individually
13
26
14
-
## Testing
27
+
## Add tests for any bug fixes or new functionality
15
28
16
29
### Unit Tests
17
30
@@ -23,10 +36,10 @@ To run tests use Maven
23
36
mvn verify
24
37
```
25
38
26
-
You can also view the code coverage reports published to Codecov. Links in the README
39
+
You can also view the code coverage reports published to Codecov. This validates that our coverage levels are maintained. Links are in the README.
27
40
28
41
### Linting
29
-
We are also [ktlint](https://ktlint.github.io/) and [detekt](https://arturbosch.github.io/detekt/) for code style checking and linting. These can be run wiht the following Maven commands
42
+
We are also [ktlint](https://ktlint.github.io/) and [detekt](https://arturbosch.github.io/detekt/) for code style checking and linting. These can be run with the following Maven commands
30
43
31
44
**Note**:
32
45
These will be run as part of the `validate` phase of a full build but if you want to run them manually you will have to navigate to each module directory and run the command
@@ -38,6 +51,16 @@ mvn antrun:run@ktlint
38
51
mvn antrun:run@detekt
39
52
```
40
53
41
-
## License
54
+
## Add documentation for new or updated functionality
55
+
56
+
Please add appropiate javadocs in the source code and ask the maintainers to update the wiki with any relevant information.
57
+
58
+
59
+
## Merging your contribution
60
+
61
+
Create a new pull request and your code will be reviewed by the maintainers. They will confirm at least the following:
62
+
63
+
- Tests run successfully (unit, coverage, integration, style)
64
+
- Contribution policy has been followed
42
65
43
-
See [LICENSE](LICENSE)
66
+
A maintainer will need to sign off on your pull request before it can be merged.
Copy file name to clipboardExpand all lines: README.md
+47-1Lines changed: 47 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,45 @@ GraphQL Kotlin consists of number of libraries that aim to simplify GraphQL inte
12
12
*[graphql-kotlin-federation](/graphql-kotlin-federation) - Schema generator extension to build federated GraphQL schemas
13
13
*[examples](/examples) - Example apps that use graphql-kotlin libraries to test and demonstrate usages
14
14
15
+
## ⌨️ Usage
16
+
17
+
Below is a basic example of how `graphql-kotlin-schema-generator` converts your Kotlin code into a GraphQL schema. For more details, see our documentation below or in the individual module READMEs
18
+
19
+
```kotlin
20
+
// Your existing Kotlin code
21
+
22
+
data classWidget(valid:Int, valvalue:String)
23
+
24
+
classWidgetService {
25
+
funwidgetById(id:Int): Widget? {
26
+
// grabs widget from a data source, might return null
27
+
}
28
+
}
29
+
30
+
// Generate the schema
31
+
32
+
val config =SchemaGeneratorConfig(supportedPackages =listOf("org.example"))
33
+
val queries =listOf(TopLevelObject(WidgetService()))
34
+
35
+
toSchema(config, queries)
36
+
```
37
+
38
+
will generate
39
+
40
+
```graphql
41
+
typeQuery {
42
+
widgetById(id: Int!): Widget
43
+
}
44
+
45
+
typeWidget {
46
+
id: Int!
47
+
value: String!
48
+
}
49
+
```
50
+
15
51
## 📋 Documentation
16
52
17
-
Examples and documentation are available on our [Uncyclo](https://github.com/ExpediaGroup/graphql-kotlin/wiki) or in each module.
0 commit comments