Skip to content

Commit d9273a7

Browse files
dariuszkucsmyrick
authored and
smyrick
committed
update library structure (ExpediaGroup#255)
* update library structure Changes to a multi module project with `graphql-kotlin-schema-generator` (previously released as `graphql-kotlin`) and `graphql-kotlin-spring-example` (previously standalone project). * fix travis build * update README to reflect new structure * skip generating javadoc for example app
1 parent 0752ae9 commit d9273a7

File tree

7,194 files changed

+592553
-438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

7,194 files changed

+592553
-438
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ before_install:
1515

1616
script:
1717
- ./mvnw install
18-
- ./mvnw -f example/pom.xml verify
1918

2019
deploy:
2120
provider: script

.travis/update-version.sh

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,11 @@ setup_git() {
88
}
99

1010
update_version() {
11-
12-
exampleProperty="graphql-kotlin.version"
13-
1411
# Push the new tag with `-SNAPSHOT` as the current version
1512
mvn --settings .travis/settings.xml org.codehaus.mojo:versions-maven-plugin:2.7:set -DnewVersion="${TRAVIS_TAG}-SNAPSHOT"
1613

1714
# Increment the patch version
1815
mvn --settings .travis/settings.xml org.codehaus.mojo:versions-maven-plugin:2.7:set -DnextSnapshot=true
19-
20-
# Pull the value from the pom
21-
NEW_VERSION=$(mvn --settings .travis/settings.xml help:evaluate -Dexpression=project.version -q -DforceStdout)
22-
23-
# Update the example version
24-
cd example/
25-
mvn --settings ../.travis/settings.xml org.codehaus.mojo:versions-maven-plugin:2.7:set-property -Dproperty=${exampleProperty} -DnewVersion=${NEW_VERSION}
26-
cd ../
2716
}
2817

2918
commit_files() {
@@ -32,7 +21,7 @@ commit_files() {
3221
git checkout -b ${NEW_VERSION}
3322

3423
# Stage the modified files
35-
git add pom.xml example/pom.xml
24+
git add pom.xml */pom.xml
3625

3726
# Create a new commit with a custom build message and Travis build number for reference
3827
git commit -m "build: $NEW_VERSION (Travis Build $TRAVIS_BUILD_NUMBER)"

README.md

Lines changed: 5 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -6,93 +6,16 @@
66
[![Javadocs](https://img.shields.io/maven-central/v/com.expedia/graphql-kotlin.svg?label=javadoc&colorB=brightgreen)](https://www.javadoc.io/doc/com.expedia/graphql-kotlin)
77
[![Awesome Kotlin Badge](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin)
88

9-
Most GraphQL libraries require developers to maintain two sources of truth for their GraphQL API: the schema and the corresponding code (data fetchers or resolvers, and types). Given the similarities between Kotlin and GraphQL, such as the ability to define nullable/non-nullable types, a schema can be generated from Kotlin code without any separate schema specification. `graphql-kotlin` builds upon `graphql-java` to allow code-only, or resolver-first, GraphQL services to be built.
9+
GraphQL Kotlin consists of number of libraries that aim to simplify GraphQL integration for Kotlin applications.
1010

11-
For information on GraphQL, please visit [the GraphQL website](https://graphql.org/).
11+
## Modules
1212

13-
For information on `graphql-java`, please visit [GraphQL Java](https://www.graphql-java.com/documentation/latest/).
14-
15-
## Installation
16-
17-
Using a JVM dependency manager, simply link `graphql-kotlin` to your project.
18-
19-
With Maven:
20-
21-
```xml
22-
<dependency>
23-
<groupId>com.expedia</groupId>
24-
<artifactId>graphql-kotlin</artifactId>
25-
<version>${latestVersion}</version>
26-
</dependency>
27-
```
28-
29-
With Gradle:
30-
31-
```groovy
32-
compile(group: 'com.expedia', name: 'graphql-kotlin', version: "$latestVersion")
33-
```
34-
35-
## Usage
36-
37-
38-
```kotlin
39-
// Your existing Kotlin code
40-
41-
data class Widget(val id: Int, val value: String)
42-
43-
class WidgetService {
44-
fun widgetById(id: Int): Widget? {
45-
// grabs widget from a data source, might return null
46-
}
47-
48-
@Deprecated("Use widgetById")
49-
fun widgetByValue(value: String): Widget? {
50-
// grabs widget from a deprecated data source, might return null
51-
}
52-
}
53-
54-
class WidgetUpdater {
55-
fun saveWidget(value: String): Widget {
56-
// Create and save a new widget, returns non-null
57-
}
58-
}
59-
60-
// Generate the schema
61-
62-
val config = SchemaGeneratorConfig(supportedPackages = listOf("org.example"))
63-
val queries = listOf(TopLevelObject(WidgetService()))
64-
val mutations = listOf(TopLevelObject(WidgetUpdater()))
65-
66-
toSchema(config, queries, mutations)
67-
```
68-
69-
will generate
70-
71-
```graphql
72-
schema {
73-
query: Query
74-
mutation: Mutation
75-
}
76-
77-
type Query {
78-
widgetById(id: Int!): Widget
79-
80-
widgetByValue(vale: String!): Widget @deprecated(reason: "Use widgetById")
81-
}
82-
83-
type Mutation {
84-
saveWidget(value: String!): Widget!
85-
}
86-
87-
type Widget {
88-
id: Int!
89-
value: String!
90-
}
91-
```
13+
* [graphql-kotlin-schema-generator](graphql-kotlin-schema-generator/README.md) - code only GraphQL schema generation for Kotlin
14+
* [graphql-kotlin-spring-example](graphql-kotlin-spring-example/README.md) - example SpringBoot app that uses GraphQL Kotlin schema generator
9215

9316
## Documentation
9417

95-
There are more examples and documention in our [Uncyclo](https://github.com/ExpediaDotCom/graphql-kotlin/wiki) or you can view the [javadocs](https://www.javadoc.io/doc/com.expedia/graphql-kotlin) for all published versions.
18+
Examples and documentation is available on our [Uncyclo](https://github.com/ExpediaDotCom/graphql-kotlin/wiki) or you can view the [javadocs](https://www.javadoc.io/doc/com.expedia/graphql-kotlin) for all published versions.
9619

9720
If you have a question about something you can not find in our wiki or javadocs, feel free to [create an issue](https://github.com/ExpediaDotCom/graphql-kotlin/issues) and tag it with the question label.
9821

example/pom.xml

Lines changed: 0 additions & 139 deletions
This file was deleted.

examples/federation/gateway/node_modules/.bin/atob

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/federation/gateway/node_modules/.bin/detect-libc

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/federation/gateway/node_modules/.bin/is-ci

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/federation/gateway/node_modules/.bin/mime

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/federation/gateway/node_modules/.bin/mkdirp

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/federation/gateway/node_modules/.bin/needle

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/federation/gateway/node_modules/.bin/node-pre-gyp

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/federation/gateway/node_modules/.bin/nodemon

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/federation/gateway/node_modules/.bin/nodetouch

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/federation/gateway/node_modules/.bin/nopt

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/federation/gateway/node_modules/.bin/pbjs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/federation/gateway/node_modules/.bin/pbts

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/federation/gateway/node_modules/.bin/rc

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/federation/gateway/node_modules/.bin/rimraf

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/federation/gateway/node_modules/.bin/semver

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/federation/gateway/node_modules/.bin/sha.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/federation/gateway/node_modules/.bin/uuid

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/federation/gateway/node_modules/.bin/which

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)