Skip to content

Commit

Permalink
Move GraphQL handler to its own module
Browse files Browse the repository at this point in the history
  • Loading branch information
tsegismont committed Mar 5, 2019
1 parent aa4a4a0 commit fba82d5
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 7 deletions.
1 change: 1 addition & 0 deletions pom.xml
Expand Up @@ -70,6 +70,7 @@
<module>vertx-template-engines</module>
<module>vertx-web-api-contract</module>
<module>vertx-web-api-service</module>
<module>vertx-web-graphql</module>
</modules>

<profiles>
Expand Down
55 changes: 55 additions & 0 deletions vertx-web-graphql/pom.xml
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2019 Red Hat, Inc.
~
~ Red Hat licenses this file to you under the Apache License, version 2.0
~ (the "License"); you may not use this file except in compliance with the
~ License. You may obtain a copy of the License at:
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
~ License for the specific language governing permissions and limitations
~ under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.vertx</groupId>
<artifactId>vertx-web-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>

<artifactId>vertx-web-graphql</artifactId>

<properties>
<doc.skip>false</doc.skip>
</properties>

<dependencies>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java</artifactId>
<version>11.0</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>

</project>
3 changes: 3 additions & 0 deletions vertx-web-graphql/src/main/asciidoc/index.adoc
@@ -0,0 +1,3 @@
= Vert.x Web GraphQL

TODO
24 changes: 24 additions & 0 deletions vertx-web-graphql/src/main/java/examples/GraphQLExamples.java
@@ -0,0 +1,24 @@
/*
* Copyright 2019 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

package examples;

/**
* @author Thomas SEGISMONT
*/
public class GraphQLExamples {
}

23 changes: 23 additions & 0 deletions vertx-web-graphql/src/main/java/examples/package-info.java
@@ -0,0 +1,23 @@
/*
* Copyright 2019 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

/**
* @author Thomas Segismont
*/
@Source
package examples;

import io.vertx.docgen.Source;
@@ -0,0 +1,20 @@
/*
* Copyright 2019 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

@ModuleGen(name = "vertx-web-graphql", groupPackage = "io.vertx")
package io.vertx.ext.web.handler.graphql;

import io.vertx.codegen.annotations.ModuleGen;
Expand Up @@ -264,7 +264,7 @@ GraphQLRequestOptions setContentType(String contentType) {
}

private GraphQL graphQL() {
String schema = vertx.fileSystem().readFileBlocking("io/vertx/ext/web/handler/graphql/schema.graphqls").toString();
String schema = vertx.fileSystem().readFileBlocking("schema.graphqls").toString();

SchemaParser schemaParser = new SchemaParser();
TypeDefinitionRegistry typeDefinitionRegistry = schemaParser.parse(schema);
Expand Down
7 changes: 1 addition & 6 deletions vertx-web/pom.xml
Expand Up @@ -61,12 +61,7 @@
<artifactId>vertx-auth-htdigest</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java</artifactId>
<version>11.0</version>
<optional>true</optional>
</dependency>

<!-- Testing -->
<dependency>
<groupId>io.vertx</groupId>
Expand Down

0 comments on commit fba82d5

Please sign in to comment.