Skip to content

Commit

Permalink
Fixed maven pom files, bumped version to 0.9.1 (issue #1)
Browse files Browse the repository at this point in the history
  • Loading branch information
aschrijver committed Jul 25, 2016
1 parent 0452ff8 commit 477ea38
Show file tree
Hide file tree
Showing 68 changed files with 43 additions and 31 deletions.
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ With GraphQL and this project you get an additional `graphql-service` discovery

### Using with Gradle

Publishers of a GraphQL schema need to add a dependency on `vertx-graphql-publisher`:
Publishers of a GraphQL schema need to add a dependency on `vertx-graphql-service-publisher`:
```
repositories {
maven {
Expand All @@ -116,10 +116,10 @@ repositories {
}
dependencies {
compile 'io.engagingspaces:vertx-graphql-publisher:0.9.0'
compile 'io.engagingspaces:vertx-graphql-service-publisher:0.9.1'
}
```
Consumers of a published GraphQL service that want to execute queries need a dependency on `vertx-graphql-consumer`:
Consumers of a published GraphQL service that want to execute queries need a dependency on `vertx-graphql-service-consumer`:
```
repositories {
maven {
Expand All @@ -128,7 +128,7 @@ repositories {
}
dependencies {
compile 'io.engagingspaces:vertx-graphql-consumer:0.9.0'
compile 'io.engagingspaces:vertx-graphql-service-consumer:0.9.1'
}
```
### Using with Maven
Expand Down Expand Up @@ -172,22 +172,22 @@ In order to resolve the Bintray dependencies the following repository settings c
</activeProfiles>
</settings>
```
Or you can add the repository defintion directly in your `pom.xml`.
Or you can add the repository definition directly in your `pom.xml`.

When using Maven a publisher of a GraphQL schema needs to add the following dependency to the `pom.xml`:
```
<dependency>
<groupId>io.engagingspaces</groupId>
<artifactId>graphql-publisher</artifactId>
<version>0.9.0</version>
<artifactId>vertx-graphql-service-publisher</artifactId>
<version>0.9.1</version>
</dependency>
```
And consumers of a GraphQL service need to add the `vertx-graphql-consumer` dependency to their `pom.xml`:
And consumers of a GraphQL service need to add the `vertx-graphql-service-consumer` dependency to their `pom.xml`:
```
<dependency>
<groupId>io.engagingspaces</groupId>
<artifactId>graphql-publisher</artifactId>
<version>0.9.0</version>
<artifactId>vertx-graphql-service-consumer</artifactId>
<version>0.9.1</version>
</dependency>
```

Expand Down Expand Up @@ -238,7 +238,7 @@ public class DroidsSchema implements SchemaDefinition {

### Using a `SchemaPublisher` implementation

Most convenient and easy to use is publication of GraphQL services using a [`SchemaPublisher`](https://github.com/engagingspaces/vertx-graphql-service-discovery/blob/master/graphql-publisher/src/main/java/io/engagingspaces/servicediscovery/graphql/publisher/SchemaPublisher.java).
Most convenient and easy to use is publication of GraphQL services using a [`SchemaPublisher`](https://github.com/engagingspaces/vertx-graphql-service-discovery/blob/master/graphql-service-publisher/src/main/java/io/engagingspaces/servicediscovery/graphql/publisher/SchemaPublisher.java).

A schema publisher is implemented as an interface so you can attach it to any class without limiting its extensibility (e.g. your verticle can still derive from `AbstractVerticle`). The only requirement is that you provide a valid instance of a `SchemaRegistrar` from the overridden `SchemaPublisher.schemaRegistrar()` method.

Expand Down Expand Up @@ -360,17 +360,22 @@ public class StarWarsClient extends AbstractVerticle implements SchemaConsumer {

@Override
public void schemaDiscoveryEvent(Record record) {
if (record.match(new JsonObject().put("name", "StarWarsQuery").put("status", "UP"))) {
if (record.match(new JsonObject().put("name", "DroidsQuery").put("status", "UP"))) {
String schemaName = record.getName() // same as root query name in GraphQL schema
String graphQLQuery = "foo bar"; // your query here..
String graphQLQuery = "query GetDroidNameR2(\\$id: String!) {\n" +
" droid(id: \\$id) {\n" +
" name\n" +
" }\n" +
"}";
JsonObject expected = new JsonObject();

executeQuery(discoveryName, schemaName, query, null, rh -> {
if (rh.succeeded()) {
QueryResult result = rh.result();
if (result.isSucceeded()) {
JsonObject queryData = result.getData();
// Do something interesting with your data..
// Returns: {"droid":{"name": "R2-D2"}}
// Now do something interesting with your data..
} else {
List<QueryError> errors = result.getErrors();
LOG.error("Failed to execute GraphQL query with " + errors.size() + " parse errors);
Expand Down
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ subprojects {
}

group = 'io.engagingspaces'
version = '0.9.0'
version = '0.9.1'

sourceCompatibility = 1.8
archivesBaseName = "vertx-$name-$rootProject.version"
// archivesBaseName = "vertx-$name"
}

task wrapper(type: Wrapper) {
Expand Down
2 changes: 1 addition & 1 deletion examples/droids-microservice/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dependencies {
compile project(':graphql-publisher')
compile project(':graphql-service-publisher')
compile "io.vertx:vertx-core:$vertxVersion"
}
2 changes: 1 addition & 1 deletion examples/starwars-client/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dependencies {
compile project(':graphql-consumer')
compile project(':graphql-service-consumer')
compile "io.vertx:vertx-core:$vertxVersion"
compile "junit:junit:$junitVersion"
}
2 changes: 1 addition & 1 deletion examples/starwars-microservice/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dependencies {
compile project(':graphql-publisher')
compile project(':graphql-service-publisher')
compile "io.vertx:vertx-core:$vertxVersion"
}
7 changes: 5 additions & 2 deletions gradle/publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ artifacts {
publishing {
publications {
maven(MavenPublication) {
artifactId project.name
artifactId "vertx-$archivesBaseName"
from components.java

artifact sourcesJar {
Expand All @@ -31,7 +31,7 @@ publishing {
pom.withXml {
asNode().children().last() + {
def builder = delegate
builder.name project.name
builder.name projectTitle
builder.description projectDescription
builder.url 'https://github.com/engagingspaces/vertx-graphql-service-discovery'
builder.licenses {
Expand All @@ -50,6 +50,9 @@ publishing {
builder.developer {
builder.id 'aschrijver'
builder.name 'Arnold Schrijver'
builder.url 'https://github.com/aschrijver/'
builder.organization 'engagingspaces'
builder.organizationUrl 'https://github.com/engagingspaces/'
}
}
}
Expand Down
1 change: 0 additions & 1 deletion graphql-consumer/gradle.properties

This file was deleted.

1 change: 0 additions & 1 deletion graphql-core/gradle.properties

This file was deleted.

1 change: 0 additions & 1 deletion graphql-publisher/gradle.properties

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ apply from: "$rootProject.projectDir/gradle/coverage.gradle"
apply from: "$rootProject.projectDir/gradle/publishing.gradle"

dependencies {
compile project(':graphql-core')
compile project(':graphql-servicediscovery-core')

testCompile "junit:junit:$junitVersion"
testCompile "io.vertx:vertx-unit:$vertxVersion"

testCompile project(path: ':graphql-publisher')
testCompile project(path: ':graphql-publisher', configuration: 'testOutput')
testCompile project(path: ':graphql-service-publisher')
testCompile project(path: ':graphql-service-publisher', configuration: 'testOutput')
}
2 changes: 2 additions & 0 deletions graphql-service-consumer/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
projectTitle = Vert.x GraphQL Service Consumer
projectDescription = Service discovery and querying of GraphQL schema's in Vert.x-based microservices environments
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply from: "$rootProject.projectDir/gradle/coverage.gradle"
apply from: "$rootProject.projectDir/gradle/publishing.gradle"

dependencies {
compile project(':graphql-core')
compile project(':graphql-servicediscovery-core')
compile "io.vertx:vertx-core:$vertxVersion"
compile "io.vertx:vertx-service-discovery:$vertxVersion"
compile "com.graphql-java:graphql-java:$graphqlVersion"
Expand Down
2 changes: 2 additions & 0 deletions graphql-service-publisher/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
projectTitle = Vert.x GraphQL Service Publisher
projectDescription = Publishing and service discovery of GraphQL schema's in Vert.x-based microservices environments
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ dependencies {
compile "io.vertx:vertx-service-proxy:$vertxVersion"
compile "io.vertx:vertx-service-discovery:$vertxVersion"

testCompile project(path: ':graphql-publisher')
testCompile project(path: ':graphql-publisher', configuration: 'testOutput')
testCompile project(path: ':graphql-service-publisher')
testCompile project(path: ':graphql-service-publisher', configuration: 'testOutput')

testCompile "junit:junit:$junitVersion"
testCompile "io.vertx:vertx-unit:$vertxVersion"
Expand Down
2 changes: 2 additions & 0 deletions graphql-servicediscovery-core/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
projectTitle = Vert.x GraphQL Service Discovery Core
projectDescription = Base classes for GraphQL schema publishers and consumers in Vert.x microservices environments
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rootProject.name='vertx-graphql-service-discovery'

include 'graphql-core', 'graphql-publisher', 'graphql-consumer',
include 'graphql-servicediscovery-core', 'graphql-service-publisher', 'graphql-service-consumer',
':examples:droids-microservice', ':examples:starwars-microservice', ':examples:starwars-client'

0 comments on commit 477ea38

Please sign in to comment.