From f0ff62fcddb1df05edf9ff7fabe62477f7415a55 Mon Sep 17 00:00:00 2001 From: Matthew Grossman Date: Thu, 18 Oct 2018 16:33:50 -0700 Subject: [PATCH 01/82] fix for issue #2: Character to be escaped is missing error on windows --- .../graphql/client/maven/plugin/GraphQLClientMojo.kt | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/coxautodev/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/coxautodev/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index 4fbfac4..597d208 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/coxautodev/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/coxautodev/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -81,7 +81,7 @@ class GraphQLClientMojo: AbstractMojo() { .getResources(Pattern.compile(".*")) nodeModuleResources.map { "/$it" }.forEach { resource -> - val path = resource.replaceFirst("/node_modules/", "").replace(Regex("/"), File.separator) + val path = resource.replaceFirst("/node_modules/", "").replace("/", File.separator) val diskPath = File(nodeModules, path) diskPath.parentFile.mkdirs() FileUtils.copyURLToFile(javaClass.getResource(resource), diskPath) @@ -107,18 +107,10 @@ class GraphQLClientMojo: AbstractMojo() { src.copyTo(dest, overwrite = true) } - // https://stackoverflow.com/a/25080297 - // https://stackoverflow.com/questions/32827329/how-to-get-the-full-path-of-an-executable-in-java-if-launched-from-windows-envi - val node = System.getenv("PATH")?.split(File.pathSeparator)?.map { File(it, "node") }?.find { - it.isFile && it.canExecute() - } ?: throw IllegalStateException("No 'node' executable found on PATH!") - - log.info("Found node executable: ${node.absolutePath}") - val arguments = listOf("generate", *queries.map { File(baseTargetDir, it.path).absolutePath }.toTypedArray(), "--target", "json", "--schema", introspectionFile.absolutePath, "--output", schema.absolutePath) log.info("Running apollo cli (${apolloCli.absolutePath}) with arguments: ${arguments.joinToString(" ")}") - val proc = ProcessBuilder(node.absolutePath, apolloCli.absolutePath, *arguments.toTypedArray()) + val proc = ProcessBuilder("node", apolloCli.absolutePath, *arguments.toTypedArray()) .directory(nodeModules.parentFile) .inheritIO() .start() From a4609e337eeef2a1d21a3a3c61c5d83722a2558c Mon Sep 17 00:00:00 2001 From: William Yu Date: Thu, 19 Apr 2018 17:19:51 -0400 Subject: [PATCH 02/82] Add support for custom mapping types. --- README.md | 12 ++++++++++ apollo-client-maven-plugin-tests/pom.xml | 3 +++ .../src/main/graphql/queries/GetBooks.graphql | 1 + .../src/main/graphql/schema.json | 24 +++++++++++++++++++ .../src/main/resources/schema.graphqls | 1 + .../client/tests/IntegrationSpec.groovy | 22 +++++++++++++++-- .../java/graphql/client/tests/Query.groovy | 13 ++++++---- .../client/maven/plugin/GraphQLClientMojo.kt | 6 ++++- 8 files changed, 75 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e6da560..c4906b9 100644 --- a/README.md +++ b/README.md @@ -50,9 +50,21 @@ All plugin options and their defaults: com.example.graphql.client ${project.basedir}/src/main/graphql/schema.json true + ``` +#### Custom Types +To use the [Custom Scalar Types](https://github.com/apollographql/apollo-android#custom-scalar-types) you need to +define mapping configuration then register your custom adapter: +```xml + + ... + + java.lang.Long + + +``` ### Using the Client Assuming a file named `src/main/graphql/GetBooks.graphql` is defined that contains a query named `GetBooks` against the given `schema.json`, the following code demonstrates how that query could be executed. diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index fcfe29f..b31549d 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -72,6 +72,9 @@ com.coxautodev.java.graphql.client.tests + + java.lang.Long + diff --git a/apollo-client-maven-plugin-tests/src/main/graphql/queries/GetBooks.graphql b/apollo-client-maven-plugin-tests/src/main/graphql/queries/GetBooks.graphql index e5b9a76..9217280 100644 --- a/apollo-client-maven-plugin-tests/src/main/graphql/queries/GetBooks.graphql +++ b/apollo-client-maven-plugin-tests/src/main/graphql/queries/GetBooks.graphql @@ -1,5 +1,6 @@ query GetBooks { books { + id title author { name diff --git a/apollo-client-maven-plugin-tests/src/main/graphql/schema.json b/apollo-client-maven-plugin-tests/src/main/graphql/schema.json index 6f687b4..1fd86bc 100644 --- a/apollo-client-maven-plugin-tests/src/main/graphql/schema.json +++ b/apollo-client-maven-plugin-tests/src/main/graphql/schema.json @@ -92,6 +92,21 @@ }, "isDeprecated" : false, "deprecationReason" : null + }, { + "name" : "id", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "Long", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null } ], "inputFields" : null, "interfaces" : [ ], @@ -106,6 +121,15 @@ "interfaces" : null, "enumValues" : null, "possibleTypes" : null + }, { + "kind" : "SCALAR", + "name" : "Long", + "description" : "Long type", + "fields" : null, + "inputFields" : null, + "interfaces" : null, + "enumValues" : null, + "possibleTypes" : null }, { "kind" : "OBJECT", "name" : "Author", diff --git a/apollo-client-maven-plugin-tests/src/main/resources/schema.graphqls b/apollo-client-maven-plugin-tests/src/main/resources/schema.graphqls index 81b6aca..46ec560 100644 --- a/apollo-client-maven-plugin-tests/src/main/resources/schema.graphqls +++ b/apollo-client-maven-plugin-tests/src/main/resources/schema.graphqls @@ -6,6 +6,7 @@ type Query { type Book { title: String! author: Author! + id: Long! } type Author { diff --git a/apollo-client-maven-plugin-tests/src/test/groovy/com/coxautodev/java/graphql/client/tests/IntegrationSpec.groovy b/apollo-client-maven-plugin-tests/src/test/groovy/com/coxautodev/java/graphql/client/tests/IntegrationSpec.groovy index fded993..6ed4c1c 100644 --- a/apollo-client-maven-plugin-tests/src/test/groovy/com/coxautodev/java/graphql/client/tests/IntegrationSpec.groovy +++ b/apollo-client-maven-plugin-tests/src/test/groovy/com/coxautodev/java/graphql/client/tests/IntegrationSpec.groovy @@ -1,9 +1,11 @@ package com.coxautodev.java.graphql.client.tests import com.apollographql.apollo.ApolloClient +import com.apollographql.apollo.CustomTypeAdapter import com.coxautodev.graphql.tools.SchemaParser import com.coxautodev.java.graphql.client.tests.queries.GetBooksQuery import com.coxautodev.java.graphql.client.tests.queries.author.GetAuthorsQuery +import com.coxautodev.java.graphql.client.tests.type.CustomType import com.fasterxml.jackson.databind.ObjectMapper import graphql.execution.SimpleExecutionStrategy import graphql.servlet.GraphQLServlet @@ -61,8 +63,21 @@ class IntegrationSpec extends Specification { server.start() port = ((InetSocketAddress) server.getListenerInfo().get(0).getAddress()).getPort() + CustomTypeAdapter longCustomTypeAdapter = new CustomTypeAdapter() { + @Override + Long decode(final String value) { + return Long.valueOf(value) + } + + @Override + String encode(final Long value) { + return String.valueOf(value) + } + } + client = ApolloClient.builder() .serverUrl("http://127.0.0.1:$port/graphql") + .addCustomTypeAdapter(CustomType.LONG, longCustomTypeAdapter) .okHttpClient(new OkHttpClient()) .build() } @@ -91,8 +106,11 @@ class IntegrationSpec extends Specification { } def "generated book query returns data"() { - expect: - client.newCall(new GetBooksQuery()).execute().data().get().books().size() == 4 + when: + def books = client.newCall(new GetBooksQuery()).execute().data().get().books() + then: + books.size() == 4 + books.each { b -> assert b.id() instanceof Long} } def "generated author query returns data"() { diff --git a/apollo-client-maven-plugin-tests/src/test/groovy/com/coxautodev/java/graphql/client/tests/Query.groovy b/apollo-client-maven-plugin-tests/src/test/groovy/com/coxautodev/java/graphql/client/tests/Query.groovy index 9f9572b..596c77c 100644 --- a/apollo-client-maven-plugin-tests/src/test/groovy/com/coxautodev/java/graphql/client/tests/Query.groovy +++ b/apollo-client-maven-plugin-tests/src/test/groovy/com/coxautodev/java/graphql/client/tests/Query.groovy @@ -16,10 +16,10 @@ class Query implements GraphQLRootResolver { authors.addAll(dickens, twain) books.addAll( - new Book(title: "A Christmas Carol", author: dickens), - new Book(title: "David Copperfield", author: dickens), - new Book(title: "The Adventures of Tom Sawyer", author: twain), - new Book(title: "Adventures of Huckleberry Finn", author: twain), + new Book(title: "A Christmas Carol", author: dickens, id: 1L), + new Book(title: "David Copperfield", author: dickens, id: 2L), + new Book(title: "The Adventures of Tom Sawyer", author: twain, id: 3L), + new Book(title: "Adventures of Huckleberry Finn", author: twain, id: 4L), ) } @@ -34,6 +34,7 @@ class Query implements GraphQLRootResolver { static class Book { private String title private Author author + private Long id String getTitle() { return title @@ -42,6 +43,10 @@ class Query implements GraphQLRootResolver { Author getAuthor() { return author } + + Long getId() { + return id + } } static class Author { diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/coxautodev/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/coxautodev/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index 597d208..0b0ca68 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/coxautodev/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/coxautodev/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -45,12 +45,16 @@ class GraphQLClientMojo: AbstractMojo() { @Parameter(readonly = true, required = true, defaultValue = "\${project}") private var project: MavenProject? = null + @Parameter(property = "customTypeMap") + private var customTypeMap: Map = mapOf() + @Throws(MojoExecutionException::class) override fun execute() { val project = this.project!! val outputDirectory = this.outputDirectory!! val basePackage = this.basePackage!! val introspectionFile = this.introspectionFile!! + val customTypeMap = this.customTypeMap val basePackageDirName = basePackage.replace('.', File.separatorChar) val sourceDirName = joinPath("src", "main", "graphql") @@ -120,7 +124,7 @@ class GraphQLClientMojo: AbstractMojo() { } val compiler = GraphQLCompiler() - compiler.write(GraphQLCompiler.Arguments(schema, outputDirectory, mapOf(), NullableValueType.JAVA_OPTIONAL, true, true)) + compiler.write(GraphQLCompiler.Arguments(schema, outputDirectory, customTypeMap, NullableValueType.JAVA_OPTIONAL, true, true)) if(addSourceRoot == true) { project.addCompileSourceRoot(outputDirectory.absolutePath) From eaeb48ad984be756e951703a8c9944a438fe5f3b Mon Sep 17 00:00:00 2001 From: Aoudia Date: Sat, 26 Jan 2019 10:59:57 +0100 Subject: [PATCH 03/82] build(POM): update package name --- apollo-client-maven-plugin-tests/pom.xml | 2 +- apollo-client-maven-plugin/pom.xml | 2 +- .../java/graphql/client/maven/plugin/GraphQLClientMojo.kt | 2 +- pom.xml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) rename apollo-client-maven-plugin/src/main/kotlin/com/{coxautodev => lahzouz}/java/graphql/client/maven/plugin/GraphQLClientMojo.kt (99%) diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index b31549d..baf8657 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - com.coxautodev + com.lahzouz apollo-client-maven-plugin-parent 1.1.3-SNAPSHOT .. diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 4b399f5..243d3ee 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - com.coxautodev + com.lahzouz apollo-client-maven-plugin-parent 1.1.3-SNAPSHOT .. diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/coxautodev/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt similarity index 99% rename from apollo-client-maven-plugin/src/main/kotlin/com/coxautodev/java/graphql/client/maven/plugin/GraphQLClientMojo.kt rename to apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index 0b0ca68..efb6f30 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/coxautodev/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -1,4 +1,4 @@ -package com.coxautodev.java.graphql.client.maven.plugin +package com.lahzouz.java.graphql.client.maven.plugin import com.apollographql.apollo.compiler.GraphQLCompiler import com.apollographql.apollo.compiler.NullableValueType diff --git a/pom.xml b/pom.xml index c4d0244..5034d14 100644 --- a/pom.xml +++ b/pom.xml @@ -1,14 +1,14 @@ 4.0.0 - com.coxautodev + com.lahzouz apollo-client-maven-plugin-parent 1.1.3-SNAPSHOT pom apollo-client-maven-plugin-parent Parent Pom for Apollo GraphQL Client Maven Plugin - https://github.com/Cox-Automotive/apollo-client-maven-plugin + https://github.com/Sparow199/apollo-client-maven-plugin.git 1.1.2-2 From 79b7cb7ae5154286f769825dd9a2f2ecd41c7a0c Mon Sep 17 00:00:00 2001 From: Aoudia Date: Sat, 26 Jan 2019 12:41:33 +0100 Subject: [PATCH 04/82] build(POM): Update project dependencies Add Maven wrapper. --- .mvn/wrapper/maven-wrapper.jar | Bin 0 -> 48337 bytes .mvn/wrapper/maven-wrapper.properties | 1 + mvnw | 286 ++++++++++++++++++++++++++ mvnw.cmd | 161 +++++++++++++++ pom.xml | 49 +++-- 5 files changed, 476 insertions(+), 21 deletions(-) create mode 100644 .mvn/wrapper/maven-wrapper.jar create mode 100644 .mvn/wrapper/maven-wrapper.properties create mode 100644 mvnw create mode 100644 mvnw.cmd diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..01e67997377a393fd672c7dcde9dccbedf0cb1e9 GIT binary patch literal 48337 zcmbTe1CV9Qwl>;j+wQV$+qSXFw%KK)%eHN!%U!l@+x~l>b1vR}@9y}|TM-#CBjy|< zb7YRpp)Z$$Gzci_H%LgxZ{NNV{%Qa9gZlF*E2<($D=8;N5Asbx8se{Sz5)O13x)rc z5cR(k$_mO!iis+#(8-D=#R@|AF(8UQ`L7dVNSKQ%v^P|1A%aF~Lye$@HcO@sMYOb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eL z{_7t6jMeEr@a+oxyCL^+_}9Qc;i0&Xd%LXp?to*R|26LKHG(m0)*QF4*h;5%YG5<9)c> z1vq!7bIJSv1^27i-mcH!zX>ep3Iw0^{nx<1jOy)N_UoFD8v}x~2mEWapI3m~kMQkR z#&@4FuEGBn`mgtSx6jeY7vUQNf=^}sTZErIEpH!cy|@7Z zU4h_Oxxd2s=f{}$XXy4}%JqTSjRC \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" + # TODO classpath? +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + wget "$jarUrl" -O "$wrapperJarPath" + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + curl -o "$wrapperJarPath" "$jarUrl" + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 0000000..e5cfb0a --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,161 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven2 Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" +FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + echo Found %WRAPPER_JAR% +) else ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" + echo Finished downloading %WRAPPER_JAR% +) +@REM End of extension + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/pom.xml b/pom.xml index 5034d14..d0ba28c 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,8 @@ https://github.com/Sparow199/apollo-client-maven-plugin.git - 1.1.2-2 + 1.3 + 1.3.20 1.8 @@ -27,30 +28,24 @@ org.jetbrains.kotlin kotlin-stdlib - ${kotlin.version} + ${kotlin-library.version} - org.spockframework spock-core - 1.0-groovy-2.4 + 1.2-groovy-2.5 test - - org.codehaus.groovy - groovy-all - 2.4.7 - cglib cglib-nodep - 3.2.4 + 3.2.10 test org.objenesis objenesis - 2.5.1 + 3.0.1 test @@ -62,7 +57,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.8.0 ${java.version} ${java.version} @@ -71,7 +66,7 @@ org.jetbrains.kotlin kotlin-maven-plugin - ${kotlin.version} + ${kotlin-library.version} compile @@ -85,11 +80,11 @@ org.codehaus.gmavenplus gmavenplus-plugin - 1.5 + 1.6.2 - testCompile + compileTests @@ -128,7 +123,7 @@ org.jetbrains.dokka dokka-maven-plugin - 0.9.9 + 0.9.17 package @@ -143,6 +138,14 @@ + + + jcenter + JCenter + https://jcenter.bintray.com/ + + + Andrew Potter @@ -150,6 +153,10 @@ Cox Automotive http://www.coxautoinc.com + + Moncef AOUDIA + mf.aoudia@gmail.com + @@ -160,19 +167,19 @@ bintray - https://api.bintray.com/maven/apottere/maven/apollo-client-maven-plugin + https://api.bintray.com/maven/sparow199/maven/apollo-client-maven-plugin bintray - https://api.bintray.com/maven/apottere/maven/apollo-client-maven-plugin/;publish=1 + https://api.bintray.com/maven/sparow199/maven/apollo-client-maven-plugin/;publish=1 - scm:git:git://github.com/Cox-Automotive/apollo-client-maven-plugin.git - scm:git:git@github.com:Cox-Automotive/apollo-client-maven-plugin.git - http://github.com/Cox-Automotive/apollo-client-maven-plugin + scm:git:git://github.com/Sparow199/apollo-client-maven-plugin.git + scm:git:git@github.com:Sparow199/apollo-client-maven-plugin.git + http://github.com/Sparow199/apollo-client-maven-plugin HEAD \ No newline at end of file From d626c7a5e995ade5019c9734b2dc893e8ddd432a Mon Sep 17 00:00:00 2001 From: Aoudia Date: Sat, 26 Jan 2019 15:10:00 +0100 Subject: [PATCH 05/82] build(*): Update nested project dependencies Update Readme file Update integration tests --- README.md | 6 +- apollo-client-maven-plugin-tests/pom.xml | 22 +++-- .../src/main/graphql/schema.json | 90 +++++++++++++++---- .../client/tests/IntegrationSpec.groovy | 36 +++++--- .../java/graphql/client/tests/Query.groovy | 6 +- apollo-client-maven-plugin/pom.xml | 10 +-- .../client/maven/plugin/GraphQLClientMojo.kt | 2 +- 7 files changed, 121 insertions(+), 51 deletions(-) rename apollo-client-maven-plugin-tests/src/test/groovy/com/{coxautodev => lahzouz}/java/graphql/client/tests/IntegrationSpec.groovy (72%) rename apollo-client-maven-plugin-tests/src/test/groovy/com/{coxautodev => lahzouz}/java/graphql/client/tests/Query.groovy (88%) diff --git a/README.md b/README.md index c4906b9..3e60dc7 100644 --- a/README.md +++ b/README.md @@ -13,15 +13,15 @@ A full usage example can be found in the [test project](https://github.com/Cox-A com.apollographql.apollo apollo-runtime - 0.4.0 + 0.4.1 ``` 2. Add the code generator plugin to your project's build (if codegen is desired): ```xml - com.coxautodev + com.lahzouz apollo-client-maven-plugin - 1.1.0 + 1.1.3 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index baf8657..9e9142e 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -13,30 +13,30 @@ apollo-client-maven-plugin-tests Test for maven plugin - https://github.com/Cox-Automotive/apollo-client-maven-plugin + https://github.com/Sparow199/apollo-client-maven-plugin.git true - 1.4.14.Final + 2.0.17.Final com.apollographql.apollo apollo-runtime - 0.4.0 + 0.4.1 com.graphql-java graphql-java-tools - 2.2.0 + 5.2.4 test com.graphql-java graphql-java-servlet - 3.0.1 + 6.1.3 test @@ -54,7 +54,13 @@ org.springframework spring-test - 4.3.8.RELEASE + 5.1.4.RELEASE + test + + + org.slf4j + slf4j-simple + 1.7.25 test @@ -62,7 +68,7 @@ - com.coxautodev + com.lahzouz apollo-client-maven-plugin 1.1.3-SNAPSHOT @@ -71,7 +77,7 @@ generate - com.coxautodev.java.graphql.client.tests + com.lahzouz.java.graphql.client.tests java.lang.Long diff --git a/apollo-client-maven-plugin-tests/src/main/graphql/schema.json b/apollo-client-maven-plugin-tests/src/main/graphql/schema.json index 1fd86bc..d5fd933 100644 --- a/apollo-client-maven-plugin-tests/src/main/graphql/schema.json +++ b/apollo-client-maven-plugin-tests/src/main/graphql/schema.json @@ -8,10 +8,10 @@ "types" : [ { "kind" : "OBJECT", "name" : "Query", - "description" : null, + "description" : "", "fields" : [ { "name" : "books", - "description" : null, + "description" : "", "args" : [ ], "type" : { "kind" : "NON_NULL", @@ -33,7 +33,7 @@ "deprecationReason" : null }, { "name" : "authors", - "description" : null, + "description" : "", "args" : [ ], "type" : { "kind" : "NON_NULL", @@ -61,10 +61,10 @@ }, { "kind" : "OBJECT", "name" : "Book", - "description" : null, + "description" : "", "fields" : [ { "name" : "title", - "description" : null, + "description" : "", "args" : [ ], "type" : { "kind" : "NON_NULL", @@ -79,7 +79,7 @@ "deprecationReason" : null }, { "name" : "author", - "description" : null, + "description" : "", "args" : [ ], "type" : { "kind" : "NON_NULL", @@ -94,7 +94,7 @@ "deprecationReason" : null }, { "name" : "id", - "description" : null, + "description" : "", "args" : [ ], "type" : { "kind" : "NON_NULL", @@ -133,10 +133,10 @@ }, { "kind" : "OBJECT", "name" : "Author", - "description" : null, + "description" : "", "fields" : [ { "name" : "name", - "description" : null, + "description" : "", "args" : [ ], "type" : { "kind" : "NON_NULL", @@ -834,12 +834,68 @@ "description" : "Indicates the directive is valid on inline fragments.", "isDeprecated" : false, "deprecationReason" : null + }, { + "name" : "SCHEMA", + "description" : "Indicates the directive is valid on a schema SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "SCALAR", + "description" : "Indicates the directive is valid on a scalar SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "OBJECT", + "description" : "Indicates the directive is valid on an object SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "FIELD_DEFINITION", + "description" : "Indicates the directive is valid on a field SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "ARGUMENT_DEFINITION", + "description" : "Indicates the directive is valid on a field argument SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "INTERFACE", + "description" : "Indicates the directive is valid on an interface SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "UNION", + "description" : "Indicates the directive is valid on an union SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "ENUM", + "description" : "Indicates the directive is valid on an enum SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "ENUM_VALUE", + "description" : "Indicates the directive is valid on an enum value SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "INPUT_OBJECT", + "description" : "Indicates the directive is valid on an input object SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "INPUT_FIELD_DEFINITION", + "description" : "Indicates the directive is valid on an input object field SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null } ], "possibleTypes" : null } ], "directives" : [ { "name" : "include", "description" : "Directs the executor to include this field or fragment only when the `if` argument is true", + "locations" : [ "FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT" ], "args" : [ { "name" : "if", "description" : "Included when true.", @@ -853,13 +909,11 @@ } }, "defaultValue" : null - } ], - "onOperation" : false, - "onFragment" : true, - "onField" : true + } ] }, { "name" : "skip", "description" : "Directs the executor to skip this field or fragment when the `if`'argument is true.", + "locations" : [ "FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT" ], "args" : [ { "name" : "if", "description" : "Skipped when true.", @@ -873,10 +927,12 @@ } }, "defaultValue" : null - } ], - "onOperation" : false, - "onFragment" : true, - "onField" : true + } ] + }, { + "name" : "defer", + "description" : "This directive allows results to be deferred during execution", + "locations" : [ "FIELD" ], + "args" : [ ] } ] } } \ No newline at end of file diff --git a/apollo-client-maven-plugin-tests/src/test/groovy/com/coxautodev/java/graphql/client/tests/IntegrationSpec.groovy b/apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/IntegrationSpec.groovy similarity index 72% rename from apollo-client-maven-plugin-tests/src/test/groovy/com/coxautodev/java/graphql/client/tests/IntegrationSpec.groovy rename to apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/IntegrationSpec.groovy index 6ed4c1c..52e6b93 100644 --- a/apollo-client-maven-plugin-tests/src/test/groovy/com/coxautodev/java/graphql/client/tests/IntegrationSpec.groovy +++ b/apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/IntegrationSpec.groovy @@ -1,15 +1,18 @@ -package com.coxautodev.java.graphql.client.tests +package com.lahzouz.java.graphql.client.tests import com.apollographql.apollo.ApolloClient import com.apollographql.apollo.CustomTypeAdapter import com.coxautodev.graphql.tools.SchemaParser -import com.coxautodev.java.graphql.client.tests.queries.GetBooksQuery -import com.coxautodev.java.graphql.client.tests.queries.author.GetAuthorsQuery -import com.coxautodev.java.graphql.client.tests.type.CustomType +import com.lahzouz.java.graphql.client.tests.queries.GetBooksQuery +import com.lahzouz.java.graphql.client.tests.queries.author.GetAuthorsQuery +import com.lahzouz.java.graphql.client.tests.type.CustomType import com.fasterxml.jackson.databind.ObjectMapper -import graphql.execution.SimpleExecutionStrategy -import graphql.servlet.GraphQLServlet -import graphql.servlet.SimpleGraphQLServlet +import graphql.schema.GraphQLSchema +import graphql.schema.idl.RuntimeWiring +import graphql.servlet.DefaultGraphQLSchemaProvider +import graphql.servlet.GraphQLInvocationInputFactory +import graphql.servlet.GraphQLSchemaProvider +import graphql.servlet.SimpleGraphQLHttpServlet import io.undertow.Undertow import io.undertow.servlet.Servlets import io.undertow.servlet.api.DeploymentInfo @@ -38,22 +41,20 @@ class IntegrationSpec extends Specification { ApolloClient client def setupSpec() { - GraphQLServlet servlet = new SimpleGraphQLServlet( - SchemaParser.newParser() + + GraphQLSchema libSchema = SchemaParser.newParser() .file('schema.graphqls') .resolvers(new Query()) - .dataClasses(Query.Book, Query.Author) .build() - .makeExecutableSchema(), + .makeExecutableSchema() - new SimpleExecutionStrategy() - ) + SimpleGraphQLHttpServlet servlet = createServlet(libSchema) DeploymentInfo servletBuilder = Servlets.deployment() .setClassLoader(getClass().getClassLoader()) .setContextPath("/") .setDeploymentName("test") - .addServlets(Servlets.servlet("GraphQLServlet", GraphQLServlet, new ImmediateInstanceFactory(servlet)).addMapping("/graphql/*")) + .addServlets(Servlets.servlet("GraphQLServlet", SimpleGraphQLHttpServlet, new ImmediateInstanceFactory(servlet)).addMapping("/graphql/*")) DeploymentManager manager = Servlets.defaultContainer().addDeployment(servletBuilder) manager.deploy() @@ -117,4 +118,11 @@ class IntegrationSpec extends Specification { expect: client.newCall(new GetAuthorsQuery()).execute().data().get().authors().size() == 2 } + + SimpleGraphQLHttpServlet createServlet(GraphQLSchema schema) { + GraphQLSchemaProvider schemaProvider = new DefaultGraphQLSchemaProvider(schema) + GraphQLInvocationInputFactory invocationInputFactory = GraphQLInvocationInputFactory.newBuilder(schemaProvider).build() + return SimpleGraphQLHttpServlet.newBuilder(invocationInputFactory).build() + } + } diff --git a/apollo-client-maven-plugin-tests/src/test/groovy/com/coxautodev/java/graphql/client/tests/Query.groovy b/apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/Query.groovy similarity index 88% rename from apollo-client-maven-plugin-tests/src/test/groovy/com/coxautodev/java/graphql/client/tests/Query.groovy rename to apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/Query.groovy index 596c77c..b73e828 100644 --- a/apollo-client-maven-plugin-tests/src/test/groovy/com/coxautodev/java/graphql/client/tests/Query.groovy +++ b/apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/Query.groovy @@ -1,11 +1,11 @@ -package com.coxautodev.java.graphql.client.tests +package com.lahzouz.java.graphql.client.tests -import com.coxautodev.graphql.tools.GraphQLRootResolver +import com.coxautodev.graphql.tools.GraphQLQueryResolver /** * @author Andrew Potter */ -class Query implements GraphQLRootResolver { +class Query implements GraphQLQueryResolver { private List books = [] private List authors = [] diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 243d3ee..d019f22 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -13,18 +13,18 @@ apollo-client-maven-plugin Maven plugin for generating graphql clients - https://github.com/Cox-Automotive/apollo-client-maven-plugin + https://github.com/Sparow199/apollo-client-maven-plugin.git org.apache.maven maven-plugin-api - 3.0 + 3.6.0 org.apache.maven.plugin-tools maven-plugin-annotations - 3.4 + 3.6.0 provided @@ -36,13 +36,13 @@ com.apollographql.apollo compiler - 0.4.0 + 0.4.1 commons-io commons-io - 2.5 + 2.6 org.reflections diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index efb6f30..8be151b 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -124,7 +124,7 @@ class GraphQLClientMojo: AbstractMojo() { } val compiler = GraphQLCompiler() - compiler.write(GraphQLCompiler.Arguments(schema, outputDirectory, customTypeMap, NullableValueType.JAVA_OPTIONAL, true, true)) + compiler.write(GraphQLCompiler.Arguments(schema, outputDirectory, customTypeMap, NullableValueType.JAVA_OPTIONAL, generateAccessors = true, useSemanticNaming = true, generateModelBuilder = true)) if(addSourceRoot == true) { project.addCompileSourceRoot(outputDirectory.absolutePath) From af09721746ebcca97d90f09c94e63b707ebbccd5 Mon Sep 17 00:00:00 2001 From: Aoudia Date: Sat, 26 Jan 2019 16:03:56 +0100 Subject: [PATCH 06/82] ci(CircleCi): Add CircleCi configuration Update Readme --- .circleci/config.yml | 20 ++++++++++++++++++++ README.md | 13 +++++++++++-- apollo-client-maven-plugin-tests/pom.xml | 2 ++ apollo-client-maven-plugin/pom.xml | 5 +++++ pom.xml | 2 ++ 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..9912398 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,20 @@ +version: 2 +jobs: + build: + docker: + - image: circleci/openjdk:8-jdk + working_directory: ~/apollo-client-maven-plugin + environment: + MAVEN_OPTS: -Xmx3200m + steps: + - checkout + - restore_cache: + keys: + - v1-dependencies-{{ checksum "pom.xml" }} + - v1-dependencies- + - run: mvn dependency:go-offline + - save_cache: + paths: + - ~/.m2 + key: v1-dependencies-{{ checksum "pom.xml" }} + - run: mvn integration-test \ No newline at end of file diff --git a/README.md b/README.md index 3e60dc7..b272bdc 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Apollo GraphQL Client Code Generation Maven Plugin - +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![CircleCI](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin.svg?style=svg)](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin) ## Usage -A full usage example can be found in the [test project](https://github.com/Cox-Automotive/apollo-client-maven-plugin/tree/master/apollo-client-maven-plugin-tests) +A full usage example can be found in the [test project](https://github.com/sparow199/apollo-client-maven-plugin/tree/master/apollo-client-maven-plugin-tests) ### Getting Started @@ -90,3 +90,12 @@ if(data.isPresent()) { ``` Properties specified as nullable in the schema will have an java 8 `java.util.optional` type. + +# Contributors + +* Andrew Potter => apottere +* William Yu => wiyu +* Moncef AOUDIA => sparow199 +* ryangardner => Ryan Gardner +* Unknown => ddekkers +* Unknown => mgrossmanexp \ No newline at end of file diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 9e9142e..063158a 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -16,6 +16,8 @@ https://github.com/Sparow199/apollo-client-maven-plugin.git + UTF-8 + UTF-8 true 2.0.17.Final diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index d019f22..dd8b3d1 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -11,6 +11,11 @@ apollo-client-maven-plugin maven-plugin + + UTF-8 + UTF-8 + + apollo-client-maven-plugin Maven plugin for generating graphql clients https://github.com/Sparow199/apollo-client-maven-plugin.git diff --git a/pom.xml b/pom.xml index d0ba28c..0cc676e 100644 --- a/pom.xml +++ b/pom.xml @@ -11,6 +11,8 @@ https://github.com/Sparow199/apollo-client-maven-plugin.git + UTF-8 + UTF-8 1.3 1.3.20 1.8 From eb98d34c70eb553115fc7f9a13feef669b47a96f Mon Sep 17 00:00:00 2001 From: Aoudia Date: Sat, 26 Jan 2019 17:57:13 +0100 Subject: [PATCH 07/82] build(Git): Update .gitignore file --- .gitignore | 270 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 268 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 41694bb..50cf6bb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,272 @@ -target/ + +# Created by https://www.gitignore.io/api/node,java,linux,macos,maven,windows,intellij+all +# Edit at https://www.gitignore.io/?templates=node,java,linux,macos,maven,windows,intellij+all + +### Intellij+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/modules.xml +# .idea/*.iml +# .idea/modules + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### Intellij+all Patch ### +# Ignores the whole .idea folder and all .iml files +# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 + .idea/ + +# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 + *.iml +modules.xml +.idea/misc.xml +*.ipr + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Maven ### +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +.mvn/wrapper/maven-wrapper.jar + +### Node ### +# Logs +logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories node_modules/ -node/ \ No newline at end of file +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.gitignore.io/api/node,java,linux,macos,maven,windows,intellij+all \ No newline at end of file From 19973ee01688413ea80d8aec24d0692f9a19bb3f Mon Sep 17 00:00:00 2001 From: Aoudia Date: Sat, 26 Jan 2019 18:08:59 +0100 Subject: [PATCH 08/82] fix(CircleCi): Add NodeJS dependency --- .circleci/config.yml | 25 ++++++++++++++++++++++++- pom.xml | 6 +++--- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9912398..7ebf74f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,6 +8,25 @@ jobs: MAVEN_OPTS: -Xmx3200m steps: - checkout + - run: + name: install node via NVM + command: | + wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash + # Activate nvm + export NVM_DIR=$HOME/.nvm + touch $HOME/.nvmrc + source $NVM_DIR/nvm.sh + # Use node 8.9 + nvm install 8.9 && nvm alias default 8.9 + echo 8.9 > $HOME/.nvmrc + # Enable nvm in following steps + echo 'export NVM_DIR=$HOME/.nvm' >> $BASH_ENV + echo 'source $NVM_DIR/nvm.sh' >> $BASH_ENV + # To fix npm install : "node-pre-gyp: Permission denied" + npm config set user 0 + npm config set unsafe-perm true + node --version + npm --version - restore_cache: keys: - v1-dependencies-{{ checksum "pom.xml" }} @@ -17,4 +36,8 @@ jobs: paths: - ~/.m2 key: v1-dependencies-{{ checksum "pom.xml" }} - - run: mvn integration-test \ No newline at end of file + - run: mvn integration-test + branches: + only: + - master + - develop diff --git a/pom.xml b/pom.xml index 0cc676e..02be9bf 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ apollo-client-maven-plugin-parent Parent Pom for Apollo GraphQL Client Maven Plugin - https://github.com/Sparow199/apollo-client-maven-plugin.git + https://github.com/Sparow199/apollo-client-maven-plugin UTF-8 @@ -179,9 +179,9 @@ - scm:git:git://github.com/Sparow199/apollo-client-maven-plugin.git + scm:git:git@github.com/Sparow199/apollo-client-maven-plugin.git scm:git:git@github.com:Sparow199/apollo-client-maven-plugin.git - http://github.com/Sparow199/apollo-client-maven-plugin + https://github.com/Sparow199/apollo-client-maven-plugin HEAD \ No newline at end of file From a3b5dde2ca1ced7c329cce9321af22da1ce888a8 Mon Sep 17 00:00:00 2001 From: Aoudia Date: Sun, 27 Jan 2019 02:45:18 +0100 Subject: [PATCH 09/82] version(Snapshot): Bump project version to 1.2.0-SNAPSHOT --- README.md | 8 ++++---- apollo-client-maven-plugin-tests/pom.xml | 4 ++-- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 24 +++++++++++++++--------- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index b272bdc..38d0984 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Apollo GraphQL Client Code Generation Maven Plugin -[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![CircleCI](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin.svg?style=svg)](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin) +[![CircleCI](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin.svg?style=svg)](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin) [ ![Download](https://api.bintray.com/packages/sparow199/maven/apollo-client-maven-plugin/images/download.svg) ](https://bintray.com/sparow199/maven/apollo-client-maven-plugin/_latestVersion)[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) ## Usage A full usage example can be found in the [test project](https://github.com/sparow199/apollo-client-maven-plugin/tree/master/apollo-client-maven-plugin-tests) @@ -21,7 +21,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.lahzouz apollo-client-maven-plugin - 1.1.3 + 1.2.0-SNAPSHOT @@ -34,7 +34,7 @@ A full usage example can be found in the [test project](https://github.com/sparo ``` -3. Create a file `src/main/graphql/schema.json` with the JSON results of an [introspection query](https://gist.github.com/craigbeck/b90915d49fda19d5b2b17ead14dcd6da) +3. Create a file `src/main/graphql/schema.json` with the JSON results of an [introspection query](https://gist.github.com/Sparow199/a59527016e16a2d56309d62e01ff2348) 4. Create files for each query you'd like to generate classes for under `src/main/graphql`: 1. Query file names must match the name of the query they contain 2. Query files must end with `.graphql` @@ -96,6 +96,6 @@ Properties specified as nullable in the schema will have an java 8 `java.util.op * Andrew Potter => apottere * William Yu => wiyu * Moncef AOUDIA => sparow199 -* ryangardner => Ryan Gardner +* Ryan Gardner => ryangardner * Unknown => ddekkers * Unknown => mgrossmanexp \ No newline at end of file diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 063158a..27789ed 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -4,7 +4,7 @@ com.lahzouz apollo-client-maven-plugin-parent - 1.1.3-SNAPSHOT + 1.2.0-SNAPSHOT .. @@ -72,7 +72,7 @@ com.lahzouz apollo-client-maven-plugin - 1.1.3-SNAPSHOT + 1.2.0-SNAPSHOT diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index dd8b3d1..4b3ef46 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -4,7 +4,7 @@ com.lahzouz apollo-client-maven-plugin-parent - 1.1.3-SNAPSHOT + 1.2.0-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index 02be9bf..ce45788 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.lahzouz apollo-client-maven-plugin-parent - 1.1.3-SNAPSHOT + 1.2.0-SNAPSHOT pom apollo-client-maven-plugin-parent @@ -19,8 +19,17 @@ true + + Github + + scm:git:https://github.com/Sparow199/apollo-client-maven-plugin.git + scm:git:https://github.com/Sparow199/apollo-client-maven-plugin.git + https://github.com/Sparow199/apollo-client-maven-plugin + HEAD + + apollo-client-maven-plugin apollo-client-maven-plugin-tests @@ -168,20 +177,17 @@ - bintray + bintray-sparow199-maven + sparow199-maven https://api.bintray.com/maven/sparow199/maven/apollo-client-maven-plugin - bintray + bintray-sparow199-maven + sparow199-maven https://api.bintray.com/maven/sparow199/maven/apollo-client-maven-plugin/;publish=1 - - scm:git:git@github.com/Sparow199/apollo-client-maven-plugin.git - scm:git:git@github.com:Sparow199/apollo-client-maven-plugin.git - https://github.com/Sparow199/apollo-client-maven-plugin - HEAD - + \ No newline at end of file From 5035205968b7cb9ac65e73dfc6f5d9c46d7df28e Mon Sep 17 00:00:00 2001 From: Aoudia Date: Sun, 27 Jan 2019 15:34:33 +0100 Subject: [PATCH 10/82] ci(CircleCI): Add deploy job --- .circleci.settings.xml | 46 ++++++++++++++++++++++++++++++++++++++++++ .circleci/config.yml | 45 ++++++++++++++++++++++++++++++++++++----- 2 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 .circleci.settings.xml diff --git a/.circleci.settings.xml b/.circleci.settings.xml new file mode 100644 index 0000000..a0492b4 --- /dev/null +++ b/.circleci.settings.xml @@ -0,0 +1,46 @@ + + + + + + + + + false + + bintray-sparow199-maven + bintray + https://dl.bintray.com/sparow199/maven + + + + + + false + + bintray-sparow199-maven + bintray-plugins + https://dl.bintray.com/sparow199/maven + + + bintray + + + + bintray + + + + bintray-sparow199-maven + ${env.BINTRAY_USERNAME} + ${env.BINTRAY_TOKEN} + + + GitHub + ${env.GITHUB_USERNAME} + ${env.GITHUB_TOKEN} + + + + \ No newline at end of file diff --git a/.circleci/config.yml b/.circleci/config.yml index 7ebf74f..5d791a3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,12 +1,15 @@ version: 2 jobs: build: + machine: true docker: - image: circleci/openjdk:8-jdk - working_directory: ~/apollo-client-maven-plugin + working_directory: /home/circleci/apollo-client-maven-plugin environment: MAVEN_OPTS: -Xmx3200m steps: + - attach_workspace: + at: /home/circleci - checkout - run: name: install node via NVM @@ -37,7 +40,39 @@ jobs: - ~/.m2 key: v1-dependencies-{{ checksum "pom.xml" }} - run: mvn integration-test - branches: - only: - - master - - develop + deploy: + machine: true + working_directory: /home/circleci/apollo-client-maven-plugin + environment: + MAVEN_OPTS: -Xmx3200m + steps: + - attach_workspace: + at: /home/circleci + - restore_cache: + keys: + - v1-dependencies-{{ checksum "pom.xml" }} + - v1-dependencies- + - run: + name: Deploy the artifacts + command: | + mvn -s .circleci.settings.xml -DskipTests deploy -P bintray + +workflows: + version: 2 + build-deploy: + jobs: + - build + branches: + only: + - master + - develop + - deploy: + requires: + - build + filters: + tags: + only: /v.*/ + branches: + only: + - master + From 215c6ec94e364e86fc1b1430d2c9b93923341ec1 Mon Sep 17 00:00:00 2001 From: Aoudia Date: Sun, 27 Jan 2019 15:35:38 +0100 Subject: [PATCH 11/82] build(POM): Bump version to 1.2.0 stable --- .circleci/config.yml | 70 ++++++++++++++++-------- README.md | 2 +- apollo-client-maven-plugin-tests/pom.xml | 4 +- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 5 files changed, 53 insertions(+), 27 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5d791a3..b9638b9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,15 +1,12 @@ version: 2 jobs: build: - machine: true docker: - image: circleci/openjdk:8-jdk - working_directory: /home/circleci/apollo-client-maven-plugin + working_directory: ~/apollo-client-maven-plugin environment: MAVEN_OPTS: -Xmx3200m steps: - - attach_workspace: - at: /home/circleci - checkout - run: name: install node via NVM @@ -34,24 +31,53 @@ jobs: keys: - v1-dependencies-{{ checksum "pom.xml" }} - v1-dependencies- - - run: mvn dependency:go-offline + - run: | + mvn dependency:resolve-plugins + mvn dependency:go-offline || true - save_cache: paths: - ~/.m2 key: v1-dependencies-{{ checksum "pom.xml" }} - - run: mvn integration-test + - run: mvn test integration-test + deploy: - machine: true - working_directory: /home/circleci/apollo-client-maven-plugin + docker: + - image: circleci/openjdk:8-jdk + working_directory: ~/apollo-client-maven-plugin environment: MAVEN_OPTS: -Xmx3200m steps: - - attach_workspace: - at: /home/circleci + - checkout + - run: + name: install node via NVM + command: | + wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash + # Activate nvm + export NVM_DIR=$HOME/.nvm + touch $HOME/.nvmrc + source $NVM_DIR/nvm.sh + # Use node 8.9 + nvm install 8.9 && nvm alias default 8.9 + echo 8.9 > $HOME/.nvmrc + # Enable nvm in following steps + echo 'export NVM_DIR=$HOME/.nvm' >> $BASH_ENV + echo 'source $NVM_DIR/nvm.sh' >> $BASH_ENV + # To fix npm install : "node-pre-gyp: Permission denied" + npm config set user 0 + npm config set unsafe-perm true + node --version + npm --version - restore_cache: keys: - v1-dependencies-{{ checksum "pom.xml" }} - v1-dependencies- + - run: | + mvn dependency:resolve-plugins + mvn dependency:go-offline || true + - save_cache: + paths: + - ~/.m2 + key: v1-dependencies-{{ checksum "pom.xml" }} - run: name: Deploy the artifacts command: | @@ -61,18 +87,18 @@ workflows: version: 2 build-deploy: jobs: - - build - branches: - only: - - master - - develop + - build: + filters: + branches: + only: + - master + - develop - deploy: requires: - build - filters: - tags: - only: /v.*/ - branches: - only: - - master - + filters: + tags: + only: /v.*/ + branches: + only: + - master \ No newline at end of file diff --git a/README.md b/README.md index 38d0984..cba8d01 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.lahzouz apollo-client-maven-plugin - 1.2.0-SNAPSHOT + 1.2.0 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 27789ed..895a1e3 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -4,7 +4,7 @@ com.lahzouz apollo-client-maven-plugin-parent - 1.2.0-SNAPSHOT + 1.2.0 .. @@ -72,7 +72,7 @@ com.lahzouz apollo-client-maven-plugin - 1.2.0-SNAPSHOT + 1.2.0 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 4b3ef46..5cf3f43 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -4,7 +4,7 @@ com.lahzouz apollo-client-maven-plugin-parent - 1.2.0-SNAPSHOT + 1.2.0 .. diff --git a/pom.xml b/pom.xml index ce45788..8b9c3f1 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.lahzouz apollo-client-maven-plugin-parent - 1.2.0-SNAPSHOT + 1.2.0 pom apollo-client-maven-plugin-parent From cbc2a18f3770d9a80ddd9240ed6b84b07449291f Mon Sep 17 00:00:00 2001 From: Aoudia Date: Sun, 27 Jan 2019 16:53:47 +0100 Subject: [PATCH 12/82] version(POM): Bump project version to 1.2.1-SNAPSHOT --- README.md | 2 +- apollo-client-maven-plugin-tests/pom.xml | 4 ++-- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cba8d01..4644293 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.lahzouz apollo-client-maven-plugin - 1.2.0 + 1.2.1-SNAPSHOT diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 895a1e3..9583656 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -4,7 +4,7 @@ com.lahzouz apollo-client-maven-plugin-parent - 1.2.0 + 1.2.1-SNAPSHOT .. @@ -72,7 +72,7 @@ com.lahzouz apollo-client-maven-plugin - 1.2.0 + 1.2.1-SNAPSHOT diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 5cf3f43..847482d 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -4,7 +4,7 @@ com.lahzouz apollo-client-maven-plugin-parent - 1.2.0 + 1.2.1-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index 8b9c3f1..269d376 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.lahzouz apollo-client-maven-plugin-parent - 1.2.0 + 1.2.1-SNAPSHOT pom apollo-client-maven-plugin-parent From d77f4e6d8444cd9f2d574fad5dd37a2047704d63 Mon Sep 17 00:00:00 2001 From: Aoudia Date: Tue, 29 Jan 2019 00:13:48 +0100 Subject: [PATCH 13/82] ci(CircleCi): Add script for installing NodeJS --- .../.circleci.settings.xml | 0 .circleci/config.yml | 38 +++---------------- scripts/install_nodejs.sh | 18 +++++++++ 3 files changed, 23 insertions(+), 33 deletions(-) rename .circleci.settings.xml => .circleci/.circleci.settings.xml (100%) create mode 100644 scripts/install_nodejs.sh diff --git a/.circleci.settings.xml b/.circleci/.circleci.settings.xml similarity index 100% rename from .circleci.settings.xml rename to .circleci/.circleci.settings.xml diff --git a/.circleci/config.yml b/.circleci/config.yml index b9638b9..2d71f22 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,22 +11,8 @@ jobs: - run: name: install node via NVM command: | - wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash - # Activate nvm - export NVM_DIR=$HOME/.nvm - touch $HOME/.nvmrc - source $NVM_DIR/nvm.sh - # Use node 8.9 - nvm install 8.9 && nvm alias default 8.9 - echo 8.9 > $HOME/.nvmrc - # Enable nvm in following steps - echo 'export NVM_DIR=$HOME/.nvm' >> $BASH_ENV - echo 'source $NVM_DIR/nvm.sh' >> $BASH_ENV - # To fix npm install : "node-pre-gyp: Permission denied" - npm config set user 0 - npm config set unsafe-perm true - node --version - npm --version + chmod +x ./scripts/install_nodejs.sh + ./scripts/install_nodejs.sh - restore_cache: keys: - v1-dependencies-{{ checksum "pom.xml" }} @@ -51,22 +37,8 @@ jobs: - run: name: install node via NVM command: | - wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash - # Activate nvm - export NVM_DIR=$HOME/.nvm - touch $HOME/.nvmrc - source $NVM_DIR/nvm.sh - # Use node 8.9 - nvm install 8.9 && nvm alias default 8.9 - echo 8.9 > $HOME/.nvmrc - # Enable nvm in following steps - echo 'export NVM_DIR=$HOME/.nvm' >> $BASH_ENV - echo 'source $NVM_DIR/nvm.sh' >> $BASH_ENV - # To fix npm install : "node-pre-gyp: Permission denied" - npm config set user 0 - npm config set unsafe-perm true - node --version - npm --version + chmod +x ./scripts/install_nodejs.sh + ./scripts/install_nodejs.sh - restore_cache: keys: - v1-dependencies-{{ checksum "pom.xml" }} @@ -81,7 +53,7 @@ jobs: - run: name: Deploy the artifacts command: | - mvn -s .circleci.settings.xml -DskipTests deploy -P bintray + mvn -s ../.circleci.settings.xml -DskipTests deploy -P bintray workflows: version: 2 diff --git a/scripts/install_nodejs.sh b/scripts/install_nodejs.sh new file mode 100644 index 0000000..0e31b6c --- /dev/null +++ b/scripts/install_nodejs.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash +# Activate nvm +export NVM_DIR=$HOME/.nvm +touch $HOME/.nvmrc +source $NVM_DIR/nvm.sh +# Use node 8.9 +nvm install 8.9 && nvm alias default 8.9 +echo 8.9 > $HOME/.nvmrc +# Enable nvm in following steps +echo 'export NVM_DIR=$HOME/.nvm' >> $BASH_ENV +echo 'source $NVM_DIR/nvm.sh' >> $BASH_ENV +# To fix npm install : "node-pre-gyp: Permission denied" +npm config set user 0 +npm config set unsafe-perm true +node --version +npm --version \ No newline at end of file From 1dec98bfbefc97c3a921d17bb8d26bfc4a7f63da Mon Sep 17 00:00:00 2001 From: Aoudia Date: Wed, 30 Jan 2019 22:44:10 +0100 Subject: [PATCH 14/82] version(POM): Update groupId In order to push artifacts to Maven central we changed the groupId --- README.md | 2 +- apollo-client-maven-plugin-tests/pom.xml | 4 ++-- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4644293..150e1d7 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ A full usage example can be found in the [test project](https://github.com/sparo 2. Add the code generator plugin to your project's build (if codegen is desired): ```xml - com.lahzouz + com.github.sparow199 apollo-client-maven-plugin 1.2.1-SNAPSHOT diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 9583656..dad47b8 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - com.lahzouz + com.github.sparow199 apollo-client-maven-plugin-parent 1.2.1-SNAPSHOT .. @@ -70,7 +70,7 @@ - com.lahzouz + com.github.sparow199 apollo-client-maven-plugin 1.2.1-SNAPSHOT diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 847482d..09aef45 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - com.lahzouz + com.github.sparow199 apollo-client-maven-plugin-parent 1.2.1-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index 269d376..db2475a 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,7 @@ 4.0.0 - com.lahzouz + com.github.sparow199 apollo-client-maven-plugin-parent 1.2.1-SNAPSHOT pom From e154643f8b97e138de67bbdf114bba6dce053192 Mon Sep 17 00:00:00 2001 From: Aoudia Date: Wed, 30 Jan 2019 22:56:36 +0100 Subject: [PATCH 15/82] fix(CircleCi): Maven settings path --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2d71f22..a19de30 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,7 +53,7 @@ jobs: - run: name: Deploy the artifacts command: | - mvn -s ../.circleci.settings.xml -DskipTests deploy -P bintray + mvn -s ./.circleci/.circleci.settings.xml -DskipTests deploy -P bintray workflows: version: 2 From a2360e101c444c618d898449c7953477a654668a Mon Sep 17 00:00:00 2001 From: Aoudia Date: Wed, 30 Jan 2019 23:04:18 +0100 Subject: [PATCH 16/82] version:(POM): Bump project version to 1.2.1 --- README.md | 2 +- apollo-client-maven-plugin-tests/pom.xml | 4 ++-- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 150e1d7..62bd10f 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index dad47b8..9264b40 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.1-SNAPSHOT + 1.2.1 .. @@ -72,7 +72,7 @@ com.github.sparow199 apollo-client-maven-plugin - 1.2.1-SNAPSHOT + 1.2.1 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 09aef45..40b6035 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.1-SNAPSHOT + 1.2.1 .. diff --git a/pom.xml b/pom.xml index db2475a..10f4eb7 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.1-SNAPSHOT + 1.2.1 pom apollo-client-maven-plugin-parent From 09d68c63df813f0a405bd363e7bcf2d5b2034a63 Mon Sep 17 00:00:00 2001 From: Aoudia Date: Tue, 5 Feb 2019 02:06:06 +0100 Subject: [PATCH 17/82] build(*): Update apollo dependencies to 1.0.0-alpha5 Add output package name. --- README.md | 5 +++-- apollo-client-maven-plugin-tests/pom.xml | 15 ++++++++++++--- .../client/tests/IntegrationSpec.groovy | 18 +++++++++--------- apollo-client-maven-plugin/pom.xml | 12 +++++++++--- .../client/maven/plugin/GraphQLClientMojo.kt | 7 ++++++- pom.xml | 10 ++++++++-- 6 files changed, 47 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 62bd10f..ed7c31e 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.apollographql.apollo apollo-runtime - 0.4.1 + 1.0.0-alpha5 ``` 2. Add the code generator plugin to your project's build (if codegen is desired): @@ -21,7 +21,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 1.2.1 + 1.2.2-snapshot @@ -48,6 +48,7 @@ All plugin options and their defaults: ${project.build.directory}/generated-sources/graphql-client com.example.graphql.client + com.example.graphql.client ${project.basedir}/src/main/graphql/schema.json true diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 9264b40..a4e05df 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.1 + 1.2.2-snapshot .. @@ -23,10 +23,11 @@ + com.apollographql.apollo apollo-runtime - 0.4.1 + 1.0.0-alpha5 @@ -72,7 +73,7 @@ com.github.sparow199 apollo-client-maven-plugin - 1.2.1 + 1.2.2-snapshot @@ -80,6 +81,7 @@ com.lahzouz.java.graphql.client.tests + com.lahzouz.java.graphql.client.tests java.lang.Long @@ -89,4 +91,11 @@ + + + + jcenter + https://jcenter.bintray.com/ + + \ No newline at end of file diff --git a/apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/IntegrationSpec.groovy b/apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/IntegrationSpec.groovy index 52e6b93..f81429a 100644 --- a/apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/IntegrationSpec.groovy +++ b/apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/IntegrationSpec.groovy @@ -1,14 +1,12 @@ package com.lahzouz.java.graphql.client.tests import com.apollographql.apollo.ApolloClient -import com.apollographql.apollo.CustomTypeAdapter +import com.apollographql.apollo.response.CustomTypeAdapter +import com.apollographql.apollo.response.CustomTypeValue import com.coxautodev.graphql.tools.SchemaParser -import com.lahzouz.java.graphql.client.tests.queries.GetBooksQuery -import com.lahzouz.java.graphql.client.tests.queries.author.GetAuthorsQuery -import com.lahzouz.java.graphql.client.tests.type.CustomType +import com.example.graphql.client.type.CustomType import com.fasterxml.jackson.databind.ObjectMapper import graphql.schema.GraphQLSchema -import graphql.schema.idl.RuntimeWiring import graphql.servlet.DefaultGraphQLSchemaProvider import graphql.servlet.GraphQLInvocationInputFactory import graphql.servlet.GraphQLSchemaProvider @@ -20,6 +18,7 @@ import io.undertow.servlet.api.DeploymentManager import io.undertow.servlet.util.ImmediateInstanceFactory import okhttp3.OkHttpClient import okhttp3.Request +import org.jetbrains.annotations.NotNull import spock.lang.Ignore import spock.lang.Shared import spock.lang.Specification @@ -65,14 +64,15 @@ class IntegrationSpec extends Specification { port = ((InetSocketAddress) server.getListenerInfo().get(0).getAddress()).getPort() CustomTypeAdapter longCustomTypeAdapter = new CustomTypeAdapter() { + @Override - Long decode(final String value) { - return Long.valueOf(value) + Long decode(@NotNull CustomTypeValue value) { + return Long.valueOf(value as String) } @Override - String encode(final Long value) { - return String.valueOf(value) + CustomTypeValue encode(@NotNull Long value) { + return String.valueOf(value) as CustomTypeValue } } diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 40b6035..ade1e47 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.1 + 1.2.2-snapshot .. @@ -40,8 +40,8 @@ com.apollographql.apollo - compiler - 0.4.1 + apollo-compiler + 1.0.0-alpha5 @@ -87,4 +87,10 @@ + + + jcenter + https://jcenter.bintray.com/ + + \ No newline at end of file diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index 8be151b..225621e 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -36,6 +36,9 @@ class GraphQLClientMojo: AbstractMojo() { @Parameter(property = "basePackage", defaultValue = "com.example.graphql.client") private var basePackage: String? = null + @Parameter(property = "outputPackage", defaultValue = "com.example.graphql.client") + private var outputPackage: String? = null + @Parameter(property = "introspectionFile", defaultValue = "\${project.basedir}/src/main/graphql/schema.json") private var introspectionFile: File? = null @@ -53,6 +56,7 @@ class GraphQLClientMojo: AbstractMojo() { val project = this.project!! val outputDirectory = this.outputDirectory!! val basePackage = this.basePackage!! + val outputPackage = this.basePackage!! val introspectionFile = this.introspectionFile!! val customTypeMap = this.customTypeMap @@ -124,7 +128,8 @@ class GraphQLClientMojo: AbstractMojo() { } val compiler = GraphQLCompiler() - compiler.write(GraphQLCompiler.Arguments(schema, outputDirectory, customTypeMap, NullableValueType.JAVA_OPTIONAL, generateAccessors = true, useSemanticNaming = true, generateModelBuilder = true)) + compiler.write(GraphQLCompiler.Arguments(schema, outputDirectory, customTypeMap, NullableValueType.JAVA_OPTIONAL, + useSemanticNaming = true, generateModelBuilder = true, suppressRawTypesWarning = true, useJavaBeansSemanticNaming = true, outputPackageName = outputPackage)) if(addSourceRoot == true) { project.addCompileSourceRoot(outputDirectory.absolutePath) diff --git a/pom.xml b/pom.xml index 10f4eb7..2ce0fb8 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.1 + 1.2.2-snapshot pom apollo-client-maven-plugin-parent @@ -182,7 +182,7 @@ https://api.bintray.com/maven/sparow199/maven/apollo-client-maven-plugin - + bintray-sparow199-maven sparow199-maven @@ -190,4 +190,10 @@ + + + jcenter + https://jcenter.bintray.com/ + + \ No newline at end of file From cfa45ce6a7d3dd62818cff99b40164a38693a861 Mon Sep 17 00:00:00 2001 From: Aoudia Date: Tue, 5 Feb 2019 02:37:02 +0100 Subject: [PATCH 18/82] fix(*): Integration tests fix apollo-codegen version --- .../lahzouz/java/graphql/client/tests/IntegrationSpec.groovy | 1 - apollo-client-maven-plugin/pom.xml | 2 +- .../java/graphql/client/maven/plugin/GraphQLClientMojo.kt | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/IntegrationSpec.groovy b/apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/IntegrationSpec.groovy index f81429a..7398c2a 100644 --- a/apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/IntegrationSpec.groovy +++ b/apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/IntegrationSpec.groovy @@ -4,7 +4,6 @@ import com.apollographql.apollo.ApolloClient import com.apollographql.apollo.response.CustomTypeAdapter import com.apollographql.apollo.response.CustomTypeValue import com.coxautodev.graphql.tools.SchemaParser -import com.example.graphql.client.type.CustomType import com.fasterxml.jackson.databind.ObjectMapper import graphql.schema.GraphQLSchema import graphql.servlet.DefaultGraphQLSchemaProvider diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index ade1e47..a509035 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -81,7 +81,7 @@ ${project.build.directory} install - apollo-codegen + apollo-codegen@0.19.1 diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index 225621e..01a99be 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -128,8 +128,8 @@ class GraphQLClientMojo: AbstractMojo() { } val compiler = GraphQLCompiler() - compiler.write(GraphQLCompiler.Arguments(schema, outputDirectory, customTypeMap, NullableValueType.JAVA_OPTIONAL, - useSemanticNaming = true, generateModelBuilder = true, suppressRawTypesWarning = true, useJavaBeansSemanticNaming = true, outputPackageName = outputPackage)) + compiler.write(GraphQLCompiler.Arguments(irFile = schema, outputDir = outputDirectory, customTypeMap = customTypeMap, nullableValueType = NullableValueType.JAVA_OPTIONAL, + useSemanticNaming = true, generateModelBuilder = true, suppressRawTypesWarning = false, useJavaBeansSemanticNaming = true, outputPackageName = outputPackage)) if(addSourceRoot == true) { project.addCompileSourceRoot(outputDirectory.absolutePath) From f6fa3883d12d8cfb1dd8ba9e1d97a05b039f3a34 Mon Sep 17 00:00:00 2001 From: Aoudia Date: Tue, 5 Feb 2019 02:40:23 +0100 Subject: [PATCH 19/82] version(*): Bump project version to 1.2.2 --- README.md | 2 +- apollo-client-maven-plugin-tests/pom.xml | 4 ++-- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ed7c31e..747a5db 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 1.2.2-snapshot + 1.2.2 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index a4e05df..cc65c67 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.2-snapshot + 1.2.2 .. @@ -73,7 +73,7 @@ com.github.sparow199 apollo-client-maven-plugin - 1.2.2-snapshot + 1.2.2 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index a509035..44c7e7a 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.2-snapshot + 1.2.2 .. diff --git a/pom.xml b/pom.xml index 2ce0fb8..306437a 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.2-snapshot + 1.2.2 pom apollo-client-maven-plugin-parent From 0c1532c38d38f1b6071772e2cc6cd3478460bd79 Mon Sep 17 00:00:00 2001 From: Aoudia Date: Sun, 10 Feb 2019 16:43:09 +0100 Subject: [PATCH 20/82] feat(Plugin): Add full Apollo compiler options --- README.md | 40 +++++++++++++++---- apollo-client-maven-plugin-tests/pom.xml | 11 ++++- apollo-client-maven-plugin/pom.xml | 2 +- .../client/maven/plugin/GraphQLClientMojo.kt | 29 +++++++++++++- pom.xml | 4 +- 5 files changed, 72 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 747a5db..8214fef 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # Apollo GraphQL Client Code Generation Maven Plugin -[![CircleCI](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin.svg?style=svg)](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin) [ ![Download](https://api.bintray.com/packages/sparow199/maven/apollo-client-maven-plugin/images/download.svg) ](https://bintray.com/sparow199/maven/apollo-client-maven-plugin/_latestVersion)[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +[![CircleCI](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin.svg?style=svg)](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin) +[![Download](https://api.bintray.com/packages/sparow199/maven/apollo-client-maven-plugin/images/download.svg) ](https://bintray.com/sparow199/maven/apollo-client-maven-plugin/_latestVersion) +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/71b115f870bb44478dac5d05abc9f378)](https://app.codacy.com/app/Sparow199/apollo-client-maven-plugin?utm_source=github.com&utm_medium=referral&utm_content=Sparow199/apollo-client-maven-plugin&utm_campaign=Badge_Grade_Dashboard) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) ## Usage A full usage example can be found in the [test project](https://github.com/sparow199/apollo-client-maven-plugin/tree/master/apollo-client-maven-plugin-tests) @@ -21,7 +24,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 1.2.2 + 1.2.3-snapshot @@ -51,10 +54,26 @@ All plugin options and their defaults: com.example.graphql.client ${project.basedir}/src/main/graphql/schema.json true + true + true + true + JAVA_OPTIONAL + false ``` +#### Nullable Types +Available nullable types: + +```java + ANNOTATED + APOLLO_OPTIONAL + GUAVA_OPTIONAL + JAVA_OPTIONAL + INPUT_TYPE +``` + #### Custom Types To use the [Custom Scalar Types](https://github.com/apollographql/apollo-android#custom-scalar-types) you need to define mapping configuration then register your custom adapter: @@ -66,6 +85,7 @@ define mapping configuration then register your custom adapter: ``` + ### Using the Client Assuming a file named `src/main/graphql/GetBooks.graphql` is defined that contains a query named `GetBooks` against the given `schema.json`, the following code demonstrates how that query could be executed. @@ -83,11 +103,17 @@ ApolloClient client = ApolloClient.builder() .build()) .build() -Optional data = client.newCall(new GetBooks()).execute().data() - -if(data.isPresent()) { - System.out.println("Book count: " + data.get().books().size()); -} +client.newCall(new GetBooks()) + .enqueue(new ApolloCall.Callback() { + + @Override public void onResponse(@NotNull Response response) { + ... + } + + @Override public void onFailure(@NotNull Throwable t) { + ... + } + }); ``` Properties specified as nullable in the schema will have an java 8 `java.util.optional` type. diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index cc65c67..6615c72 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.2 + 1.2.3-snapshot .. @@ -66,6 +66,7 @@ 1.7.25 test + @@ -73,7 +74,7 @@ com.github.sparow199 apollo-client-maven-plugin - 1.2.2 + 1.2.3-snapshot @@ -82,6 +83,12 @@ com.lahzouz.java.graphql.client.tests com.lahzouz.java.graphql.client.tests + true + true + true + true + JAVA_OPTIONAL + false java.lang.Long diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 44c7e7a..f2ae389 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.2 + 1.2.3-snapshot .. diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index 01a99be..74324bf 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -51,12 +51,33 @@ class GraphQLClientMojo: AbstractMojo() { @Parameter(property = "customTypeMap") private var customTypeMap: Map = mapOf() + @Parameter(property = "nullableValueType") + private var nullableValueType: NullableValueType = NullableValueType.JAVA_OPTIONAL + + @Parameter(property = "useSemanticNaming") + private var useSemanticNaming: Boolean = true + + @Parameter(property = "generateModelBuilder") + private var generateModelBuilder: Boolean = true + + @Parameter(property = "suppressRawTypesWarning") + private var suppressRawTypesWarning: Boolean = false + + @Parameter(property = "useJavaBeansSemanticNaming") + private var useJavaBeansSemanticNaming: Boolean = false + + @Throws(MojoExecutionException::class) override fun execute() { val project = this.project!! val outputDirectory = this.outputDirectory!! val basePackage = this.basePackage!! val outputPackage = this.basePackage!! + val nullableValueType = this.nullableValueType + val useSemanticNaming = this.useSemanticNaming + val generateModelBuilder = this.generateModelBuilder + val suppressRawTypesWarning = this.suppressRawTypesWarning + val useJavaBeansSemanticNaming = this.useJavaBeansSemanticNaming val introspectionFile = this.introspectionFile!! val customTypeMap = this.customTypeMap @@ -128,8 +149,12 @@ class GraphQLClientMojo: AbstractMojo() { } val compiler = GraphQLCompiler() - compiler.write(GraphQLCompiler.Arguments(irFile = schema, outputDir = outputDirectory, customTypeMap = customTypeMap, nullableValueType = NullableValueType.JAVA_OPTIONAL, - useSemanticNaming = true, generateModelBuilder = true, suppressRawTypesWarning = false, useJavaBeansSemanticNaming = true, outputPackageName = outputPackage)) + compiler.write(GraphQLCompiler.Arguments(irFile = schema, outputDir = outputDirectory, + customTypeMap = customTypeMap, nullableValueType = nullableValueType, + useSemanticNaming = useSemanticNaming, generateModelBuilder = generateModelBuilder, + suppressRawTypesWarning = suppressRawTypesWarning, + useJavaBeansSemanticNaming = useJavaBeansSemanticNaming, + outputPackageName = outputPackage)) if(addSourceRoot == true) { project.addCompileSourceRoot(outputDirectory.absolutePath) diff --git a/pom.xml b/pom.xml index 306437a..82c6256 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.2 + 1.2.3-snapshot pom apollo-client-maven-plugin-parent @@ -14,7 +14,7 @@ UTF-8 UTF-8 1.3 - 1.3.20 + 1.3.21 1.8 From 5d66702498646bf4cd5301a628e815aa32cf69d5 Mon Sep 17 00:00:00 2001 From: Aoudia Date: Sun, 24 Feb 2019 20:27:47 +0100 Subject: [PATCH 21/82] refactor(Plugin): Add Kotlin way for holding parameters Add badges to Readme file --- README.md | 4 +- .../client/maven/plugin/GraphQLClientMojo.kt | 105 ++++++++---------- 2 files changed, 51 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index 8214fef..cbb5d22 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![CircleCI](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin.svg?style=svg)](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin) [![Download](https://api.bintray.com/packages/sparow199/maven/apollo-client-maven-plugin/images/download.svg) ](https://bintray.com/sparow199/maven/apollo-client-maven-plugin/_latestVersion) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/71b115f870bb44478dac5d05abc9f378)](https://app.codacy.com/app/Sparow199/apollo-client-maven-plugin?utm_source=github.com&utm_medium=referral&utm_content=Sparow199/apollo-client-maven-plugin&utm_campaign=Badge_Grade_Dashboard) +[![Known Vulnerabilities](https://snyk.io/test/github/sparow199/apollo-client-maven-plugin/badge.svg)](https://snyk.io/test/github/Sparow199/apollo-client-maven-plugin) +[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FSparow199%2Fapollo-client-maven-plugin.svg?type=shield)] [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) ## Usage @@ -110,7 +112,7 @@ client.newCall(new GetBooks()) ... } - @Override public void onFailure(@NotNull Throwable t) { + @Override public void onFailure(@NotNull ApolloException t) { ... } }); diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index 74324bf..2634a61 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -23,79 +23,67 @@ import java.util.stream.Collectors * Generates classes for a graphql API */ @Mojo(name = "generate", - requiresDependencyCollection = ResolutionScope.COMPILE, - requiresDependencyResolution = ResolutionScope.COMPILE, - defaultPhase = LifecyclePhase.GENERATE_SOURCES, - threadSafe = true + requiresDependencyCollection = ResolutionScope.COMPILE, + requiresDependencyResolution = ResolutionScope.COMPILE, + defaultPhase = LifecyclePhase.GENERATE_SOURCES, + threadSafe = true ) -class GraphQLClientMojo: AbstractMojo() { +class GraphQLClientMojo : AbstractMojo() { + + @Parameter(defaultValue = "\${project}") + private lateinit var project: MavenProject @Parameter(property = "outputDirectory", defaultValue = "\${project.build.directory}/generated-sources/graphql-client") - private var outputDirectory: File? = null + lateinit var outputDirectory: File + + @Parameter(readonly = true, property = "introspectionFile", defaultValue = "\${project.basedir}/src/main/graphql/schema.json") + lateinit var introspectionFile: File @Parameter(property = "basePackage", defaultValue = "com.example.graphql.client") - private var basePackage: String? = null + private lateinit var basePackage: String @Parameter(property = "outputPackage", defaultValue = "com.example.graphql.client") - private var outputPackage: String? = null - - @Parameter(property = "introspectionFile", defaultValue = "\${project.basedir}/src/main/graphql/schema.json") - private var introspectionFile: File? = null - - @Parameter(property = "addSourceRoot", defaultValue = "true") - private var addSourceRoot: Boolean? = null - - @Parameter(readonly = true, required = true, defaultValue = "\${project}") - private var project: MavenProject? = null + private lateinit var outputPackage: String @Parameter(property = "customTypeMap") - private var customTypeMap: Map = mapOf() + private var customTypeMap: Map = emptyMap() - @Parameter(property = "nullableValueType") - private var nullableValueType: NullableValueType = NullableValueType.JAVA_OPTIONAL + @Parameter(property = "nullableValueType", defaultValue = "JAVA_OPTIONAL") + private var nullableValueType: NullableValueType = NullableValueType.JAVA_OPTIONAL - @Parameter(property = "useSemanticNaming") + @Parameter(property = "addSourceRoot", defaultValue = "true") + private var addSourceRoot: Boolean = true + + @Parameter(property = "useSemanticNaming", defaultValue = "true") private var useSemanticNaming: Boolean = true - @Parameter(property = "generateModelBuilder") + @Parameter(property = "generateModelBuilder", defaultValue = "true") private var generateModelBuilder: Boolean = true - @Parameter(property = "suppressRawTypesWarning") + @Parameter(property = "suppressRawTypesWarning", defaultValue = "false") private var suppressRawTypesWarning: Boolean = false - @Parameter(property = "useJavaBeansSemanticNaming") + @Parameter(property = "useJavaBeansSemanticNaming", defaultValue = "false") private var useJavaBeansSemanticNaming: Boolean = false @Throws(MojoExecutionException::class) override fun execute() { - val project = this.project!! - val outputDirectory = this.outputDirectory!! - val basePackage = this.basePackage!! - val outputPackage = this.basePackage!! - val nullableValueType = this.nullableValueType - val useSemanticNaming = this.useSemanticNaming - val generateModelBuilder = this.generateModelBuilder - val suppressRawTypesWarning = this.suppressRawTypesWarning - val useJavaBeansSemanticNaming = this.useJavaBeansSemanticNaming - val introspectionFile = this.introspectionFile!! - val customTypeMap = this.customTypeMap - + log.info("Apollo GraphQL Client Code Generation task started") val basePackageDirName = basePackage.replace('.', File.separatorChar) val sourceDirName = joinPath("src", "main", "graphql") val queryDir = File(project.basedir, sourceDirName) - - if(!queryDir.isDirectory) { - throw IllegalArgumentException("'${queryDir.absolutePath}' must be a directory") + if (!queryDir.isDirectory) { + throw MojoExecutionException("'${queryDir.absolutePath}' must be a directory") } + log.info("Read queries started") val queries = Files.walk(queryDir.toPath()) - .filter { it.toFile().isFile && it.toFile().name.endsWith(".graphql") } - .map { it.toFile().relativeTo(queryDir) } - .collect(Collectors.toList()) - - if(queries.isEmpty()) { - throw IllegalArgumentException("No queries found under '${queryDir.absolutePath}") + .filter { it.toFile().isFile && it.toFile().name.endsWith(".graphql") } + .map { it.toFile().relativeTo(queryDir) } + .collect(Collectors.toList()) + if (queries.isEmpty()) { + throw MojoExecutionException("No queries found under '${queryDir.absolutePath}") } val baseTargetDir = File(project.build.directory, joinPath("graphql-schema", sourceDirName, basePackageDirName)) @@ -106,8 +94,8 @@ class GraphQLClientMojo: AbstractMojo() { nodeModules.mkdirs() val nodeModuleResources = Reflections(ConfigurationBuilder().setScanners(ResourcesScanner()) - .setUrls(javaClass.getResource("/node_modules"))) - .getResources(Pattern.compile(".*")) + .setUrls(javaClass.getResource("/node_modules"))) + .getResources(Pattern.compile(".*")) nodeModuleResources.map { "/$it" }.forEach { resource -> val path = resource.replaceFirst("/node_modules/", "").replace("/", File.separator) @@ -119,12 +107,12 @@ class GraphQLClientMojo: AbstractMojo() { val apolloCli = File(nodeModules, joinPath("apollo-codegen", "lib", "cli.js")) apolloCli.setExecutable(true) - if(!introspectionFile.isFile) { - throw IllegalArgumentException("Introspection JSON not found: ${introspectionFile.absolutePath}") + if (!introspectionFile.isFile) { + throw MojoExecutionException("Introspection JSON not found: ${introspectionFile.absolutePath}") } - if(!apolloCli.isFile) { - throw IllegalStateException("Apollo codegen cli not found: '${apolloCli.absolutePath}'") + if (!apolloCli.isFile) { + throw MojoExecutionException("Apollo codegen cli not found: '${apolloCli.absolutePath}'") } schema.parentFile.mkdirs() @@ -140,12 +128,12 @@ class GraphQLClientMojo: AbstractMojo() { log.info("Running apollo cli (${apolloCli.absolutePath}) with arguments: ${arguments.joinToString(" ")}") val proc = ProcessBuilder("node", apolloCli.absolutePath, *arguments.toTypedArray()) - .directory(nodeModules.parentFile) - .inheritIO() - .start() + .directory(nodeModules.parentFile) + .inheritIO() + .start() - if(proc.waitFor() != 0) { - throw IllegalStateException("Apollo codegen cli command failed") + if (proc.waitFor() != 0) { + throw MojoExecutionException("Apollo codegen cli command failed") } val compiler = GraphQLCompiler() @@ -156,11 +144,14 @@ class GraphQLClientMojo: AbstractMojo() { useJavaBeansSemanticNaming = useJavaBeansSemanticNaming, outputPackageName = outputPackage)) - if(addSourceRoot == true) { + if (addSourceRoot) { project.addCompileSourceRoot(outputDirectory.absolutePath) } + log.info("Apollo GraphQL Client Code Generation task finished") } private fun joinPath(vararg names: String): String = names.joinToString(File.separator) } + + From cfb5a79968181a630ea4a63deb16ab7ee03c2e85 Mon Sep 17 00:00:00 2001 From: Aoudia Date: Sun, 24 Feb 2019 21:24:05 +0100 Subject: [PATCH 22/82] style(Plugin): Remove some code smells Add badges to Readme file --- README.md | 32 +++++++++++++++++++++----------- scripts/install_nodejs.sh | 4 ++-- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index cbb5d22..f6322e8 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ # Apollo GraphQL Client Code Generation Maven Plugin -[![CircleCI](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin.svg?style=svg)](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin) -[![Download](https://api.bintray.com/packages/sparow199/maven/apollo-client-maven-plugin/images/download.svg) ](https://bintray.com/sparow199/maven/apollo-client-maven-plugin/_latestVersion) + +[![CircleCI](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin.svg?style=svg)](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin) +[![Download](https://api.bintray.com/packages/sparow199/maven/apollo-client-maven-plugin/images/download.svg)](https://bintray.com/sparow199/maven/apollo-client-maven-plugin/_latestVersion) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/71b115f870bb44478dac5d05abc9f378)](https://app.codacy.com/app/Sparow199/apollo-client-maven-plugin?utm_source=github.com&utm_medium=referral&utm_content=Sparow199/apollo-client-maven-plugin&utm_campaign=Badge_Grade_Dashboard) [![Known Vulnerabilities](https://snyk.io/test/github/sparow199/apollo-client-maven-plugin/badge.svg)](https://snyk.io/test/github/Sparow199/apollo-client-maven-plugin) -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FSparow199%2Fapollo-client-maven-plugin.svg?type=shield)] -[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FSparow199%2Fapollo-client-maven-plugin.svg?type=shield) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) + ## Usage A full usage example can be found in the [test project](https://github.com/sparow199/apollo-client-maven-plugin/tree/master/apollo-client-maven-plugin-tests) @@ -14,6 +16,7 @@ A full usage example can be found in the [test project](https://github.com/sparo **NOTE: This plugin requires a nodejs environment to execute the bundled apollo-codegen node module.** 1. Add the apollo runtime library and guava to your project's depedencies: + ```xml com.apollographql.apollo @@ -21,7 +24,9 @@ A full usage example can be found in the [test project](https://github.com/sparo 1.0.0-alpha5 ``` + 2. Add the code generator plugin to your project's build (if codegen is desired): + ```xml com.github.sparow199 @@ -39,6 +44,7 @@ A full usage example can be found in the [test project](https://github.com/sparo ``` + 3. Create a file `src/main/graphql/schema.json` with the JSON results of an [introspection query](https://gist.github.com/Sparow199/a59527016e16a2d56309d62e01ff2348) 4. Create files for each query you'd like to generate classes for under `src/main/graphql`: 1. Query file names must match the name of the query they contain @@ -49,6 +55,7 @@ A full usage example can be found in the [test project](https://github.com/sparo ### Configuration Options All plugin options and their defaults: + ```xml ${project.build.directory}/generated-sources/graphql-client @@ -65,7 +72,8 @@ All plugin options and their defaults: ``` -#### Nullable Types +#### Nullable Types + Available nullable types: ```java @@ -76,9 +84,11 @@ Available nullable types: INPUT_TYPE ``` -#### Custom Types +#### Custom Types + To use the [Custom Scalar Types](https://github.com/apollographql/apollo-android#custom-scalar-types) you need to define mapping configuration then register your custom adapter: + ```xml ... @@ -104,14 +114,14 @@ ApolloClient client = ApolloClient.builder() }) .build()) .build() - + client.newCall(new GetBooks()) .enqueue(new ApolloCall.Callback() { - + @Override public void onResponse(@NotNull Response response) { ... } - + @Override public void onFailure(@NotNull ApolloException t) { ... } @@ -120,11 +130,11 @@ client.newCall(new GetBooks()) Properties specified as nullable in the schema will have an java 8 `java.util.optional` type. -# Contributors +## Contributors * Andrew Potter => apottere * William Yu => wiyu * Moncef AOUDIA => sparow199 * Ryan Gardner => ryangardner * Unknown => ddekkers -* Unknown => mgrossmanexp \ No newline at end of file +* Unknown => mgrossmanexp# Apollo GraphQL Client Code Generation Maven Plugin \ No newline at end of file diff --git a/scripts/install_nodejs.sh b/scripts/install_nodejs.sh index 0e31b6c..82aa801 100644 --- a/scripts/install_nodejs.sh +++ b/scripts/install_nodejs.sh @@ -9,8 +9,8 @@ source $NVM_DIR/nvm.sh nvm install 8.9 && nvm alias default 8.9 echo 8.9 > $HOME/.nvmrc # Enable nvm in following steps -echo 'export NVM_DIR=$HOME/.nvm' >> $BASH_ENV -echo 'source $NVM_DIR/nvm.sh' >> $BASH_ENV +echo "export NVM_DIR=$HOME/.nvm" >> $BASH_ENV +echo "source $NVM_DIR/nvm.sh" >> $BASH_ENV # To fix npm install : "node-pre-gyp: Permission denied" npm config set user 0 npm config set unsafe-perm true From 7350d8fc2684a139452d528f9fedcb917e96cb6a Mon Sep 17 00:00:00 2001 From: Aoudia Date: Sun, 24 Feb 2019 21:33:58 +0100 Subject: [PATCH 23/82] fix(Readme): Remove wrong code --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index f6322e8..dade84b 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ A full usage example can be found in the [test project](https://github.com/sparo **NOTE: This plugin requires a nodejs environment to execute the bundled apollo-codegen node module.** -1. Add the apollo runtime library and guava to your project's depedencies: +1. Add the apollo runtime library and guava to your project's depedencies: ```xml @@ -25,7 +25,7 @@ A full usage example can be found in the [test project](https://github.com/sparo ``` -2. Add the code generator plugin to your project's build (if codegen is desired): +2. Add the code generator plugin to your project's build (if codegen is desired): ```xml @@ -45,12 +45,12 @@ A full usage example can be found in the [test project](https://github.com/sparo ``` -3. Create a file `src/main/graphql/schema.json` with the JSON results of an [introspection query](https://gist.github.com/Sparow199/a59527016e16a2d56309d62e01ff2348) -4. Create files for each query you'd like to generate classes for under `src/main/graphql`: - 1. Query file names must match the name of the query they contain - 2. Query files must end with `.graphql` - 3. Any subdirectories under `src/main/graphql` are treated as extra package names to append to `packageName` in the plugin config. -5. Run `mvn clean generate-sources` to generate classes for your queries. +3. Create a file `src/main/graphql/schema.json` with the JSON results of an [introspection query](https://gist.github.com/Sparow199/a59527016e16a2d56309d62e01ff2348) +4. Create files for each query you'd like to generate classes for under `src/main/graphql`: + 1. Query file names must match the name of the query they contain + 2. Query files must end with `.graphql` + 3. Any subdirectories under `src/main/graphql` are treated as extra package names to append to `packageName` in the plugin config. +5. Run `mvn clean generate-sources` to generate classes for your queries. ### Configuration Options @@ -132,9 +132,9 @@ Properties specified as nullable in the schema will have an java 8 `java.util.op ## Contributors -* Andrew Potter => apottere -* William Yu => wiyu -* Moncef AOUDIA => sparow199 -* Ryan Gardner => ryangardner -* Unknown => ddekkers -* Unknown => mgrossmanexp# Apollo GraphQL Client Code Generation Maven Plugin \ No newline at end of file +- Andrew Potter => apottere +- William Yu => wiyu +- Moncef AOUDIA => sparow199 +- Ryan Gardner => ryangardner +- Unknown => ddekkers +- Unknown => mgrossmanexp From c412b3e78d99007767252236bd9b1ef3b98bcd57 Mon Sep 17 00:00:00 2001 From: Aoudia Date: Mon, 25 Feb 2019 21:21:51 +0100 Subject: [PATCH 24/82] feat(Plugin): Add skip execution option Thanks to @mpcabd --- .gitignore | 19 ++++++++---- README.md | 30 ++++++++++--------- .../client/maven/plugin/GraphQLClientMojo.kt | 19 ++++++++++-- 3 files changed, 46 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 50cf6bb..1959293 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 # User-specific stuff -.idea/**/workspace.xml .idea/**/tasks.xml .idea/**/usage.statistics.xml .idea/**/dictionaries @@ -80,7 +79,6 @@ fabric.properties *.iml modules.xml -.idea/misc.xml *.ipr ### Java ### @@ -161,7 +159,6 @@ release.properties dependency-reduced-pom.xml buildNumber.properties .mvn/timing.properties -.mvn/wrapper/maven-wrapper.jar ### Node ### # Logs @@ -198,7 +195,6 @@ bower_components build/Release # Dependency directories -node_modules/ jspm_packages/ # TypeScript v1 declaration files @@ -269,4 +265,17 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk -# End of https://www.gitignore.io/api/node,java,linux,macos,maven,windows,intellij+all \ No newline at end of file +# End of https://www.gitignore.io/api/node,java,linux,macos,maven,windows,intellij+all +/apollo-client-maven-plugin/.settings/ + +apollo-client-maven-plugin/\.project +/.settings/ +\.project + +apollo-client-maven-plugin-tests/\.settings/org\.eclipse\.core\.resources\.prefs + +apollo-client-maven-plugin-tests/\.settings/org\.eclipse\.m2e\.core\.prefs + +apollo-client-maven-plugin/\.classpath + +apollo-client-maven-plugin/\.factorypath diff --git a/README.md b/README.md index dade84b..6db0cf4 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ A full usage example can be found in the [test project](https://github.com/sparo **NOTE: This plugin requires a nodejs environment to execute the bundled apollo-codegen node module.** -1. Add the apollo runtime library and guava to your project's depedencies: +1. Add the apollo runtime library and guava to your project's depedencies: ```xml @@ -25,7 +25,7 @@ A full usage example can be found in the [test project](https://github.com/sparo ``` -2. Add the code generator plugin to your project's build (if codegen is desired): +2. Add the code generator plugin to your project's build (if codegen is desired): ```xml @@ -45,12 +45,12 @@ A full usage example can be found in the [test project](https://github.com/sparo ``` -3. Create a file `src/main/graphql/schema.json` with the JSON results of an [introspection query](https://gist.github.com/Sparow199/a59527016e16a2d56309d62e01ff2348) -4. Create files for each query you'd like to generate classes for under `src/main/graphql`: - 1. Query file names must match the name of the query they contain - 2. Query files must end with `.graphql` - 3. Any subdirectories under `src/main/graphql` are treated as extra package names to append to `packageName` in the plugin config. -5. Run `mvn clean generate-sources` to generate classes for your queries. +3. Create a file `src/main/graphql/schema.json` with the JSON results of an [introspection query](https://gist.github.com/Sparow199/a59527016e16a2d56309d62e01ff2348) +4. Create files for each query you'd like to generate classes for under `src/main/graphql`: + 1. Query file names must match the name of the query they contain + 2. Query files must end with `.graphql` + 3. Any subdirectories under `src/main/graphql` are treated as extra package names to append to `packageName` in the plugin config. +5. Run `mvn clean generate-sources` to generate classes for your queries. ### Configuration Options @@ -69,6 +69,7 @@ All plugin options and their defaults: JAVA_OPTIONAL false + false ``` @@ -132,9 +133,10 @@ Properties specified as nullable in the schema will have an java 8 `java.util.op ## Contributors -- Andrew Potter => apottere -- William Yu => wiyu -- Moncef AOUDIA => sparow199 -- Ryan Gardner => ryangardner -- Unknown => ddekkers -- Unknown => mgrossmanexp +- Andrew Potter => apottere +- William Yu => wiyu +- Moncef AOUDIA => sparow199 +- Ryan Gardner => ryangardner +- Abdullah Diab => mpcabd +- Unknown => ddekkers +- Unknown => mgrossmanexp diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index 2634a61..4726d3f 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -51,6 +51,9 @@ class GraphQLClientMojo : AbstractMojo() { @Parameter(property = "nullableValueType", defaultValue = "JAVA_OPTIONAL") private var nullableValueType: NullableValueType = NullableValueType.JAVA_OPTIONAL + @Parameter(property = "skip", defaultValue = "false") + private var skip: Boolean = false + @Parameter(property = "addSourceRoot", defaultValue = "true") private var addSourceRoot: Boolean = true @@ -69,6 +72,12 @@ class GraphQLClientMojo : AbstractMojo() { @Throws(MojoExecutionException::class) override fun execute() { + + if(skip == true) { + log.info("Skipping because skip is true") + return + } + log.info("Apollo GraphQL Client Code Generation task started") val basePackageDirName = basePackage.replace('.', File.separatorChar) val sourceDirName = joinPath("src", "main", "graphql") @@ -137,9 +146,13 @@ class GraphQLClientMojo : AbstractMojo() { } val compiler = GraphQLCompiler() - compiler.write(GraphQLCompiler.Arguments(irFile = schema, outputDir = outputDirectory, - customTypeMap = customTypeMap, nullableValueType = nullableValueType, - useSemanticNaming = useSemanticNaming, generateModelBuilder = generateModelBuilder, + compiler.write(GraphQLCompiler.Arguments( + irFile = schema, + outputDir = outputDirectory, + customTypeMap = customTypeMap, + nullableValueType = nullableValueType, + useSemanticNaming = useSemanticNaming, + generateModelBuilder = generateModelBuilder, suppressRawTypesWarning = suppressRawTypesWarning, useJavaBeansSemanticNaming = useJavaBeansSemanticNaming, outputPackageName = outputPackage)) From e82acf13c0b78281fe3ec4f76746ee96791d0ed3 Mon Sep 17 00:00:00 2001 From: Aoudia Date: Mon, 25 Feb 2019 21:37:45 +0100 Subject: [PATCH 25/82] refactor(Plugin): Simplify skip condition --- .../java/graphql/client/maven/plugin/GraphQLClientMojo.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index 4726d3f..700c71a 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -73,8 +73,8 @@ class GraphQLClientMojo : AbstractMojo() { @Throws(MojoExecutionException::class) override fun execute() { - if(skip == true) { - log.info("Skipping because skip is true") + if(skip) { + log.info("Skipping execution because skip option is true") return } From 563c966ad3ea337956e0e8713ae14e60314dd8c0 Mon Sep 17 00:00:00 2001 From: Aoudia Date: Mon, 25 Feb 2019 22:13:16 +0100 Subject: [PATCH 26/82] version(*): Bump version to 1.2.3 --- README.md | 2 +- apollo-client-maven-plugin-tests/pom.xml | 5 +++-- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6db0cf4..d3b093b 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 1.2.3-snapshot + 1.2.3 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 6615c72..61c5dfb 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.3-snapshot + 1.2.3 .. @@ -74,7 +74,7 @@ com.github.sparow199 apollo-client-maven-plugin - 1.2.3-snapshot + 1.2.3 @@ -92,6 +92,7 @@ java.lang.Long + false diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index f2ae389..5b2f7d7 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.3-snapshot + 1.2.3 .. diff --git a/pom.xml b/pom.xml index 82c6256..f2ab068 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.3-snapshot + 1.2.3 pom apollo-client-maven-plugin-parent From 5f73124e462c1a9417bab163285ca8af85b2029d Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Sat, 23 Mar 2019 10:18:56 +0100 Subject: [PATCH 27/82] refactor(*): Update defaults parameters values --- README.md | 8 ++++---- apollo-client-maven-plugin-tests/pom.xml | 10 +++++++--- .../graphql/client/maven/plugin/GraphQLClientMojo.kt | 8 ++++---- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index d3b093b..9cf12b2 100644 --- a/README.md +++ b/README.md @@ -58,18 +58,18 @@ All plugin options and their defaults: ```xml - ${project.build.directory}/generated-sources/graphql-client + false + true com.example.graphql.client + ${project.basedir}/src/main/graphql/schema.json com.example.graphql.client - ${project.basedir}/src/main/graphql/schema.json - true + ${project.build.directory}/generated-sources/graphql-client true true true JAVA_OPTIONAL false - false ``` diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 61c5dfb..9cf6a5a 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -1,4 +1,5 @@ - + 4.0.0 @@ -81,9 +82,13 @@ generate + false + true com.lahzouz.java.graphql.client.tests + ${project.basedir}/src/main/graphql/schema.json com.lahzouz.java.graphql.client.tests - true + ${project.build.directory}/generated-sources/graphql-client + true true true @@ -92,7 +97,6 @@ java.lang.Long - false diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index 700c71a..621d878 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -66,14 +66,14 @@ class GraphQLClientMojo : AbstractMojo() { @Parameter(property = "suppressRawTypesWarning", defaultValue = "false") private var suppressRawTypesWarning: Boolean = false - @Parameter(property = "useJavaBeansSemanticNaming", defaultValue = "false") - private var useJavaBeansSemanticNaming: Boolean = false + @Parameter(property = "useJavaBeansSemanticNaming", defaultValue = "true") + private var useJavaBeansSemanticNaming: Boolean = true @Throws(MojoExecutionException::class) override fun execute() { - - if(skip) { + + if (skip) { log.info("Skipping execution because skip option is true") return } From 78eb7dc2fb1f897f4e01a8e9616821ce412e9427 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Sat, 23 Mar 2019 10:21:06 +0100 Subject: [PATCH 28/82] version(*): Bump version to 1.2.4 --- README.md | 2 +- apollo-client-maven-plugin-tests/pom.xml | 4 ++-- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9cf12b2..3b37d90 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 1.2.3 + 1.2.4 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 9cf6a5a..eb3532c 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.3 + 1.2.4 .. @@ -75,7 +75,7 @@ com.github.sparow199 apollo-client-maven-plugin - 1.2.3 + 1.2.4 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 5b2f7d7..a295d94 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.3 + 1.2.4 .. diff --git a/pom.xml b/pom.xml index f2ab068..260518b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.3 + 1.2.4 pom apollo-client-maven-plugin-parent From a5472c0d07f9984908c6111014f4cea30ad21684 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Wed, 29 May 2019 01:23:27 +0200 Subject: [PATCH 29/82] refactor(*): Upgrade to Apollo Android 1.0.0 --- apollo-client-maven-plugin-tests/pom.xml | 3 ++- apollo-client-maven-plugin/pom.xml | 2 +- .../java/graphql/client/maven/plugin/GraphQLClientMojo.kt | 4 ++++ pom.xml | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index eb3532c..d2edc47 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -28,7 +28,7 @@ com.apollographql.apollo apollo-runtime - 1.0.0-alpha5 + 1.0.0 @@ -97,6 +97,7 @@ java.lang.Long + false diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index a295d94..609604d 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -41,7 +41,7 @@ com.apollographql.apollo apollo-compiler - 1.0.0-alpha5 + 1.0.0 diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index 621d878..799c3ff 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -69,6 +69,9 @@ class GraphQLClientMojo : AbstractMojo() { @Parameter(property = "useJavaBeansSemanticNaming", defaultValue = "true") private var useJavaBeansSemanticNaming: Boolean = true + @Parameter(property = "generateKotlinModels", defaultValue = "false") + private var generateKotlinModels: Boolean = true + @Throws(MojoExecutionException::class) override fun execute() { @@ -153,6 +156,7 @@ class GraphQLClientMojo : AbstractMojo() { nullableValueType = nullableValueType, useSemanticNaming = useSemanticNaming, generateModelBuilder = generateModelBuilder, + generateKotlinModels = generateKotlinModels, suppressRawTypesWarning = suppressRawTypesWarning, useJavaBeansSemanticNaming = useJavaBeansSemanticNaming, outputPackageName = outputPackage)) diff --git a/pom.xml b/pom.xml index 260518b..a382657 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ UTF-8 UTF-8 1.3 - 1.3.21 + 1.3.31 1.8 From 6fdfa9f4f2988755d78300a4f3bee9dc4372d649 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Wed, 29 May 2019 01:24:37 +0200 Subject: [PATCH 30/82] version(*): Bump version to 1.3.0 --- README.md | 2 +- apollo-client-maven-plugin-tests/pom.xml | 4 ++-- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3b37d90..d9af9cc 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 1.2.4 + 1.3.0 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index d2edc47..e53b1f3 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.4 + 1.3.0 .. @@ -75,7 +75,7 @@ com.github.sparow199 apollo-client-maven-plugin - 1.2.4 + 1.3.0 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 609604d..9254462 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.4 + 1.3.0 .. diff --git a/pom.xml b/pom.xml index a382657..079bce0 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.2.4 + 1.3.0 pom apollo-client-maven-plugin-parent From 415a04c73083358a978289ef01a4c8d642c5b964 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Wed, 29 May 2019 01:30:01 +0200 Subject: [PATCH 31/82] doc(Readme): Update Apollo Android version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d9af9cc..e9abce1 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.apollographql.apollo apollo-runtime - 1.0.0-alpha5 + 1.0.0 ``` From 51be35573845c0f10bf664e5dcdffd741add8c43 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Wed, 29 May 2019 08:35:00 +0200 Subject: [PATCH 32/82] doc(Readme): Add Kotlin models generation option --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e9abce1..d796dd5 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,7 @@ All plugin options and their defaults: JAVA_OPTIONAL false + false ``` From 637f836075abcb57ffc1d71c5b76ef8472ee86e9 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Wed, 29 May 2019 11:27:46 +0200 Subject: [PATCH 33/82] fix(CircleCi): Deploy on tag issue Update regex pattern Deploy only on master branch --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a19de30..959865c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -70,7 +70,7 @@ workflows: - build filters: tags: - only: /v.*/ + only: /^v\d+\.\d+\.\d+$/ branches: - only: - - master \ No newline at end of file + ignore: + - /^(?!master).*$/ \ No newline at end of file From 5d8c0ed46f5af2c485d2aa7435ddad1e6aded36c Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Wed, 29 May 2019 11:37:53 +0200 Subject: [PATCH 34/82] fix(CircleCi): Stop deploy goal if master branch was detected --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 959865c..fed5f2f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -73,4 +73,4 @@ workflows: only: /^v\d+\.\d+\.\d+$/ branches: ignore: - - /^(?!master).*$/ \ No newline at end of file + - /.*/ \ No newline at end of file From d5201a24b106ba8f7ebacd957e00436e9fc958e9 Mon Sep 17 00:00:00 2001 From: Drew Horn Date: Fri, 12 Jul 2019 15:15:11 -0500 Subject: [PATCH 35/82] Added support to dynamically generate the schema.json. Schema can be generated dynamically at build time with these new options: false http://localhost --- README.md | 8 ++- apollo-client-maven-plugin-tests/pom.xml | 4 +- apollo-client-maven-plugin/pom.xml | 2 +- .../client/maven/plugin/GraphQLClientMojo.kt | 64 +++++++++++++------ pom.xml | 2 +- 5 files changed, 54 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index d796dd5..9e82e2f 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 1.3.0 + 1.3.1 @@ -45,7 +45,9 @@ A full usage example can be found in the [test project](https://github.com/sparo ``` -3. Create a file `src/main/graphql/schema.json` with the JSON results of an [introspection query](https://gist.github.com/Sparow199/a59527016e16a2d56309d62e01ff2348) +3. Create a file `src/main/graphql/schema.json` with the JSON results of an [introspection query](https://gist.github.com/Sparow199/a59527016e16a2d56309d62e01ff2348) OR you can +automatically generate this file by setting `generateIntrospectionFile` to true and `schemaUrl` to your GraphQL endpoint. At build time, the plugin will query the server and install this file +per the value of `introspectionFile`. 4. Create files for each query you'd like to generate classes for under `src/main/graphql`: 1. Query file names must match the name of the query they contain 2. Query files must end with `.graphql` @@ -62,6 +64,8 @@ All plugin options and their defaults: true com.example.graphql.client ${project.basedir}/src/main/graphql/schema.json + false + http://localhost com.example.graphql.client ${project.build.directory}/generated-sources/graphql-client true diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index e53b1f3..1d80893 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.3.0 + 1.3.1 .. @@ -75,7 +75,7 @@ com.github.sparow199 apollo-client-maven-plugin - 1.3.0 + 1.3.1 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 9254462..c6d99d4 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.3.0 + 1.3.1 .. diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index 799c3ff..ee3cfb5 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -51,6 +51,12 @@ class GraphQLClientMojo : AbstractMojo() { @Parameter(property = "nullableValueType", defaultValue = "JAVA_OPTIONAL") private var nullableValueType: NullableValueType = NullableValueType.JAVA_OPTIONAL + @Parameter(property = "generateIntrospectionFile", defaultValue = "false") + private var generateIntrospectionFile: Boolean = false + + @Parameter(property = "schemaUrl", defaultValue = "http://localhost") + private lateinit var schemaUrl: String + @Parameter(property = "skip", defaultValue = "false") private var skip: Boolean = false @@ -81,6 +87,44 @@ class GraphQLClientMojo : AbstractMojo() { return } + val nodeModules = File(project.build.directory, joinPath("apollo-codegen-node-modules", "node_modules")) + nodeModules.deleteRecursively() + nodeModules.mkdirs() + + val nodeModuleResources = Reflections(ConfigurationBuilder().setScanners(ResourcesScanner()) + .setUrls(javaClass.getResource("/node_modules"))) + .getResources(Pattern.compile(".*")) + + nodeModuleResources.map { "/$it" }.forEach { resource -> + val path = resource.replaceFirst("/node_modules/", "").replace("/", File.separator) + val diskPath = File(nodeModules, path) + diskPath.parentFile.mkdirs() + FileUtils.copyURLToFile(javaClass.getResource(resource), diskPath) + } + + val apolloCli = File(nodeModules, joinPath("apollo-codegen", "lib", "cli.js")) + apolloCli.setExecutable(true) + + if (!apolloCli.isFile) { + throw MojoExecutionException("Apollo codegen cli not found: '${apolloCli.absolutePath}'") + } + + if (generateIntrospectionFile) { + log.info("Automatically generating introspection file") + val arguments = listOf("introspect-schema", schemaUrl, "--output", introspectionFile.absolutePath) + log.info("Running apollo cli (${apolloCli.absolutePath}) with arguments: ${arguments.joinToString(" ")}") + + val proc = ProcessBuilder("node", apolloCli.absolutePath, *arguments.toTypedArray()) + .directory(nodeModules.parentFile) + .inheritIO() + .start() + + if (proc.waitFor() != 0) { + throw MojoExecutionException("Apollo codegen cli command failed") + } + + } + log.info("Apollo GraphQL Client Code Generation task started") val basePackageDirName = basePackage.replace('.', File.separatorChar) val sourceDirName = joinPath("src", "main", "graphql") @@ -101,32 +145,12 @@ class GraphQLClientMojo : AbstractMojo() { val baseTargetDir = File(project.build.directory, joinPath("graphql-schema", sourceDirName, basePackageDirName)) val schema = File(baseTargetDir, "schema.json") - val nodeModules = File(project.build.directory, joinPath("apollo-codegen-node-modules", "node_modules")) - nodeModules.deleteRecursively() - nodeModules.mkdirs() - - val nodeModuleResources = Reflections(ConfigurationBuilder().setScanners(ResourcesScanner()) - .setUrls(javaClass.getResource("/node_modules"))) - .getResources(Pattern.compile(".*")) - - nodeModuleResources.map { "/$it" }.forEach { resource -> - val path = resource.replaceFirst("/node_modules/", "").replace("/", File.separator) - val diskPath = File(nodeModules, path) - diskPath.parentFile.mkdirs() - FileUtils.copyURLToFile(javaClass.getResource(resource), diskPath) - } - val apolloCli = File(nodeModules, joinPath("apollo-codegen", "lib", "cli.js")) - apolloCli.setExecutable(true) if (!introspectionFile.isFile) { throw MojoExecutionException("Introspection JSON not found: ${introspectionFile.absolutePath}") } - if (!apolloCli.isFile) { - throw MojoExecutionException("Apollo codegen cli not found: '${apolloCli.absolutePath}'") - } - schema.parentFile.mkdirs() queries.forEach { query -> val src = File(queryDir, query.path) diff --git a/pom.xml b/pom.xml index 079bce0..246709e 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.3.0 + 1.3.1 pom apollo-client-maven-plugin-parent From de632a6a0931292d6b9e36904e0c9b708508757a Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Sat, 13 Jul 2019 12:31:41 +0200 Subject: [PATCH 36/82] fix(CircleCI): Update deploy branches regex --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fed5f2f..7f119dd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -72,5 +72,4 @@ workflows: tags: only: /^v\d+\.\d+\.\d+$/ branches: - ignore: - - /.*/ \ No newline at end of file + only: master From 6c33b6136cfbc81ed4ae8b01cfc967a9f98a494b Mon Sep 17 00:00:00 2001 From: Dave Maughan Date: Wed, 31 Jul 2019 16:55:13 +0100 Subject: [PATCH 37/82] parameterise node executable --- README.md | 1 + apollo-client-maven-plugin-tests/pom.xml | 1 + .../java/graphql/client/maven/plugin/GraphQLClientMojo.kt | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9e82e2f..429ee1d 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ All plugin options and their defaults: false false + node ``` diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 1d80893..7299225 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -98,6 +98,7 @@ java.lang.Long false + node diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index ee3cfb5..e095314 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -78,6 +78,8 @@ class GraphQLClientMojo : AbstractMojo() { @Parameter(property = "generateKotlinModels", defaultValue = "false") private var generateKotlinModels: Boolean = true + @Parameter(property = "nodeExecutable", defaultValue = "node") + private lateinit var nodeExecutable: String @Throws(MojoExecutionException::class) override fun execute() { @@ -114,7 +116,7 @@ class GraphQLClientMojo : AbstractMojo() { val arguments = listOf("introspect-schema", schemaUrl, "--output", introspectionFile.absolutePath) log.info("Running apollo cli (${apolloCli.absolutePath}) with arguments: ${arguments.joinToString(" ")}") - val proc = ProcessBuilder("node", apolloCli.absolutePath, *arguments.toTypedArray()) + val proc = ProcessBuilder(nodeExecutable, apolloCli.absolutePath, *arguments.toTypedArray()) .directory(nodeModules.parentFile) .inheritIO() .start() @@ -163,7 +165,7 @@ class GraphQLClientMojo : AbstractMojo() { val arguments = listOf("generate", *queries.map { File(baseTargetDir, it.path).absolutePath }.toTypedArray(), "--target", "json", "--schema", introspectionFile.absolutePath, "--output", schema.absolutePath) log.info("Running apollo cli (${apolloCli.absolutePath}) with arguments: ${arguments.joinToString(" ")}") - val proc = ProcessBuilder("node", apolloCli.absolutePath, *arguments.toTypedArray()) + val proc = ProcessBuilder(nodeExecutable, apolloCli.absolutePath, *arguments.toTypedArray()) .directory(nodeModules.parentFile) .inheritIO() .start() From e28b136e58f33b7d9f3a827a3ec69a6153ce46f5 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Tue, 6 Aug 2019 16:51:39 +0200 Subject: [PATCH 38/82] version(*): Bump version to 1.3.2 --- README.md | 2 +- apollo-client-maven-plugin-tests/pom.xml | 4 ++-- apollo-client-maven-plugin/pom.xml | 2 +- .../graphql/client/maven/plugin/GraphQLClientMojo.kt | 12 +++++++----- pom.xml | 2 +- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 429ee1d..47653a0 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 1.3.1 + 1.3.2 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 7299225..7087479 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.3.1 + 1.3.2 .. @@ -75,7 +75,7 @@ com.github.sparow199 apollo-client-maven-plugin - 1.3.1 + 1.3.2 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index c6d99d4..62db545 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.3.1 + 1.3.2 .. diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index e095314..e8d7c83 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -20,7 +20,7 @@ import java.util.stream.Collectors /** - * Generates classes for a graphql API + * Generate classes for a graphql API */ @Mojo(name = "generate", requiresDependencyCollection = ResolutionScope.COMPILE, @@ -144,11 +144,10 @@ class GraphQLClientMojo : AbstractMojo() { throw MojoExecutionException("No queries found under '${queryDir.absolutePath}") } - val baseTargetDir = File(project.build.directory, joinPath("graphql-schema", sourceDirName, basePackageDirName)) + val baseTargetDir = File(project.build.directory, joinPath("graphql-schema", sourceDirName, + basePackageDirName)) val schema = File(baseTargetDir, "schema.json") - - if (!introspectionFile.isFile) { throw MojoExecutionException("Introspection JSON not found: ${introspectionFile.absolutePath}") } @@ -162,7 +161,10 @@ class GraphQLClientMojo : AbstractMojo() { src.copyTo(dest, overwrite = true) } - val arguments = listOf("generate", *queries.map { File(baseTargetDir, it.path).absolutePath }.toTypedArray(), "--target", "json", "--schema", introspectionFile.absolutePath, "--output", schema.absolutePath) + val arguments = listOf("generate", *queries.map { File(baseTargetDir, it.path).absolutePath } + .toTypedArray(), "--target", "json", "--schema", introspectionFile.absolutePath, + "--output", schema.absolutePath) + log.info("Running apollo cli (${apolloCli.absolutePath}) with arguments: ${arguments.joinToString(" ")}") val proc = ProcessBuilder(nodeExecutable, apolloCli.absolutePath, *arguments.toTypedArray()) diff --git a/pom.xml b/pom.xml index 246709e..f5cf402 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.3.1 + 1.3.2 pom apollo-client-maven-plugin-parent From d8dbd43efbc75053fd758d3665d500948e05e965 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Tue, 6 Aug 2019 17:16:55 +0200 Subject: [PATCH 39/82] build(Plugin): Upgrade Apollo compiler to v1.0.2 --- apollo-client-maven-plugin/pom.xml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 62db545..92db506 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -14,6 +14,12 @@ UTF-8 UTF-8 + 3.6.0 + 2.2.1 + 1.0.2 + 2.6 + 0.9.11 + 1.6.0 apollo-client-maven-plugin @@ -24,35 +30,29 @@ org.apache.maven maven-plugin-api - 3.6.0 + ${maven-plugin-api.version} org.apache.maven.plugin-tools maven-plugin-annotations - 3.6.0 + ${maven-plugin-api.version} provided org.apache.maven maven-project - 2.2.1 + ${maven-project.version} com.apollographql.apollo apollo-compiler - 1.0.0 - - - - commons-io - commons-io - 2.6 + ${apollo-compiler.version} org.reflections reflections - 0.9.11 + ${reflections.version} @@ -67,7 +67,7 @@ org.codehaus.mojo exec-maven-plugin - 1.6.0 + ${exec-maven-plugin.version} generate-resources From 72e1e1249b5570703f8bbab32ae39fafb0b32bd6 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Tue, 6 Aug 2019 17:18:39 +0200 Subject: [PATCH 40/82] version(*): Bump version to v1.3.3 --- README.md | 4 ++-- apollo-client-maven-plugin-tests/pom.xml | 4 ++-- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 47653a0..6df4e58 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.apollographql.apollo apollo-runtime - 1.0.0 + 1.0.2 ``` @@ -31,7 +31,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 1.3.2 + 1.3.3 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 7087479..6d2b73e 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.3.2 + 1.3.3 .. @@ -75,7 +75,7 @@ com.github.sparow199 apollo-client-maven-plugin - 1.3.2 + 1.3.3 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 92db506..f0b16f1 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.3.2 + 1.3.3 .. diff --git a/pom.xml b/pom.xml index f5cf402..6aecced 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.3.2 + 1.3.3 pom apollo-client-maven-plugin-parent From e1a6dee7f9fcda8db452afee28178be751f96cc7 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Mon, 12 Aug 2019 23:57:14 +0200 Subject: [PATCH 41/82] test(*): Migrate to Kotlin Migrate to Kotlin Add JUnit 5 Update Kotlin version to 1.3.41 Fix integration tests --- apollo-client-maven-plugin-tests/pom.xml | 11 +- .../client/tests/IntegrationSpec.groovy | 127 ----------------- .../java/graphql/client/tests/Query.groovy | 59 -------- .../src/test/kotlin/IntegrationSpec.kt | 128 ++++++++++++++++++ .../src/test/kotlin/Query.kt | 25 ++++ .../src/test/kotlin/TestCallbackFuture.kt | 21 +++ pom.xml | 8 +- 7 files changed, 183 insertions(+), 196 deletions(-) delete mode 100644 apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/IntegrationSpec.groovy delete mode 100644 apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/Query.groovy create mode 100644 apollo-client-maven-plugin-tests/src/test/kotlin/IntegrationSpec.kt create mode 100644 apollo-client-maven-plugin-tests/src/test/kotlin/Query.kt create mode 100644 apollo-client-maven-plugin-tests/src/test/kotlin/TestCallbackFuture.kt diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 6d2b73e..29a8e21 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -21,16 +21,15 @@ UTF-8 true 2.0.17.Final + 5.5.1 - com.apollographql.apollo apollo-runtime - 1.0.0 + 1.0.1 - com.graphql-java graphql-java-tools @@ -67,6 +66,12 @@ 1.7.25 test + + org.junit.jupiter + junit-jupiter + ${junit.jupiter.version} + test + diff --git a/apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/IntegrationSpec.groovy b/apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/IntegrationSpec.groovy deleted file mode 100644 index 7398c2a..0000000 --- a/apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/IntegrationSpec.groovy +++ /dev/null @@ -1,127 +0,0 @@ -package com.lahzouz.java.graphql.client.tests - -import com.apollographql.apollo.ApolloClient -import com.apollographql.apollo.response.CustomTypeAdapter -import com.apollographql.apollo.response.CustomTypeValue -import com.coxautodev.graphql.tools.SchemaParser -import com.fasterxml.jackson.databind.ObjectMapper -import graphql.schema.GraphQLSchema -import graphql.servlet.DefaultGraphQLSchemaProvider -import graphql.servlet.GraphQLInvocationInputFactory -import graphql.servlet.GraphQLSchemaProvider -import graphql.servlet.SimpleGraphQLHttpServlet -import io.undertow.Undertow -import io.undertow.servlet.Servlets -import io.undertow.servlet.api.DeploymentInfo -import io.undertow.servlet.api.DeploymentManager -import io.undertow.servlet.util.ImmediateInstanceFactory -import okhttp3.OkHttpClient -import okhttp3.Request -import org.jetbrains.annotations.NotNull -import spock.lang.Ignore -import spock.lang.Shared -import spock.lang.Specification - -import javax.servlet.Servlet - -/** - * @author Andrew Potter - */ -class IntegrationSpec extends Specification { - - @Shared - Undertow server - - @Shared - int port - - @Shared - ApolloClient client - - def setupSpec() { - - GraphQLSchema libSchema = SchemaParser.newParser() - .file('schema.graphqls') - .resolvers(new Query()) - .build() - .makeExecutableSchema() - - SimpleGraphQLHttpServlet servlet = createServlet(libSchema) - - DeploymentInfo servletBuilder = Servlets.deployment() - .setClassLoader(getClass().getClassLoader()) - .setContextPath("/") - .setDeploymentName("test") - .addServlets(Servlets.servlet("GraphQLServlet", SimpleGraphQLHttpServlet, new ImmediateInstanceFactory(servlet)).addMapping("/graphql/*")) - - DeploymentManager manager = Servlets.defaultContainer().addDeployment(servletBuilder) - manager.deploy() - server = Undertow.builder() - .addHttpListener(0, "127.0.0.1") - .setHandler(manager.start()).build() - server.start() - port = ((InetSocketAddress) server.getListenerInfo().get(0).getAddress()).getPort() - - CustomTypeAdapter longCustomTypeAdapter = new CustomTypeAdapter() { - - @Override - Long decode(@NotNull CustomTypeValue value) { - return Long.valueOf(value as String) - } - - @Override - CustomTypeValue encode(@NotNull Long value) { - return String.valueOf(value) as CustomTypeValue - } - } - - client = ApolloClient.builder() - .serverUrl("http://127.0.0.1:$port/graphql") - .addCustomTypeAdapter(CustomType.LONG, longCustomTypeAdapter) - .okHttpClient(new OkHttpClient()) - .build() - } - - def cleanupSpec() { - server.stop() - } - - @Ignore - // Comment @Ignore and run this to update the schema file (then un-comment @Ignore). - def "print introspection query results"() { - expect: - ObjectMapper mapper = new ObjectMapper() - - Map data = mapper.readValue( - new OkHttpClient().newCall(new Request.Builder().url("http://127.0.0.1:$port/graphql/schema.json").build()) - .execute() - .body() - .byteStream(), - Map - ) - - new File("src/main/graphql/schema.json").withWriter { out -> - out << mapper.writerWithDefaultPrettyPrinter().writeValueAsString(data.data) - } - } - - def "generated book query returns data"() { - when: - def books = client.newCall(new GetBooksQuery()).execute().data().get().books() - then: - books.size() == 4 - books.each { b -> assert b.id() instanceof Long} - } - - def "generated author query returns data"() { - expect: - client.newCall(new GetAuthorsQuery()).execute().data().get().authors().size() == 2 - } - - SimpleGraphQLHttpServlet createServlet(GraphQLSchema schema) { - GraphQLSchemaProvider schemaProvider = new DefaultGraphQLSchemaProvider(schema) - GraphQLInvocationInputFactory invocationInputFactory = GraphQLInvocationInputFactory.newBuilder(schemaProvider).build() - return SimpleGraphQLHttpServlet.newBuilder(invocationInputFactory).build() - } - -} diff --git a/apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/Query.groovy b/apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/Query.groovy deleted file mode 100644 index b73e828..0000000 --- a/apollo-client-maven-plugin-tests/src/test/groovy/com/lahzouz/java/graphql/client/tests/Query.groovy +++ /dev/null @@ -1,59 +0,0 @@ -package com.lahzouz.java.graphql.client.tests - -import com.coxautodev.graphql.tools.GraphQLQueryResolver - -/** - * @author Andrew Potter - */ -class Query implements GraphQLQueryResolver { - - private List books = [] - private List authors = [] - - Query() { - def dickens = new Author(name: "Charles Dickens") - def twain = new Author(name: "Mark Twain") - - authors.addAll(dickens, twain) - books.addAll( - new Book(title: "A Christmas Carol", author: dickens, id: 1L), - new Book(title: "David Copperfield", author: dickens, id: 2L), - new Book(title: "The Adventures of Tom Sawyer", author: twain, id: 3L), - new Book(title: "Adventures of Huckleberry Finn", author: twain, id: 4L), - ) - } - - List getBooks() { - return books - } - - List getAuthors() { - return authors - } - - static class Book { - private String title - private Author author - private Long id - - String getTitle() { - return title - } - - Author getAuthor() { - return author - } - - Long getId() { - return id - } - } - - static class Author { - private String name - - String getName() { - return name - } - } -} diff --git a/apollo-client-maven-plugin-tests/src/test/kotlin/IntegrationSpec.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/IntegrationSpec.kt new file mode 100644 index 0000000..3c4ab0b --- /dev/null +++ b/apollo-client-maven-plugin-tests/src/test/kotlin/IntegrationSpec.kt @@ -0,0 +1,128 @@ +package com.lahzouz.java.graphql.client.tests + +import com.apollographql.apollo.ApolloClient +import com.apollographql.apollo.api.Response +import com.apollographql.apollo.response.CustomTypeAdapter +import com.apollographql.apollo.response.CustomTypeValue +import com.coxautodev.graphql.tools.SchemaParser +import com.fasterxml.jackson.databind.ObjectMapper +import com.lahzouz.java.graphql.client.tests.type.CustomType +import graphql.schema.GraphQLSchema +import graphql.servlet.DefaultGraphQLSchemaProvider +import graphql.servlet.GraphQLInvocationInputFactory +import graphql.servlet.SimpleGraphQLHttpServlet +import io.undertow.Undertow +import io.undertow.servlet.Servlets +import io.undertow.servlet.util.ImmediateInstanceFactory +import okhttp3.OkHttpClient +import okhttp3.Request +import org.junit.jupiter.api.* +import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS +import java.io.File +import java.math.BigDecimal +import java.net.InetSocketAddress +import java.util.* +import java.util.concurrent.CompletableFuture +import javax.servlet.Servlet + + +/** + * @author Sparow199 + */ +@TestInstance(PER_CLASS) +class IntegrationSpec { + + private lateinit var server: Undertow + private var port: Int = 0 + private lateinit var client: ApolloClient + + @BeforeAll + fun setupSpec() { + + val libSchema = SchemaParser.newParser() + .file("schema.graphqls") + .resolvers(Query()) + .build() + .makeExecutableSchema() + + val servlet = createServlet(libSchema) + + val servletBuilder = Servlets.deployment() + .setClassLoader(javaClass.classLoader) + .setContextPath("/") + .setDeploymentName("test") + .addServlets(Servlets.servlet("GraphQLServlet", SimpleGraphQLHttpServlet::class.java, ImmediateInstanceFactory(servlet)).addMapping("/graphql/*")) + + val manager = Servlets.defaultContainer().addDeployment(servletBuilder) + manager.deploy() + server = Undertow.builder() + .addHttpListener(0, "127.0.0.1") + .setHandler(manager.start()).build() + server.start() + + val inetSocketAddress: InetSocketAddress = server.listenerInfo[0].address as InetSocketAddress + port = inetSocketAddress.port + + val longCustomTypeAdapter = object : CustomTypeAdapter { + override fun encode(value: Long): CustomTypeValue<*> { + return value.toString() as CustomTypeValue + } + + override fun decode(value: CustomTypeValue<*>): Long { + return (value.value as BigDecimal).toLong() + } + + } + + client = ApolloClient.builder() + .serverUrl("http://127.0.0.1:$port/graphql") + .addCustomTypeAdapter(CustomType.LONG, longCustomTypeAdapter) + .okHttpClient(OkHttpClient()) + .build() + } + + // + @AfterAll + fun cleanupSpec() { + server.stop() + } + + + @Test + fun `print introspection query results`() { + val mapper = ObjectMapper() + val data = mapper.readValue( + OkHttpClient().newCall(Request.Builder().url("http://127.0.0.1:$port/graphql/schema.json").build()) + .execute() + .body()?.byteStream(), + Map::class.java + ) + + File("src/main/graphql/schema.json").writeText(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(data["data"])) + } + + @Test + fun `generated book query returns data`() { + val future: CompletableFuture>> = CompletableFuture() + client.query(GetBooksQuery()).enqueue(TestCallbackFuture(future)) + val response = future.join() + Assertions.assertEquals(4, response.data()?.get()?.books?.size) + Assertions.assertTrue(response.data()?.get()?.books?.get(0)?.getId() is Long) + Assertions.assertTrue(response.data()?.get()?.books?.get(3)?.getId() is Long) + } + + @Test + fun `generated author query returns data`() { + val future: CompletableFuture>> = CompletableFuture() + client.query(GetAuthorsQuery()).enqueue(TestCallbackFuture(future)) + val response = future.join() + Assertions.assertEquals(2, response.data()?.get()?.authors?.size) + } + + private fun createServlet(schema: GraphQLSchema): SimpleGraphQLHttpServlet { + val schemaProvider = DefaultGraphQLSchemaProvider(schema) + val invocationInputFactory = GraphQLInvocationInputFactory.newBuilder(schemaProvider).build() + return SimpleGraphQLHttpServlet.newBuilder(invocationInputFactory).build() + } + +} diff --git a/apollo-client-maven-plugin-tests/src/test/kotlin/Query.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/Query.kt new file mode 100644 index 0000000..9a57a99 --- /dev/null +++ b/apollo-client-maven-plugin-tests/src/test/kotlin/Query.kt @@ -0,0 +1,25 @@ +package com.lahzouz.java.graphql.client.tests + +import com.coxautodev.graphql.tools.GraphQLQueryResolver + +/** + * @author Sparow199 + */ +class Query : GraphQLQueryResolver { + + private val books: List + private val authors: List + + init { + val dickens = Author(name = "Charles Dickens") + val twain = Author(name = "Mark Twain") + authors = listOf(dickens, twain) + books = listOf(Book(title = "A Christmas Carol", author = dickens, id = 1L), + Book(title = "David Copperfield", author = dickens, id = 2L), + Book(title = "The Adventures of Tom Sawyer", author = twain, id = 3L), + Book(title = "Adventures of Huckleberry Finn", author = twain, id = 4L)) + } + + data class Book(val title: String, val author: Author, val id: Long) + data class Author(val name: String) +} diff --git a/apollo-client-maven-plugin-tests/src/test/kotlin/TestCallbackFuture.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/TestCallbackFuture.kt new file mode 100644 index 0000000..e5b7e9b --- /dev/null +++ b/apollo-client-maven-plugin-tests/src/test/kotlin/TestCallbackFuture.kt @@ -0,0 +1,21 @@ +package com.lahzouz.java.graphql.client.tests + +import com.apollographql.apollo.ApolloCall +import com.apollographql.apollo.api.Response +import com.apollographql.apollo.exception.ApolloException +import java.util.concurrent.CompletableFuture + +/** + * @author Sparow199 + */ +class TestCallbackFuture(private val future: CompletableFuture>) : ApolloCall.Callback() { + + override fun onFailure(ex: ApolloException) { + future.completeExceptionally(ex) + } + + override fun onResponse(response: Response) { + future.complete(response) + } + +} diff --git a/pom.xml b/pom.xml index 6aecced..fb29f37 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ UTF-8 UTF-8 1.3 - 1.3.31 + 1.3.41 1.8 @@ -41,12 +41,6 @@ kotlin-stdlib ${kotlin-library.version} - - org.spockframework - spock-core - 1.2-groovy-2.5 - test - cglib cglib-nodep From 654ccf15bc304456758e639b425a90aea6d3b533 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Fri, 16 Aug 2019 14:31:05 +0200 Subject: [PATCH 42/82] test(*): Add AssertJ as default assertions library Update and clean dependencies section Remove contributors section(Github handle this for as) --- README.md | 12 +----- apollo-client-maven-plugin-tests/pom.xml | 40 ++++++++++--------- .../src/test/kotlin/IntegrationSpec.kt | 28 ++++++------- ...{TestCallbackFuture.kt => TestCallback.kt} | 2 +- 4 files changed, 38 insertions(+), 44 deletions(-) rename apollo-client-maven-plugin-tests/src/test/kotlin/{TestCallbackFuture.kt => TestCallback.kt} (80%) diff --git a/README.md b/README.md index 6df4e58..19676c9 100644 --- a/README.md +++ b/README.md @@ -135,14 +135,4 @@ client.newCall(new GetBooks()) }); ``` -Properties specified as nullable in the schema will have an java 8 `java.util.optional` type. - -## Contributors - -- Andrew Potter => apottere -- William Yu => wiyu -- Moncef AOUDIA => sparow199 -- Ryan Gardner => ryangardner -- Abdullah Diab => mpcabd -- Unknown => ddekkers -- Unknown => mgrossmanexp +Properties specified as nullable in the schema will have an java 8 `java.util.optional` type. \ No newline at end of file diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 29a8e21..307d671 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -11,35 +11,40 @@ apollo-client-maven-plugin-tests jar - apollo-client-maven-plugin-tests Test for maven plugin https://github.com/Sparow199/apollo-client-maven-plugin.git + true UTF-8 UTF-8 - true - 2.0.17.Final + 1.0.2 + 1.3.3 + 3.13.2 + 6.1.3 + 5.2.4 5.5.1 + 1.7.28 + 2.0.23.Final com.apollographql.apollo apollo-runtime - 1.0.1 + ${apollo-runtime.version} com.graphql-java graphql-java-tools - 5.2.4 + ${graphql-java-tools.version} test com.graphql-java graphql-java-servlet - 6.1.3 + ${graphql-java-servlet.version} test @@ -48,6 +53,12 @@ ${undertow.version} test + + org.assertj + assertj-core + ${assertj-core.version} + test + io.undertow undertow-servlet @@ -55,24 +66,17 @@ test - org.springframework - spring-test - 5.1.4.RELEASE + org.junit.jupiter + junit-jupiter + ${junit.jupiter.version} test org.slf4j slf4j-simple - 1.7.25 - test - - - org.junit.jupiter - junit-jupiter - ${junit.jupiter.version} + ${slf4j-simple.version} test - @@ -80,7 +84,7 @@ com.github.sparow199 apollo-client-maven-plugin - 1.3.3 + ${apollo-client-maven-plugin.version} diff --git a/apollo-client-maven-plugin-tests/src/test/kotlin/IntegrationSpec.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/IntegrationSpec.kt index 3c4ab0b..f8bedf1 100644 --- a/apollo-client-maven-plugin-tests/src/test/kotlin/IntegrationSpec.kt +++ b/apollo-client-maven-plugin-tests/src/test/kotlin/IntegrationSpec.kt @@ -16,6 +16,7 @@ import io.undertow.servlet.Servlets import io.undertow.servlet.util.ImmediateInstanceFactory import okhttp3.OkHttpClient import okhttp3.Request +import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.* import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS import java.io.File @@ -51,7 +52,8 @@ class IntegrationSpec { .setClassLoader(javaClass.classLoader) .setContextPath("/") .setDeploymentName("test") - .addServlets(Servlets.servlet("GraphQLServlet", SimpleGraphQLHttpServlet::class.java, ImmediateInstanceFactory(servlet)).addMapping("/graphql/*")) + .addServlets(Servlets.servlet("GraphQLServlet", SimpleGraphQLHttpServlet::class.java, + ImmediateInstanceFactory(servlet as Servlet)).addMapping("/graphql/*")) val manager = Servlets.defaultContainer().addDeployment(servletBuilder) manager.deploy() @@ -71,7 +73,6 @@ class IntegrationSpec { override fun decode(value: CustomTypeValue<*>): Long { return (value.value as BigDecimal).toLong() } - } client = ApolloClient.builder() @@ -81,15 +82,14 @@ class IntegrationSpec { .build() } - // @AfterAll fun cleanupSpec() { server.stop() } - @Test - fun `print introspection query results`() { + @DisplayName("print introspection query results") + fun introspectionQueryTest() { val mapper = ObjectMapper() val data = mapper.readValue( OkHttpClient().newCall(Request.Builder().url("http://127.0.0.1:$port/graphql/schema.json").build()) @@ -97,26 +97,27 @@ class IntegrationSpec { .body()?.byteStream(), Map::class.java ) + assertThat(data).isNotEmpty File("src/main/graphql/schema.json").writeText(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(data["data"])) } @Test - fun `generated book query returns data`() { + @DisplayName("generated book query returns data") + fun bookQueryTest() { val future: CompletableFuture>> = CompletableFuture() - client.query(GetBooksQuery()).enqueue(TestCallbackFuture(future)) + client.query(GetBooksQuery()).enqueue(TestCallback(future)) val response = future.join() - Assertions.assertEquals(4, response.data()?.get()?.books?.size) - Assertions.assertTrue(response.data()?.get()?.books?.get(0)?.getId() is Long) - Assertions.assertTrue(response.data()?.get()?.books?.get(3)?.getId() is Long) + assertThat(response.data()?.get()?.books).isNotEmpty.hasSize(4) } @Test - fun `generated author query returns data`() { + @DisplayName("generated author query returns data") + fun authorQueryTest() { val future: CompletableFuture>> = CompletableFuture() - client.query(GetAuthorsQuery()).enqueue(TestCallbackFuture(future)) + client.query(GetAuthorsQuery()).enqueue(TestCallback(future)) val response = future.join() - Assertions.assertEquals(2, response.data()?.get()?.authors?.size) + assertThat(response.data()?.get()?.authors).isNotEmpty.hasSize(2) } private fun createServlet(schema: GraphQLSchema): SimpleGraphQLHttpServlet { @@ -124,5 +125,4 @@ class IntegrationSpec { val invocationInputFactory = GraphQLInvocationInputFactory.newBuilder(schemaProvider).build() return SimpleGraphQLHttpServlet.newBuilder(invocationInputFactory).build() } - } diff --git a/apollo-client-maven-plugin-tests/src/test/kotlin/TestCallbackFuture.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/TestCallback.kt similarity index 80% rename from apollo-client-maven-plugin-tests/src/test/kotlin/TestCallbackFuture.kt rename to apollo-client-maven-plugin-tests/src/test/kotlin/TestCallback.kt index e5b7e9b..47ad2ea 100644 --- a/apollo-client-maven-plugin-tests/src/test/kotlin/TestCallbackFuture.kt +++ b/apollo-client-maven-plugin-tests/src/test/kotlin/TestCallback.kt @@ -8,7 +8,7 @@ import java.util.concurrent.CompletableFuture /** * @author Sparow199 */ -class TestCallbackFuture(private val future: CompletableFuture>) : ApolloCall.Callback() { +class TestCallback(private val future: CompletableFuture>) : ApolloCall.Callback() { override fun onFailure(ex: ApolloException) { future.completeExceptionally(ex) From 77358320db4b661de595724fabfa1291469de12e Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Fri, 16 Aug 2019 15:19:11 +0200 Subject: [PATCH 43/82] refactor(Test): Convert AppoloCall to CompletableFuture --- .../src/test/kotlin/IntegrationSpec.kt | 11 ++----- .../src/test/kotlin/TestCallback.kt | 21 ------------- .../src/test/kotlin/extensions.kt | 31 +++++++++++++++++++ 3 files changed, 33 insertions(+), 30 deletions(-) delete mode 100644 apollo-client-maven-plugin-tests/src/test/kotlin/TestCallback.kt create mode 100644 apollo-client-maven-plugin-tests/src/test/kotlin/extensions.kt diff --git a/apollo-client-maven-plugin-tests/src/test/kotlin/IntegrationSpec.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/IntegrationSpec.kt index f8bedf1..1c916cf 100644 --- a/apollo-client-maven-plugin-tests/src/test/kotlin/IntegrationSpec.kt +++ b/apollo-client-maven-plugin-tests/src/test/kotlin/IntegrationSpec.kt @@ -1,7 +1,6 @@ package com.lahzouz.java.graphql.client.tests import com.apollographql.apollo.ApolloClient -import com.apollographql.apollo.api.Response import com.apollographql.apollo.response.CustomTypeAdapter import com.apollographql.apollo.response.CustomTypeValue import com.coxautodev.graphql.tools.SchemaParser @@ -22,8 +21,6 @@ import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS import java.io.File import java.math.BigDecimal import java.net.InetSocketAddress -import java.util.* -import java.util.concurrent.CompletableFuture import javax.servlet.Servlet @@ -105,18 +102,14 @@ class IntegrationSpec { @Test @DisplayName("generated book query returns data") fun bookQueryTest() { - val future: CompletableFuture>> = CompletableFuture() - client.query(GetBooksQuery()).enqueue(TestCallback(future)) - val response = future.join() + val response = client.query(GetBooksQuery()).toCompletableFuture().join() assertThat(response.data()?.get()?.books).isNotEmpty.hasSize(4) } @Test @DisplayName("generated author query returns data") fun authorQueryTest() { - val future: CompletableFuture>> = CompletableFuture() - client.query(GetAuthorsQuery()).enqueue(TestCallback(future)) - val response = future.join() + val response = client.query(GetAuthorsQuery()).toCompletableFuture().join() assertThat(response.data()?.get()?.authors).isNotEmpty.hasSize(2) } diff --git a/apollo-client-maven-plugin-tests/src/test/kotlin/TestCallback.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/TestCallback.kt deleted file mode 100644 index 47ad2ea..0000000 --- a/apollo-client-maven-plugin-tests/src/test/kotlin/TestCallback.kt +++ /dev/null @@ -1,21 +0,0 @@ -package com.lahzouz.java.graphql.client.tests - -import com.apollographql.apollo.ApolloCall -import com.apollographql.apollo.api.Response -import com.apollographql.apollo.exception.ApolloException -import java.util.concurrent.CompletableFuture - -/** - * @author Sparow199 - */ -class TestCallback(private val future: CompletableFuture>) : ApolloCall.Callback() { - - override fun onFailure(ex: ApolloException) { - future.completeExceptionally(ex) - } - - override fun onResponse(response: Response) { - future.complete(response) - } - -} diff --git a/apollo-client-maven-plugin-tests/src/test/kotlin/extensions.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/extensions.kt new file mode 100644 index 0000000..043e506 --- /dev/null +++ b/apollo-client-maven-plugin-tests/src/test/kotlin/extensions.kt @@ -0,0 +1,31 @@ +package com.lahzouz.java.graphql.client.tests + +import com.apollographql.apollo.ApolloCall +import com.apollographql.apollo.api.Response +import com.apollographql.apollo.exception.ApolloException +import java.util.concurrent.CompletableFuture + +/** + * @author Sparow199 + */ +fun ApolloCall.toCompletableFuture(): CompletableFuture> { + val completableFuture = CompletableFuture>() + + completableFuture.whenComplete { _, _ -> + if (completableFuture.isCancelled) { + cancel() + } + } + + enqueue(object : ApolloCall.Callback() { + override fun onResponse(response: Response) { + completableFuture.complete(response) + } + + override fun onFailure(e: ApolloException) { + completableFuture.completeExceptionally(e) + } + }) + + return completableFuture +} From e8809e5fe537ba203371e43ea0014560c18b9176 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Sat, 17 Aug 2019 12:48:01 +0200 Subject: [PATCH 44/82] fix(CircleCi): filters on deploy job --- .circleci/config.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7f119dd..8c1c539 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,10 @@ version: 2 +general: + branches: + only: + - master + - develop + - /feature/.*/ jobs: build: docker: @@ -59,17 +65,14 @@ workflows: version: 2 build-deploy: jobs: - - build: - filters: - branches: - only: - - master - - develop + - build - deploy: requires: - build filters: + # ignore any commit on any branch by default + branches: + ignore: /.*/ + # only act on version tags tags: only: /^v\d+\.\d+\.\d+$/ - branches: - only: master From f8111ecdd06639840a30ad5c8af6952db15fc634 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Sun, 1 Sep 2019 23:49:42 +0200 Subject: [PATCH 45/82] feat(*): Upgrade to Apollo compiler v1.1.1 Replace node Apollo Codegen with new local engine based on ANTLR parser --- .circleci/config.yml | 24 ++- .mvn/wrapper/maven-wrapper.properties | 2 +- README.md | 16 +- apollo-client-maven-plugin-tests/pom.xml | 63 ++++++-- ...Spec.kt => ApolloClientMavenPluginTest.kt} | 4 +- apollo-client-maven-plugin/pom.xml | 63 ++------ .../client/maven/plugin/GraphQLClientMojo.kt | 134 +++++----------- .../client/maven/plugin/Introspection.kt | 145 ++++++++++++++++++ mvnw | 0 pom.xml | 59 ++----- scripts/install_nodejs.sh | 18 --- 11 files changed, 283 insertions(+), 245 deletions(-) rename apollo-client-maven-plugin-tests/src/test/kotlin/{IntegrationSpec.kt => ApolloClientMavenPluginTest.kt} (96%) create mode 100644 apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt mode change 100644 => 100755 mvnw delete mode 100644 scripts/install_nodejs.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 8c1c539..68a0dfb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,11 +14,6 @@ jobs: MAVEN_OPTS: -Xmx3200m steps: - checkout - - run: - name: install node via NVM - command: | - chmod +x ./scripts/install_nodejs.sh - ./scripts/install_nodejs.sh - restore_cache: keys: - v1-dependencies-{{ checksum "pom.xml" }} @@ -30,7 +25,7 @@ jobs: paths: - ~/.m2 key: v1-dependencies-{{ checksum "pom.xml" }} - - run: mvn test integration-test + - run: mvn clean test deploy: docker: @@ -40,11 +35,6 @@ jobs: MAVEN_OPTS: -Xmx3200m steps: - checkout - - run: - name: install node via NVM - command: | - chmod +x ./scripts/install_nodejs.sh - ./scripts/install_nodejs.sh - restore_cache: keys: - v1-dependencies-{{ checksum "pom.xml" }} @@ -65,14 +55,18 @@ workflows: version: 2 build-deploy: jobs: - - build + - build: + filters: + tags: + only: /.*/ - deploy: requires: - build filters: - # ignore any commit on any branch by default - branches: - ignore: /.*/ # only act on version tags tags: only: /^v\d+\.\d+\.\d+$/ + # ignore any commit on any branch by default + branches: + ignore: /.*/ + diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index 7179346..cd0d451 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -1 +1 @@ -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip diff --git a/README.md b/README.md index 19676c9..5b73e74 100644 --- a/README.md +++ b/README.md @@ -13,25 +13,23 @@ A full usage example can be found in the [test project](https://github.com/sparo ### Getting Started -**NOTE: This plugin requires a nodejs environment to execute the bundled apollo-codegen node module.** - -1. Add the apollo runtime library and guava to your project's depedencies: +1. Add the apollo runtime library to your project's dependencies: ```xml com.apollographql.apollo apollo-runtime - 1.0.2 + 1.1.1 ``` -2. Add the code generator plugin to your project's build (if codegen is desired): +2. Add the code generator plugin to your project's build: ```xml com.github.sparow199 apollo-client-maven-plugin - 1.3.3 + 2.0.0 @@ -65,7 +63,9 @@ All plugin options and their defaults: com.example.graphql.client ${project.basedir}/src/main/graphql/schema.json false + ${project.basedir}/src/main/graphql http://localhost + com.example.graphql.client com.example.graphql.client ${project.build.directory}/generated-sources/graphql-client true @@ -73,9 +73,9 @@ All plugin options and their defaults: true JAVA_OPTIONAL false - false - node + false + ``` diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 307d671..8fb199d 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 1.3.3 + 2.0.0 .. @@ -16,11 +16,14 @@ https://github.com/Sparow199/apollo-client-maven-plugin.git - true UTF-8 UTF-8 - 1.0.2 - 1.3.3 + + 2.22.1 + true + + 2.0.0 + 1.1.1 3.13.2 6.1.3 5.2.4 @@ -80,6 +83,7 @@ + ${project.basedir}/src/test/kotlin com.github.sparow199 @@ -93,32 +97,59 @@ false true - com.lahzouz.java.graphql.client.tests + false + ${project.basedir}/src/main/graphql ${project.basedir}/src/main/graphql/schema.json + com.lahzouz.java.graphql.client.tests com.lahzouz.java.graphql.client.tests - ${project.build.directory}/generated-sources/graphql-client - + ${project.build.directory}/generated-sources/graphql-client true true true JAVA_OPTIONAL false + false + false java.lang.Long - false - node + + kotlin-maven-plugin + org.jetbrains.kotlin + ${kotlin.version} + + + compile + process-sources + + compile + + + + test-compile + + test-compile + + + + ${project.basedir}/src/test/kotlin + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + false + + - - - - jcenter - https://jcenter.bintray.com/ - - \ No newline at end of file diff --git a/apollo-client-maven-plugin-tests/src/test/kotlin/IntegrationSpec.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt similarity index 96% rename from apollo-client-maven-plugin-tests/src/test/kotlin/IntegrationSpec.kt rename to apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt index 1c916cf..52494e3 100644 --- a/apollo-client-maven-plugin-tests/src/test/kotlin/IntegrationSpec.kt +++ b/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt @@ -28,7 +28,7 @@ import javax.servlet.Servlet * @author Sparow199 */ @TestInstance(PER_CLASS) -class IntegrationSpec { +class ApolloClientMavenPluginTest { private lateinit var server: Undertow private var port: Int = 0 @@ -96,7 +96,7 @@ class IntegrationSpec { ) assertThat(data).isNotEmpty - File("src/main/graphql/schema.json").writeText(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(data["data"])) +// File("src/main/graphql/schema.json").writeText(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(data)) } @Test diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index f0b16f1..14181fd 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -1,10 +1,11 @@ - + 4.0.0 com.github.sparow199 apollo-client-maven-plugin-parent - 1.3.3 + 2.0.0 .. @@ -14,12 +15,11 @@ UTF-8 UTF-8 - 3.6.0 + + 3.6.0 2.2.1 - 1.0.2 - 2.6 - 0.9.11 - 1.6.0 + 1.1.1 + 4.5.9 apollo-client-maven-plugin @@ -30,12 +30,12 @@ org.apache.maven maven-plugin-api - ${maven-plugin-api.version} + ${maven-plugin.version} org.apache.maven.plugin-tools maven-plugin-annotations - ${maven-plugin-api.version} + ${maven-plugin.version} provided @@ -43,54 +43,15 @@ maven-project ${maven-project.version} - com.apollographql.apollo apollo-compiler ${apollo-compiler.version} - org.reflections - reflections - ${reflections.version} + org.apache.httpcomponents + httpclient + ${httpclient.version} - - - - - ${project.build.directory}/node_modules - node_modules - - - - - org.codehaus.mojo - exec-maven-plugin - ${exec-maven-plugin.version} - - - generate-resources - - exec - - - - - npm - ${project.build.directory} - - install - apollo-codegen@0.19.1 - - - - - - - - jcenter - https://jcenter.bintray.com/ - - \ No newline at end of file diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index e8d7c83..14969a9 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -2,6 +2,9 @@ package com.lahzouz.java.graphql.client.maven.plugin import com.apollographql.apollo.compiler.GraphQLCompiler import com.apollographql.apollo.compiler.NullableValueType +import com.apollographql.apollo.compiler.parser.GraphQLDocumentParser +import com.apollographql.apollo.compiler.parser.Schema +import com.lahzouz.java.graphql.client.maven.plugin.Introspection.getIntrospectionSchema import org.apache.maven.plugin.AbstractMojo import org.apache.maven.plugin.MojoExecutionException import org.apache.maven.plugins.annotations.LifecyclePhase @@ -9,18 +12,13 @@ import org.apache.maven.plugins.annotations.Mojo import org.apache.maven.plugins.annotations.Parameter import org.apache.maven.plugins.annotations.ResolutionScope import org.apache.maven.project.MavenProject -import org.codehaus.plexus.util.FileUtils -import org.reflections.Reflections -import org.reflections.scanners.ResourcesScanner -import org.reflections.util.ConfigurationBuilder import java.io.File import java.nio.file.Files -import java.util.regex.Pattern import java.util.stream.Collectors /** - * Generate classes for a graphql API + * Generate queries classes for a GraphQl API */ @Mojo(name = "generate", requiresDependencyCollection = ResolutionScope.COMPILE, @@ -39,12 +37,18 @@ class GraphQLClientMojo : AbstractMojo() { @Parameter(readonly = true, property = "introspectionFile", defaultValue = "\${project.basedir}/src/main/graphql/schema.json") lateinit var introspectionFile: File - @Parameter(property = "basePackage", defaultValue = "com.example.graphql.client") - private lateinit var basePackage: String + @Parameter(property = "irPackageName", defaultValue = "com.example.graphql.client") + private lateinit var irPackageName: String @Parameter(property = "outputPackage", defaultValue = "com.example.graphql.client") private lateinit var outputPackage: String + @Parameter(property = "schemaUrl", defaultValue = "http://localhost") + private lateinit var schemaUrl: String + + @Parameter(property = "sourceDirName", defaultValue = "\${project.basedir}/src/main/graphql") + private lateinit var sourceDirName: String + @Parameter(property = "customTypeMap") private var customTypeMap: Map = emptyMap() @@ -54,9 +58,6 @@ class GraphQLClientMojo : AbstractMojo() { @Parameter(property = "generateIntrospectionFile", defaultValue = "false") private var generateIntrospectionFile: Boolean = false - @Parameter(property = "schemaUrl", defaultValue = "http://localhost") - private lateinit var schemaUrl: String - @Parameter(property = "skip", defaultValue = "false") private var skip: Boolean = false @@ -76,10 +77,10 @@ class GraphQLClientMojo : AbstractMojo() { private var useJavaBeansSemanticNaming: Boolean = true @Parameter(property = "generateKotlinModels", defaultValue = "false") - private var generateKotlinModels: Boolean = true + private var generateKotlinModels: Boolean = false - @Parameter(property = "nodeExecutable", defaultValue = "node") - private lateinit var nodeExecutable: String + @Parameter(property = "generateVisitorForPolymorphicDatatypes", defaultValue = "false") + private var generateVisitorForPolymorphicDatatypes: Boolean = true @Throws(MojoExecutionException::class) override fun execute() { @@ -89,114 +90,63 @@ class GraphQLClientMojo : AbstractMojo() { return } - val nodeModules = File(project.build.directory, joinPath("apollo-codegen-node-modules", "node_modules")) - nodeModules.deleteRecursively() - nodeModules.mkdirs() - - val nodeModuleResources = Reflections(ConfigurationBuilder().setScanners(ResourcesScanner()) - .setUrls(javaClass.getResource("/node_modules"))) - .getResources(Pattern.compile(".*")) - - nodeModuleResources.map { "/$it" }.forEach { resource -> - val path = resource.replaceFirst("/node_modules/", "").replace("/", File.separator) - val diskPath = File(nodeModules, path) - diskPath.parentFile.mkdirs() - FileUtils.copyURLToFile(javaClass.getResource(resource), diskPath) - } - - val apolloCli = File(nodeModules, joinPath("apollo-codegen", "lib", "cli.js")) - apolloCli.setExecutable(true) - - if (!apolloCli.isFile) { - throw MojoExecutionException("Apollo codegen cli not found: '${apolloCli.absolutePath}'") - } - - if (generateIntrospectionFile) { - log.info("Automatically generating introspection file") - val arguments = listOf("introspect-schema", schemaUrl, "--output", introspectionFile.absolutePath) - log.info("Running apollo cli (${apolloCli.absolutePath}) with arguments: ${arguments.joinToString(" ")}") - - val proc = ProcessBuilder(nodeExecutable, apolloCli.absolutePath, *arguments.toTypedArray()) - .directory(nodeModules.parentFile) - .inheritIO() - .start() - - if (proc.waitFor() != 0) { - throw MojoExecutionException("Apollo codegen cli command failed") - } - - } - log.info("Apollo GraphQL Client Code Generation task started") - val basePackageDirName = basePackage.replace('.', File.separatorChar) - val sourceDirName = joinPath("src", "main", "graphql") - val queryDir = File(project.basedir, sourceDirName) + val queryDir = File(sourceDirName) + if (!queryDir.isDirectory) { throw MojoExecutionException("'${queryDir.absolutePath}' must be a directory") } - log.info("Read queries started") + log.info("Read queries files") val queries = Files.walk(queryDir.toPath()) .filter { it.toFile().isFile && it.toFile().name.endsWith(".graphql") } - .map { it.toFile().relativeTo(queryDir) } + .map { it.toFile() } .collect(Collectors.toList()) + if (queries.isEmpty()) { throw MojoExecutionException("No queries found under '${queryDir.absolutePath}") } - val baseTargetDir = File(project.build.directory, joinPath("graphql-schema", sourceDirName, - basePackageDirName)) - val schema = File(baseTargetDir, "schema.json") - - if (!introspectionFile.isFile) { - throw MojoExecutionException("Introspection JSON not found: ${introspectionFile.absolutePath}") + if (generateIntrospectionFile) { + log.info("Automatically generating introspection file from $schemaUrl") + val schema = getIntrospectionSchema(schemaUrl) + if (schema.isNotEmpty()) { + File(introspectionFile.toURI()).writeText(schema) + } else { + throw MojoExecutionException("Error, can't generate introspection schema file from: $schemaUrl") + } } - schema.parentFile.mkdirs() - queries.forEach { query -> - val src = File(queryDir, query.path) - val dest = File(baseTargetDir, query.path) - - dest.parentFile.mkdirs() - src.copyTo(dest, overwrite = true) + if (!introspectionFile.isFile) { + throw MojoExecutionException("Introspection schema file not found: ${introspectionFile.absolutePath}") } - val arguments = listOf("generate", *queries.map { File(baseTargetDir, it.path).absolutePath } - .toTypedArray(), "--target", "json", "--schema", introspectionFile.absolutePath, - "--output", schema.absolutePath) - - log.info("Running apollo cli (${apolloCli.absolutePath}) with arguments: ${arguments.joinToString(" ")}") - - val proc = ProcessBuilder(nodeExecutable, apolloCli.absolutePath, *arguments.toTypedArray()) - .directory(nodeModules.parentFile) - .inheritIO() - .start() - - if (proc.waitFor() != 0) { - throw MojoExecutionException("Apollo codegen cli command failed") - } + val graphQLDocumentParser = GraphQLDocumentParser(Schema(introspectionFile)) + val ir = graphQLDocumentParser.parse(queries) val compiler = GraphQLCompiler() compiler.write(GraphQLCompiler.Arguments( - irFile = schema, + irFile = introspectionFile, + ir = ir, outputDir = outputDirectory, customTypeMap = customTypeMap, nullableValueType = nullableValueType, useSemanticNaming = useSemanticNaming, generateModelBuilder = generateModelBuilder, - generateKotlinModels = generateKotlinModels, - suppressRawTypesWarning = suppressRawTypesWarning, useJavaBeansSemanticNaming = useJavaBeansSemanticNaming, - outputPackageName = outputPackage)) + irPackageName = irPackageName, + outputPackageName = outputPackage, + suppressRawTypesWarning = suppressRawTypesWarning, + generateKotlinModels = generateKotlinModels, + generateVisitorForPolymorphicDatatypes = generateVisitorForPolymorphicDatatypes) + ) if (addSourceRoot) { + log.info("Add the compiled sources to project root") project.addCompileSourceRoot(outputDirectory.absolutePath) } log.info("Apollo GraphQL Client Code Generation task finished") } - private fun joinPath(vararg names: String): String = names.joinToString(File.separator) -} - - +} diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt new file mode 100644 index 0000000..46feeec --- /dev/null +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt @@ -0,0 +1,145 @@ +package com.lahzouz.java.graphql.client.maven.plugin + +import org.apache.http.HttpHeaders +import org.apache.http.client.entity.GzipDecompressingEntity +import org.apache.http.client.methods.HttpPost +import org.apache.http.entity.StringEntity +import org.apache.http.impl.client.HttpClients +import org.apache.http.util.EntityUtils +import java.nio.charset.Charset + + +object Introspection { + + fun getIntrospectionSchema(host: String): String { + val client = HttpClients.custom() + .disableContentCompression() + .build() + val request = HttpPost(host); + val body = StringEntity(introspectionQuery) + + request.apply { + entity = body + setHeader(HttpHeaders.ACCEPT, "application/json") + setHeader(HttpHeaders.CONTENT_TYPE, "application/json") + setHeader(HttpHeaders.ACCEPT_ENCODING, "gzip, identity") + setHeader(HttpHeaders.ACCEPT_CHARSET, "utf-8") + setHeader(HttpHeaders.USER_AGENT, "Apollo Client Maven Plugin") + } + val response = client.execute(request) + var schema = "" + if (200 == response.statusLine.statusCode) { + var entity = response.entity + val contentEncodingHeader = entity.contentEncoding + if (contentEncodingHeader != null) { + val encodings = contentEncodingHeader.elements + for (i in encodings.indices) { + if (encodings[i].name.equals("gzip", ignoreCase = true)) { + entity = GzipDecompressingEntity(entity) + break + } + } + } + schema = EntityUtils.toString(entity, Charset.forName("utf-8").name()) + } + client.close() + return schema + } + + private const val rawIntrospectionQuery = "\\n" + + " query IntrospectionQuery {\\n" + + " __schema {\\n" + + " queryType { name }\\n" + + " mutationType { name }\\n" + + " subscriptionType { name }\\n" + + " types {\\n" + + " ...FullType\\n" + + " }\\n" + + " directives {\\n" + + " name\\n" + + " description\\n" + + " locations\\n" + + " args {\\n" + + " ...InputValue\\n" + + " }\\n" + + " }\\n" + + " }\\n" + + " }\\n" + + "\\n" + + " fragment FullType on __Type {\\n" + + " kind\\n" + + " name\\n" + + " description\\n" + + " fields(includeDeprecated: true) {\\n" + + " name\\n" + + " description\\n" + + " args {\\n" + + " ...InputValue\\n" + + " }\\n" + + " type {\\n" + + " ...TypeRef\\n" + + " }\\n" + + " isDeprecated\\n" + + " deprecationReason\\n" + + " }\\n" + + " inputFields {\\n" + + " ...InputValue\\n" + + " }\\n" + + " interfaces {\\n" + + " ...TypeRef\\n" + + " }\\n" + + " enumValues(includeDeprecated: true) {\\n" + + " name\\n" + + " description\\n" + + " isDeprecated\\n" + + " deprecationReason\\n" + + " }\\n" + + " possibleTypes {\\n" + + " ...TypeRef\\n" + + " }\\n" + + " }\\n" + + "\\n" + + " fragment InputValue on __InputValue {\\n" + + " name\\n" + + " description\\n" + + " type { ...TypeRef }\\n" + + " defaultValue\\n" + + " }\\n" + + "\\n" + + " fragment TypeRef on __Type {\\n" + + " kind\\n" + + " name\\n" + + " ofType {\\n" + + " kind\\n" + + " name\\n" + + " ofType {\\n" + + " kind\\n" + + " name\\n" + + " ofType {\\n" + + " kind\\n" + + " name\\n" + + " ofType {\\n" + + " kind\\n" + + " name\\n" + + " ofType {\\n" + + " kind\\n" + + " name\\n" + + " ofType {\\n" + + " kind\\n" + + " name\\n" + + " ofType {\\n" + + " kind\\n" + + " name\\n" + + " }\\n" + + " }\\n" + + " }\\n" + + " }\\n" + + " }\\n" + + " }\\n" + + " }\\n" + + " }\\n" + + " " + + private const val introspectionQuery = "{\"query\": \"$rawIntrospectionQuery\",\"variables\":{},\"operationName\":introspection}" + +} \ No newline at end of file diff --git a/mvnw b/mvnw old mode 100644 new mode 100755 diff --git a/pom.xml b/pom.xml index fb29f37..aa92640 100644 --- a/pom.xml +++ b/pom.xml @@ -1,9 +1,10 @@ - + 4.0.0 com.github.sparow199 apollo-client-maven-plugin-parent - 1.3.3 + 2.0.0 pom apollo-client-maven-plugin-parent @@ -13,14 +14,17 @@ UTF-8 UTF-8 - 1.3 - 1.3.41 + 1.3.50 + true 1.8 true - + Github + 3.1.0 + 0.9.17 + 3.8.1 @@ -39,30 +43,22 @@ org.jetbrains.kotlin kotlin-stdlib - ${kotlin-library.version} - - - cglib - cglib-nodep - 3.2.10 - test + ${kotlin.version} - org.objenesis - objenesis - 3.0.1 - test + org.jetbrains.kotlin + kotlin-reflect + ${kotlin.version} ${project.basedir}/src/main/kotlin - ${project.basedir}/src/test/groovy org.apache.maven.plugins maven-compiler-plugin - 3.8.0 + ${maven-compiler-plugin.version} ${java.version} ${java.version} @@ -71,7 +67,7 @@ org.jetbrains.kotlin kotlin-maven-plugin - ${kotlin-library.version} + ${kotlin.version} compile @@ -82,27 +78,6 @@ - - org.codehaus.gmavenplus - gmavenplus-plugin - 1.6.2 - - - - compileTests - - - - - - org.apache.maven.plugins - maven-release-plugin - 2.5.3 - - @{project.version} - false - - @@ -114,7 +89,7 @@ org.apache.maven.plugins maven-source-plugin - 3.0.1 + ${maven-source-plugin.version} attach-sources @@ -128,7 +103,7 @@ org.jetbrains.dokka dokka-maven-plugin - 0.9.17 + ${dokka-maven-plugin.version} package diff --git a/scripts/install_nodejs.sh b/scripts/install_nodejs.sh deleted file mode 100644 index 82aa801..0000000 --- a/scripts/install_nodejs.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash -# Activate nvm -export NVM_DIR=$HOME/.nvm -touch $HOME/.nvmrc -source $NVM_DIR/nvm.sh -# Use node 8.9 -nvm install 8.9 && nvm alias default 8.9 -echo 8.9 > $HOME/.nvmrc -# Enable nvm in following steps -echo "export NVM_DIR=$HOME/.nvm" >> $BASH_ENV -echo "source $NVM_DIR/nvm.sh" >> $BASH_ENV -# To fix npm install : "node-pre-gyp: Permission denied" -npm config set user 0 -npm config set unsafe-perm true -node --version -npm --version \ No newline at end of file From 86a7b6885007ca65e32a0abf80f72f3bdc4c383d Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Mon, 2 Sep 2019 00:33:10 +0200 Subject: [PATCH 46/82] version(*): Bump version to 2.0.1-SNAPSHOT --- apollo-client-maven-plugin-tests/pom.xml | 4 ++-- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 8fb199d..e86e3a7 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.0.0 + 2.0.1-SNAPSHOT .. @@ -22,7 +22,7 @@ 2.22.1 true - 2.0.0 + 2.0.1-SNAPSHOT 1.1.1 3.13.2 6.1.3 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 14181fd..3b47d41 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.0.0 + 2.0.1-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index aa92640..9df55cf 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.0.0 + 2.0.1-SNAPSHOT pom apollo-client-maven-plugin-parent From f343e56f00fa2c986a85ff68cf20b0a84f7480d5 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Mon, 2 Sep 2019 23:06:35 +0200 Subject: [PATCH 47/82] docs(*): Update documentation Clean the Mojo --- README.md | 38 ++++++++++++++++++- .../kotlin/ApolloClientMavenPluginTest.kt | 2 +- .../client/maven/plugin/GraphQLClientMojo.kt | 28 +++++++------- 3 files changed, 51 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 5b73e74..066cf5b 100644 --- a/README.md +++ b/README.md @@ -64,9 +64,9 @@ All plugin options and their defaults: ${project.basedir}/src/main/graphql/schema.json false ${project.basedir}/src/main/graphql - http://localhost + http://localhost/graphql com.example.graphql.client - com.example.graphql.client + com.example.graphql.client ${project.build.directory}/generated-sources/graphql-client true true @@ -135,4 +135,38 @@ client.newCall(new GetBooks()) }); ``` +#### Wrap ApolloCall with a CompletableFuture + +If you miss **apolloCall.execute** method, which execute a query synchronously, you could wrap **apolloCall.enqueue** +with a CompletableFuture and call **join** method to wait for the response + +```java +public class ApolloClientUtils { + + public static CompletableFuture> toCompletableFuture(ApolloCall apolloCall) { + CompletableFuture> completableFuture = new CompletableFuture<>(); + + completableFuture.whenComplete((tResponse, throwable) -> { + if (completableFuture.isCancelled()) { + completableFuture.cancel(true); + } + }); + + apolloCall.enqueue(new ApolloCall.Callback() { + @Override + public void onResponse(@NotNull Response response) { + completableFuture.complete(response); + } + + @Override + public void onFailure(@NotNull ApolloException e) { + completableFuture.completeExceptionally(e); + } + }); + + return completableFuture; + } +} +``` + Properties specified as nullable in the schema will have an java 8 `java.util.optional` type. \ No newline at end of file diff --git a/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt index 52494e3..ceaa9f5 100644 --- a/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt +++ b/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt @@ -96,7 +96,7 @@ class ApolloClientMavenPluginTest { ) assertThat(data).isNotEmpty -// File("src/main/graphql/schema.json").writeText(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(data)) + File("src/main/graphql/schema.json").writeText(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(data)) } @Test diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index 14969a9..346ffa4 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -32,10 +32,10 @@ class GraphQLClientMojo : AbstractMojo() { private lateinit var project: MavenProject @Parameter(property = "outputDirectory", defaultValue = "\${project.build.directory}/generated-sources/graphql-client") - lateinit var outputDirectory: File + private lateinit var outputDirectory: File - @Parameter(readonly = true, property = "introspectionFile", defaultValue = "\${project.basedir}/src/main/graphql/schema.json") - lateinit var introspectionFile: File + @Parameter(property = "introspectionFile", defaultValue = "\${project.basedir}/src/main/graphql/schema.json") + private lateinit var introspectionFile: File @Parameter(property = "irPackageName", defaultValue = "com.example.graphql.client") private lateinit var irPackageName: String @@ -43,7 +43,7 @@ class GraphQLClientMojo : AbstractMojo() { @Parameter(property = "outputPackage", defaultValue = "com.example.graphql.client") private lateinit var outputPackage: String - @Parameter(property = "schemaUrl", defaultValue = "http://localhost") + @Parameter(property = "schemaUrl", defaultValue = "http://localhost/graphql") private lateinit var schemaUrl: String @Parameter(property = "sourceDirName", defaultValue = "\${project.basedir}/src/main/graphql") @@ -53,33 +53,33 @@ class GraphQLClientMojo : AbstractMojo() { private var customTypeMap: Map = emptyMap() @Parameter(property = "nullableValueType", defaultValue = "JAVA_OPTIONAL") - private var nullableValueType: NullableValueType = NullableValueType.JAVA_OPTIONAL + private lateinit var nullableValueType: NullableValueType - @Parameter(property = "generateIntrospectionFile", defaultValue = "false") + @Parameter(property = "generateIntrospectionFile") private var generateIntrospectionFile: Boolean = false - @Parameter(property = "skip", defaultValue = "false") + @Parameter(property = "skip") private var skip: Boolean = false - @Parameter(property = "addSourceRoot", defaultValue = "true") + @Parameter(property = "addSourceRoot") private var addSourceRoot: Boolean = true - @Parameter(property = "useSemanticNaming", defaultValue = "true") + @Parameter(property = "useSemanticNaming") private var useSemanticNaming: Boolean = true - @Parameter(property = "generateModelBuilder", defaultValue = "true") + @Parameter(property = "generateModelBuilder") private var generateModelBuilder: Boolean = true - @Parameter(property = "suppressRawTypesWarning", defaultValue = "false") + @Parameter(property = "suppressRawTypesWarning") private var suppressRawTypesWarning: Boolean = false - @Parameter(property = "useJavaBeansSemanticNaming", defaultValue = "true") + @Parameter(property = "useJavaBeansSemanticNaming") private var useJavaBeansSemanticNaming: Boolean = true - @Parameter(property = "generateKotlinModels", defaultValue = "false") + @Parameter(property = "generateKotlinModels") private var generateKotlinModels: Boolean = false - @Parameter(property = "generateVisitorForPolymorphicDatatypes", defaultValue = "false") + @Parameter(property = "generateVisitorForPolymorphicDatatypes") private var generateVisitorForPolymorphicDatatypes: Boolean = true @Throws(MojoExecutionException::class) From 47951210323d4960108bd77b89cb43066a540d3c Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Thu, 5 Sep 2019 21:57:25 +0200 Subject: [PATCH 48/82] fix(Introspection): Missing double quotes on query name --- .../lahzouz/java/graphql/client/maven/plugin/Introspection.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt index 46feeec..a0ae350 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt @@ -140,6 +140,6 @@ object Introspection { " }\\n" + " " - private const val introspectionQuery = "{\"query\": \"$rawIntrospectionQuery\",\"variables\":{},\"operationName\":introspection}" + private const val introspectionQuery = "{\"query\": \"$rawIntrospectionQuery\",\"variables\":{},\"operationName\":\"introspection\"}" } \ No newline at end of file From b1eff128b1ed3f78e2cb009f7eb6c648c17323a8 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Sun, 13 Oct 2019 22:04:27 +0200 Subject: [PATCH 49/82] refactor(*): Upgrade to Apollo compiler 1.2.0 fix #10 close #3 close #9 --- README.md | 30 +- apollo-client-maven-plugin-tests/pom.xml | 12 +- .../src/main/graphql/schema.json | 1634 +++++++++-------- .../kotlin/ApolloClientMavenPluginTest.kt | 4 +- apollo-client-maven-plugin/pom.xml | 6 +- .../client/maven/plugin/GraphQLClientMojo.kt | 34 +- pom.xml | 2 +- 7 files changed, 876 insertions(+), 846 deletions(-) diff --git a/README.md b/README.md index 066cf5b..486bb69 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,23 @@ A full usage example can be found in the [test project](https://github.com/sparo 1. Add the apollo runtime library to your project's dependencies: ```xml - - com.apollographql.apollo - apollo-runtime - 1.1.1 - + + + com.apollographql.apollo + apollo-runtime + 1.2.0 + + + org.jetbrains + annotations + 17.0.0 + + + org.jetbrains.kotlin + kotlin-reflect + 1.3.50 + + ``` 2. Add the code generator plugin to your project's build: @@ -29,7 +41,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 2.0.0 + 2.1.0 @@ -62,11 +74,13 @@ All plugin options and their defaults: true com.example.graphql.client ${project.basedir}/src/main/graphql/schema.json + false + ${project.build.directory}/generated-sources/graphql-client/transformedQueries false ${project.basedir}/src/main/graphql http://localhost/graphql - com.example.graphql.client - com.example.graphql.client + com.example.graphql.client + schema ${project.build.directory}/generated-sources/graphql-client true true diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index e86e3a7..b6f951e 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.0.1-SNAPSHOT + 2.1.0 .. @@ -22,8 +22,8 @@ 2.22.1 true - 2.0.1-SNAPSHOT - 1.1.1 + 2.1.0 + 1.2.0 3.13.2 6.1.3 5.2.4 @@ -100,8 +100,10 @@ false ${project.basedir}/src/main/graphql ${project.basedir}/src/main/graphql/schema.json - com.lahzouz.java.graphql.client.tests - com.lahzouz.java.graphql.client.tests + false + ${project.build.directory}/generated-sources/graphql-client/transformed + com.lahzouz.java.graphql.client.tests + schema ${project.build.directory}/generated-sources/graphql-client true true diff --git a/apollo-client-maven-plugin-tests/src/main/graphql/schema.json b/apollo-client-maven-plugin-tests/src/main/graphql/schema.json index d5fd933..bcbe07f 100644 --- a/apollo-client-maven-plugin-tests/src/main/graphql/schema.json +++ b/apollo-client-maven-plugin-tests/src/main/graphql/schema.json @@ -1,171 +1,305 @@ { - "__schema" : { - "queryType" : { - "name" : "Query" - }, - "mutationType" : null, - "subscriptionType" : null, - "types" : [ { - "kind" : "OBJECT", - "name" : "Query", - "description" : "", - "fields" : [ { - "name" : "books", + "data" : { + "__schema" : { + "queryType" : { + "name" : "Query" + }, + "mutationType" : null, + "subscriptionType" : null, + "types" : [ { + "kind" : "OBJECT", + "name" : "Query", "description" : "", - "args" : [ ], - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { - "kind" : "LIST", + "fields" : [ { + "name" : "books", + "description" : "", + "args" : [ ], + "type" : { + "kind" : "NON_NULL", "name" : null, "ofType" : { - "kind" : "NON_NULL", + "kind" : "LIST", "name" : null, "ofType" : { - "kind" : "OBJECT", - "name" : "Book" + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "Book" + } } } - } - }, - "isDeprecated" : false, - "deprecationReason" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "authors", + "description" : "", + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "Author" + } + } + } + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null }, { - "name" : "authors", + "kind" : "OBJECT", + "name" : "Book", "description" : "", - "args" : [ ], - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { - "kind" : "LIST", + "fields" : [ { + "name" : "title", + "description" : "", + "args" : [ ], + "type" : { + "kind" : "NON_NULL", "name" : null, "ofType" : { - "kind" : "NON_NULL", + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "author", + "description" : "", + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "Author", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "id", + "description" : "", + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "Long", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "SCALAR", + "name" : "String", + "description" : "Built-in String", + "fields" : null, + "inputFields" : null, + "interfaces" : null, + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "SCALAR", + "name" : "Long", + "description" : "Long type", + "fields" : null, + "inputFields" : null, + "interfaces" : null, + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "OBJECT", + "name" : "Author", + "description" : "", + "fields" : [ { + "name" : "name", + "description" : "", + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "OBJECT", + "name" : "__Schema", + "description" : "A GraphQL Introspection defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, the entry points for query, mutation, and subscription operations.", + "fields" : [ { + "name" : "types", + "description" : "A list of all types supported by this server.", + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "LIST", "name" : null, "ofType" : { - "kind" : "OBJECT", - "name" : "Author" + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__Type" + } } } - } - }, - "isDeprecated" : false, - "deprecationReason" : null - } ], - "inputFields" : null, - "interfaces" : [ ], - "enumValues" : null, - "possibleTypes" : null - }, { - "kind" : "OBJECT", - "name" : "Book", - "description" : "", - "fields" : [ { - "name" : "title", - "description" : "", - "args" : [ ], - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { - "kind" : "SCALAR", - "name" : "String", + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "queryType", + "description" : "The type that query operations will be rooted at.", + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__Type", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "mutationType", + "description" : "If this server supports mutation, the type that mutation operations will be rooted at.", + "args" : [ ], + "type" : { + "kind" : "OBJECT", + "name" : "__Type", "ofType" : null - } - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "author", - "description" : "", - "args" : [ ], - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "directives", + "description" : "'A list of all directives supported by this server.", + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__Directive" + } + } + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "subscriptionType", + "description" : "'If this server support subscription, the type that subscription operations will be rooted at.", + "args" : [ ], + "type" : { "kind" : "OBJECT", - "name" : "Author", + "name" : "__Type", "ofType" : null - } - }, - "isDeprecated" : false, - "deprecationReason" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null }, { - "name" : "id", - "description" : "", - "args" : [ ], - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { + "kind" : "OBJECT", + "name" : "__Type", + "description" : null, + "fields" : [ { + "name" : "kind", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "ENUM", + "name" : "__TypeKind", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "name", + "description" : null, + "args" : [ ], + "type" : { "kind" : "SCALAR", - "name" : "Long", + "name" : "String", "ofType" : null - } - }, - "isDeprecated" : false, - "deprecationReason" : null - } ], - "inputFields" : null, - "interfaces" : [ ], - "enumValues" : null, - "possibleTypes" : null - }, { - "kind" : "SCALAR", - "name" : "String", - "description" : "Built-in String", - "fields" : null, - "inputFields" : null, - "interfaces" : null, - "enumValues" : null, - "possibleTypes" : null - }, { - "kind" : "SCALAR", - "name" : "Long", - "description" : "Long type", - "fields" : null, - "inputFields" : null, - "interfaces" : null, - "enumValues" : null, - "possibleTypes" : null - }, { - "kind" : "OBJECT", - "name" : "Author", - "description" : "", - "fields" : [ { - "name" : "name", - "description" : "", - "args" : [ ], - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "description", + "description" : null, + "args" : [ ], + "type" : { "kind" : "SCALAR", "name" : "String", "ofType" : null - } - }, - "isDeprecated" : false, - "deprecationReason" : null - } ], - "inputFields" : null, - "interfaces" : [ ], - "enumValues" : null, - "possibleTypes" : null - }, { - "kind" : "OBJECT", - "name" : "__Schema", - "description" : "A GraphQL Introspection defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, the entry points for query, mutation, and subscription operations.", - "fields" : [ { - "name" : "types", - "description" : "A list of all types supported by this server.", - "args" : [ ], - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "fields", + "description" : null, + "args" : [ { + "name" : "includeDeprecated", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Boolean", + "ofType" : null + }, + "defaultValue" : "false" + } ], + "type" : { "kind" : "LIST", "name" : null, "ofType" : { @@ -173,47 +307,18 @@ "name" : null, "ofType" : { "kind" : "OBJECT", - "name" : "__Type" + "name" : "__Field", + "ofType" : null } } - } - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "queryType", - "description" : "The type that query operations will be rooted at.", - "args" : [ ], - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { - "kind" : "OBJECT", - "name" : "__Type", - "ofType" : null - } - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "mutationType", - "description" : "If this server supports mutation, the type that mutation operations will be rooted at.", - "args" : [ ], - "type" : { - "kind" : "OBJECT", - "name" : "__Type", - "ofType" : null - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "directives", - "description" : "'A list of all directives supported by this server.", - "args" : [ ], - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "interfaces", + "description" : null, + "args" : [ ], + "type" : { "kind" : "LIST", "name" : null, "ofType" : { @@ -221,106 +326,201 @@ "name" : null, "ofType" : { "kind" : "OBJECT", - "name" : "__Directive" + "name" : "__Type", + "ofType" : null } } - } - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "subscriptionType", - "description" : "'If this server support subscription, the type that subscription operations will be rooted at.", - "args" : [ ], - "type" : { - "kind" : "OBJECT", - "name" : "__Type", - "ofType" : null - }, - "isDeprecated" : false, - "deprecationReason" : null - } ], - "inputFields" : null, - "interfaces" : [ ], - "enumValues" : null, - "possibleTypes" : null - }, { - "kind" : "OBJECT", - "name" : "__Type", - "description" : null, - "fields" : [ { - "name" : "kind", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { - "kind" : "ENUM", - "name" : "__TypeKind", + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "possibleTypes", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__Type", + "ofType" : null + } + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "enumValues", + "description" : null, + "args" : [ { + "name" : "includeDeprecated", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "Boolean", + "ofType" : null + }, + "defaultValue" : "false" + } ], + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__EnumValue", + "ofType" : null + } + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "inputFields", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__InputValue", + "ofType" : null + } + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "ofType", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "OBJECT", + "name" : "__Type", "ofType" : null - } - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "name", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "SCALAR", - "name" : "String", - "ofType" : null - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "description", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "SCALAR", - "name" : "String", - "ofType" : null - }, - "isDeprecated" : false, - "deprecationReason" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "ENUM", + "name" : "__TypeKind", + "description" : "An enum describing what kind of type a given __Type is", + "fields" : null, + "inputFields" : null, + "interfaces" : null, + "enumValues" : [ { + "name" : "SCALAR", + "description" : "Indicates this type is a scalar.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "OBJECT", + "description" : "Indicates this type is an object. `fields` and `interfaces` are valid fields.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "INTERFACE", + "description" : "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "UNION", + "description" : "Indicates this type is a union. `possibleTypes` is a valid field.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "ENUM", + "description" : "Indicates this type is an enum. `enumValues` is a valid field.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "INPUT_OBJECT", + "description" : "Indicates this type is an input object. `inputFields` is a valid field.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "LIST", + "description" : "Indicates this type is a list. `ofType` is a valid field.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "NON_NULL", + "description" : "Indicates this type is a non-null. `ofType` is a valid field.", + "isDeprecated" : false, + "deprecationReason" : null + } ], + "possibleTypes" : null }, { - "name" : "fields", + "kind" : "OBJECT", + "name" : "__Field", "description" : null, - "args" : [ { - "name" : "includeDeprecated", + "fields" : [ { + "name" : "name", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "description", "description" : null, + "args" : [ ], "type" : { "kind" : "SCALAR", - "name" : "Boolean", + "name" : "String", "ofType" : null }, - "defaultValue" : "false" - } ], - "type" : { - "kind" : "LIST", - "name" : null, - "ofType" : { + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "args", + "description" : null, + "args" : [ ], + "type" : { "kind" : "NON_NULL", "name" : null, "ofType" : { - "kind" : "OBJECT", - "name" : "__Field", - "ofType" : null + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__InputValue" + } + } } - } - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "interfaces", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "LIST", - "name" : null, - "ofType" : { + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "type", + "description" : null, + "args" : [ ], + "type" : { "kind" : "NON_NULL", "name" : null, "ofType" : { @@ -328,18 +528,75 @@ "name" : "__Type", "ofType" : null } - } - }, - "isDeprecated" : false, - "deprecationReason" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "isDeprecated", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "Boolean", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "deprecationReason", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null }, { - "name" : "possibleTypes", + "kind" : "OBJECT", + "name" : "__InputValue", "description" : null, - "args" : [ ], - "type" : { - "kind" : "LIST", - "name" : null, - "ofType" : { + "fields" : [ { + "name" : "name", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "description", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "type", + "description" : null, + "args" : [ ], + "type" : { "kind" : "NON_NULL", "name" : null, "ofType" : { @@ -347,592 +604,337 @@ "name" : "__Type", "ofType" : null } - } - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "enumValues", - "description" : null, - "args" : [ { - "name" : "includeDeprecated", + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "defaultValue", "description" : null, + "args" : [ ], "type" : { "kind" : "SCALAR", - "name" : "Boolean", + "name" : "String", "ofType" : null }, - "defaultValue" : "false" + "isDeprecated" : false, + "deprecationReason" : null } ], - "type" : { - "kind" : "LIST", - "name" : null, - "ofType" : { + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "SCALAR", + "name" : "Boolean", + "description" : "Built-in Boolean", + "fields" : null, + "inputFields" : null, + "interfaces" : null, + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "OBJECT", + "name" : "__EnumValue", + "description" : null, + "fields" : [ { + "name" : "name", + "description" : null, + "args" : [ ], + "type" : { "kind" : "NON_NULL", "name" : null, "ofType" : { - "kind" : "OBJECT", - "name" : "__EnumValue", + "kind" : "SCALAR", + "name" : "String", "ofType" : null } - } - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "inputFields", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "LIST", - "name" : null, - "ofType" : { + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "description", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "isDeprecated", + "description" : null, + "args" : [ ], + "type" : { "kind" : "NON_NULL", "name" : null, "ofType" : { - "kind" : "OBJECT", - "name" : "__InputValue", + "kind" : "SCALAR", + "name" : "Boolean", "ofType" : null } - } - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "ofType", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "OBJECT", - "name" : "__Type", - "ofType" : null - }, - "isDeprecated" : false, - "deprecationReason" : null - } ], - "inputFields" : null, - "interfaces" : [ ], - "enumValues" : null, - "possibleTypes" : null - }, { - "kind" : "ENUM", - "name" : "__TypeKind", - "description" : "An enum describing what kind of type a given __Type is", - "fields" : null, - "inputFields" : null, - "interfaces" : null, - "enumValues" : [ { - "name" : "SCALAR", - "description" : "Indicates this type is a scalar.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "OBJECT", - "description" : "Indicates this type is an object. `fields` and `interfaces` are valid fields.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "INTERFACE", - "description" : "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "UNION", - "description" : "Indicates this type is a union. `possibleTypes` is a valid field.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "ENUM", - "description" : "Indicates this type is an enum. `enumValues` is a valid field.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "INPUT_OBJECT", - "description" : "Indicates this type is an input object. `inputFields` is a valid field.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "LIST", - "description" : "Indicates this type is a list. `ofType` is a valid field.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "NON_NULL", - "description" : "Indicates this type is a non-null. `ofType` is a valid field.", - "isDeprecated" : false, - "deprecationReason" : null - } ], - "possibleTypes" : null - }, { - "kind" : "OBJECT", - "name" : "__Field", - "description" : null, - "fields" : [ { - "name" : "name", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "deprecationReason", + "description" : null, + "args" : [ ], + "type" : { "kind" : "SCALAR", "name" : "String", "ofType" : null - } - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "description", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "SCALAR", - "name" : "String", - "ofType" : null - }, - "isDeprecated" : false, - "deprecationReason" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null }, { - "name" : "args", + "kind" : "OBJECT", + "name" : "__Directive", "description" : null, - "args" : [ ], - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { + "fields" : [ { + "name" : "name", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "description", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "locations", + "description" : null, + "args" : [ ], + "type" : { "kind" : "LIST", "name" : null, "ofType" : { "kind" : "NON_NULL", "name" : null, "ofType" : { - "kind" : "OBJECT", - "name" : "__InputValue" + "kind" : "ENUM", + "name" : "__DirectiveLocation", + "ofType" : null } } - } - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "type", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { - "kind" : "OBJECT", - "name" : "__Type", - "ofType" : null - } - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "isDeprecated", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "args", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "NON_NULL", + "name" : null, + "ofType" : { + "kind" : "OBJECT", + "name" : "__InputValue" + } + } + } + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "onOperation", + "description" : null, + "args" : [ ], + "type" : { "kind" : "SCALAR", "name" : "Boolean", "ofType" : null - } - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "deprecationReason", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "SCALAR", - "name" : "String", - "ofType" : null - }, - "isDeprecated" : false, - "deprecationReason" : null - } ], - "inputFields" : null, - "interfaces" : [ ], - "enumValues" : null, - "possibleTypes" : null - }, { - "kind" : "OBJECT", - "name" : "__InputValue", - "description" : null, - "fields" : [ { - "name" : "name", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { - "kind" : "SCALAR", - "name" : "String", - "ofType" : null - } - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "description", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "SCALAR", - "name" : "String", - "ofType" : null - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "type", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { - "kind" : "OBJECT", - "name" : "__Type", - "ofType" : null - } - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "defaultValue", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "SCALAR", - "name" : "String", - "ofType" : null - }, - "isDeprecated" : false, - "deprecationReason" : null - } ], - "inputFields" : null, - "interfaces" : [ ], - "enumValues" : null, - "possibleTypes" : null - }, { - "kind" : "SCALAR", - "name" : "Boolean", - "description" : "Built-in Boolean", - "fields" : null, - "inputFields" : null, - "interfaces" : null, - "enumValues" : null, - "possibleTypes" : null - }, { - "kind" : "OBJECT", - "name" : "__EnumValue", - "description" : null, - "fields" : [ { - "name" : "name", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { + }, + "isDeprecated" : true, + "deprecationReason" : "Use `locations`." + }, { + "name" : "onFragment", + "description" : null, + "args" : [ ], + "type" : { "kind" : "SCALAR", - "name" : "String", + "name" : "Boolean", "ofType" : null - } - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "description", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "SCALAR", - "name" : "String", - "ofType" : null - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "isDeprecated", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { + }, + "isDeprecated" : true, + "deprecationReason" : "Use `locations`." + }, { + "name" : "onField", + "description" : null, + "args" : [ ], + "type" : { "kind" : "SCALAR", "name" : "Boolean", "ofType" : null - } - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "deprecationReason", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "SCALAR", - "name" : "String", - "ofType" : null - }, - "isDeprecated" : false, - "deprecationReason" : null + }, + "isDeprecated" : true, + "deprecationReason" : "Use `locations`." + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null + }, { + "kind" : "ENUM", + "name" : "__DirectiveLocation", + "description" : "An enum describing valid locations where a directive can be placed", + "fields" : null, + "inputFields" : null, + "interfaces" : null, + "enumValues" : [ { + "name" : "QUERY", + "description" : "Indicates the directive is valid on queries.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "MUTATION", + "description" : "Indicates the directive is valid on mutations.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "FIELD", + "description" : "Indicates the directive is valid on fields.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "FRAGMENT_DEFINITION", + "description" : "Indicates the directive is valid on fragment definitions.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "FRAGMENT_SPREAD", + "description" : "Indicates the directive is valid on fragment spreads.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "INLINE_FRAGMENT", + "description" : "Indicates the directive is valid on inline fragments.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "SCHEMA", + "description" : "Indicates the directive is valid on a schema SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "SCALAR", + "description" : "Indicates the directive is valid on a scalar SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "OBJECT", + "description" : "Indicates the directive is valid on an object SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "FIELD_DEFINITION", + "description" : "Indicates the directive is valid on a field SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "ARGUMENT_DEFINITION", + "description" : "Indicates the directive is valid on a field argument SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "INTERFACE", + "description" : "Indicates the directive is valid on an interface SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "UNION", + "description" : "Indicates the directive is valid on an union SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "ENUM", + "description" : "Indicates the directive is valid on an enum SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "ENUM_VALUE", + "description" : "Indicates the directive is valid on an enum value SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "INPUT_OBJECT", + "description" : "Indicates the directive is valid on an input object SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "INPUT_FIELD_DEFINITION", + "description" : "Indicates the directive is valid on an input object field SDL definition.", + "isDeprecated" : false, + "deprecationReason" : null + } ], + "possibleTypes" : null } ], - "inputFields" : null, - "interfaces" : [ ], - "enumValues" : null, - "possibleTypes" : null - }, { - "kind" : "OBJECT", - "name" : "__Directive", - "description" : null, - "fields" : [ { - "name" : "name", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "SCALAR", - "name" : "String", - "ofType" : null - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "description", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "SCALAR", - "name" : "String", - "ofType" : null - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "locations", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "LIST", - "name" : null, - "ofType" : { + "directives" : [ { + "name" : "include", + "description" : "Directs the executor to include this field or fragment only when the `if` argument is true", + "locations" : [ "FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT" ], + "args" : [ { + "name" : "if", + "description" : "Included when true.", + "type" : { "kind" : "NON_NULL", "name" : null, "ofType" : { - "kind" : "ENUM", - "name" : "__DirectiveLocation", + "kind" : "SCALAR", + "name" : "Boolean", "ofType" : null } - } - }, - "isDeprecated" : false, - "deprecationReason" : null + }, + "defaultValue" : null + } ] }, { - "name" : "args", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { - "kind" : "LIST", + "name" : "skip", + "description" : "Directs the executor to skip this field or fragment when the `if`'argument is true.", + "locations" : [ "FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT" ], + "args" : [ { + "name" : "if", + "description" : "Skipped when true.", + "type" : { + "kind" : "NON_NULL", "name" : null, "ofType" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { - "kind" : "OBJECT", - "name" : "__InputValue" - } + "kind" : "SCALAR", + "name" : "Boolean", + "ofType" : null } - } - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "onOperation", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "SCALAR", - "name" : "Boolean", - "ofType" : null - }, - "isDeprecated" : true, - "deprecationReason" : "Use `locations`." - }, { - "name" : "onFragment", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "SCALAR", - "name" : "Boolean", - "ofType" : null - }, - "isDeprecated" : true, - "deprecationReason" : "Use `locations`." - }, { - "name" : "onField", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "SCALAR", - "name" : "Boolean", - "ofType" : null - }, - "isDeprecated" : true, - "deprecationReason" : "Use `locations`." - } ], - "inputFields" : null, - "interfaces" : [ ], - "enumValues" : null, - "possibleTypes" : null - }, { - "kind" : "ENUM", - "name" : "__DirectiveLocation", - "description" : "An enum describing valid locations where a directive can be placed", - "fields" : null, - "inputFields" : null, - "interfaces" : null, - "enumValues" : [ { - "name" : "QUERY", - "description" : "Indicates the directive is valid on queries.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "MUTATION", - "description" : "Indicates the directive is valid on mutations.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "FIELD", - "description" : "Indicates the directive is valid on fields.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "FRAGMENT_DEFINITION", - "description" : "Indicates the directive is valid on fragment definitions.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "FRAGMENT_SPREAD", - "description" : "Indicates the directive is valid on fragment spreads.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "INLINE_FRAGMENT", - "description" : "Indicates the directive is valid on inline fragments.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "SCHEMA", - "description" : "Indicates the directive is valid on a schema SDL definition.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "SCALAR", - "description" : "Indicates the directive is valid on a scalar SDL definition.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "OBJECT", - "description" : "Indicates the directive is valid on an object SDL definition.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "FIELD_DEFINITION", - "description" : "Indicates the directive is valid on a field SDL definition.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "ARGUMENT_DEFINITION", - "description" : "Indicates the directive is valid on a field argument SDL definition.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "INTERFACE", - "description" : "Indicates the directive is valid on an interface SDL definition.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "UNION", - "description" : "Indicates the directive is valid on an union SDL definition.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "ENUM", - "description" : "Indicates the directive is valid on an enum SDL definition.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "ENUM_VALUE", - "description" : "Indicates the directive is valid on an enum value SDL definition.", - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "INPUT_OBJECT", - "description" : "Indicates the directive is valid on an input object SDL definition.", - "isDeprecated" : false, - "deprecationReason" : null + }, + "defaultValue" : null + } ] }, { - "name" : "INPUT_FIELD_DEFINITION", - "description" : "Indicates the directive is valid on an input object field SDL definition.", - "isDeprecated" : false, - "deprecationReason" : null - } ], - "possibleTypes" : null - } ], - "directives" : [ { - "name" : "include", - "description" : "Directs the executor to include this field or fragment only when the `if` argument is true", - "locations" : [ "FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT" ], - "args" : [ { - "name" : "if", - "description" : "Included when true.", - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { - "kind" : "SCALAR", - "name" : "Boolean", - "ofType" : null - } - }, - "defaultValue" : null - } ] - }, { - "name" : "skip", - "description" : "Directs the executor to skip this field or fragment when the `if`'argument is true.", - "locations" : [ "FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT" ], - "args" : [ { - "name" : "if", - "description" : "Skipped when true.", - "type" : { - "kind" : "NON_NULL", - "name" : null, - "ofType" : { - "kind" : "SCALAR", - "name" : "Boolean", - "ofType" : null - } - }, - "defaultValue" : null + "name" : "defer", + "description" : "This directive allows results to be deferred during execution", + "locations" : [ "FIELD" ], + "args" : [ ] } ] - }, { - "name" : "defer", - "description" : "This directive allows results to be deferred during execution", - "locations" : [ "FIELD" ], - "args" : [ ] - } ] + } } } \ No newline at end of file diff --git a/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt index ceaa9f5..c53e71a 100644 --- a/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt +++ b/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt @@ -5,7 +5,9 @@ import com.apollographql.apollo.response.CustomTypeAdapter import com.apollographql.apollo.response.CustomTypeValue import com.coxautodev.graphql.tools.SchemaParser import com.fasterxml.jackson.databind.ObjectMapper -import com.lahzouz.java.graphql.client.tests.type.CustomType +import com.lahzouz.java.graphql.client.tests.queries.GetBooksQuery +import com.lahzouz.java.graphql.client.tests.queries.author.GetAuthorsQuery +import com.lahzouz.java.graphql.client.tests.schema.type.CustomType import graphql.schema.GraphQLSchema import graphql.servlet.DefaultGraphQLSchemaProvider import graphql.servlet.GraphQLInvocationInputFactory diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 3b47d41..c5f855c 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.0.1-SNAPSHOT + 2.1.0 .. @@ -18,8 +18,8 @@ 3.6.0 2.2.1 - 1.1.1 - 4.5.9 + 1.2.0 + 4.5.10 apollo-client-maven-plugin diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index 346ffa4..fc94cfe 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -2,6 +2,7 @@ package com.lahzouz.java.graphql.client.maven.plugin import com.apollographql.apollo.compiler.GraphQLCompiler import com.apollographql.apollo.compiler.NullableValueType +import com.apollographql.apollo.compiler.PackageNameProvider import com.apollographql.apollo.compiler.parser.GraphQLDocumentParser import com.apollographql.apollo.compiler.parser.Schema import com.lahzouz.java.graphql.client.maven.plugin.Introspection.getIntrospectionSchema @@ -31,17 +32,20 @@ class GraphQLClientMojo : AbstractMojo() { @Parameter(defaultValue = "\${project}") private lateinit var project: MavenProject - @Parameter(property = "outputDirectory", defaultValue = "\${project.build.directory}/generated-sources/graphql-client") - private lateinit var outputDirectory: File - @Parameter(property = "introspectionFile", defaultValue = "\${project.basedir}/src/main/graphql/schema.json") private lateinit var introspectionFile: File - @Parameter(property = "irPackageName", defaultValue = "com.example.graphql.client") - private lateinit var irPackageName: String + @Parameter(property = "transformedQueriesOutputDir", defaultValue = "\${project.build.directory}/generated-sources/graphql-client/transformed") + private var transformedQueriesOutputDir: File? = null + + @Parameter(property = "outputDirectory", defaultValue = "\${project.build.directory}/generated-sources/graphql-client") + private lateinit var outputDirectory: File - @Parameter(property = "outputPackage", defaultValue = "com.example.graphql.client") - private lateinit var outputPackage: String + @Parameter(property = "rootPackageName", defaultValue = "com.example.graphql.client") + private lateinit var rootPackageName: String + + @Parameter(property = "schemaPackageName", defaultValue = "schema") + private lateinit var schemaPackageName: String @Parameter(property = "schemaUrl", defaultValue = "http://localhost/graphql") private lateinit var schemaUrl: String @@ -55,6 +59,9 @@ class GraphQLClientMojo : AbstractMojo() { @Parameter(property = "nullableValueType", defaultValue = "JAVA_OPTIONAL") private lateinit var nullableValueType: NullableValueType + @Parameter(property = "generateTransformedQueries") + private var generateTransformedQueries: Boolean = false + @Parameter(property = "generateIntrospectionFile") private var generateIntrospectionFile: Boolean = false @@ -121,12 +128,16 @@ class GraphQLClientMojo : AbstractMojo() { throw MojoExecutionException("Introspection schema file not found: ${introspectionFile.absolutePath}") } - val graphQLDocumentParser = GraphQLDocumentParser(Schema(introspectionFile)) + if (!generateTransformedQueries) { + transformedQueriesOutputDir = null + } + + val packageNameProvider = PackageNameProvider(rootPackageName, schemaPackageName, null) + val graphQLDocumentParser = GraphQLDocumentParser(Schema(introspectionFile), packageNameProvider) val ir = graphQLDocumentParser.parse(queries) val compiler = GraphQLCompiler() compiler.write(GraphQLCompiler.Arguments( - irFile = introspectionFile, ir = ir, outputDir = outputDirectory, customTypeMap = customTypeMap, @@ -134,8 +145,8 @@ class GraphQLClientMojo : AbstractMojo() { useSemanticNaming = useSemanticNaming, generateModelBuilder = generateModelBuilder, useJavaBeansSemanticNaming = useJavaBeansSemanticNaming, - irPackageName = irPackageName, - outputPackageName = outputPackage, + packageNameProvider = packageNameProvider, + transformedQueriesOutputDir = transformedQueriesOutputDir, suppressRawTypesWarning = suppressRawTypesWarning, generateKotlinModels = generateKotlinModels, generateVisitorForPolymorphicDatatypes = generateVisitorForPolymorphicDatatypes) @@ -148,5 +159,4 @@ class GraphQLClientMojo : AbstractMojo() { log.info("Apollo GraphQL Client Code Generation task finished") } - } diff --git a/pom.xml b/pom.xml index 9df55cf..4f40bef 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.0.1-SNAPSHOT + 2.1.0 pom apollo-client-maven-plugin-parent From 9fab6a63d3007d1ec7c3bb93a61236f384b5b9db Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Sun, 13 Oct 2019 22:08:47 +0200 Subject: [PATCH 50/82] version(*): Bump version to 2.1.1-SNAPSHOT --- apollo-client-maven-plugin-tests/pom.xml | 4 ++-- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index b6f951e..06a4493 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.1.0 + 2.1.1-SNAPSHOT .. @@ -22,7 +22,7 @@ 2.22.1 true - 2.1.0 + 2.1.1-SNAPSHOT 1.2.0 3.13.2 6.1.3 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index c5f855c..a84ecc5 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.1.0 + 2.1.1-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index 4f40bef..f79d688 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.1.0 + 2.1.1-SNAPSHOT pom apollo-client-maven-plugin-parent From 7d6364558da7bb4e7edeb717edfbf97c5fa82233 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Thu, 7 Nov 2019 23:37:14 +0100 Subject: [PATCH 51/82] refactor(*) Upgrade to Apollo compiler 1.2.1 --- .mvn/wrapper/MavenWrapperDownloader.java | 117 ++++++++++++++++++ .mvn/wrapper/maven-wrapper.properties | 1 + README.md | 7 +- apollo-client-maven-plugin-tests/pom.xml | 3 +- .../kotlin/ApolloClientMavenPluginTest.kt | 2 +- apollo-client-maven-plugin/pom.xml | 2 +- .../client/maven/plugin/GraphQLClientMojo.kt | 11 +- 7 files changed, 130 insertions(+), 13 deletions(-) create mode 100644 .mvn/wrapper/MavenWrapperDownloader.java diff --git a/.mvn/wrapper/MavenWrapperDownloader.java b/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100644 index 0000000..c32394f --- /dev/null +++ b/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,117 @@ +/* + * Copyright 2007-present the original author or authors. + * + * Licensed 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. + */ +import java.net.*; +import java.io.*; +import java.nio.channels.*; +import java.util.Properties; + +public class MavenWrapperDownloader { + + private static final String WRAPPER_VERSION = "0.5.5"; + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if(mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if(mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if(!outputFile.getParentFile().exists()) { + if(!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { + String username = System.getenv("MVNW_USERNAME"); + char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); + Authenticator.setDefault(new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + } + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index cd0d451..c63408c 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -1 +1,2 @@ distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar diff --git a/README.md b/README.md index 486bb69..043268e 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,13 @@ A full usage example can be found in the [test project](https://github.com/sparo com.apollographql.apollo apollo-runtime - 1.2.0 + 1.2.1 + org.jetbrains annotations - 17.0.0 + 18.0.0 org.jetbrains.kotlin @@ -72,7 +73,6 @@ All plugin options and their defaults: false true - com.example.graphql.client ${project.basedir}/src/main/graphql/schema.json false ${project.build.directory}/generated-sources/graphql-client/transformedQueries @@ -80,7 +80,6 @@ All plugin options and their defaults: ${project.basedir}/src/main/graphql http://localhost/graphql com.example.graphql.client - schema ${project.build.directory}/generated-sources/graphql-client true true diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 06a4493..fa34bf7 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -23,7 +23,7 @@ true 2.1.1-SNAPSHOT - 1.2.0 + 1.2.1 3.13.2 6.1.3 5.2.4 @@ -103,7 +103,6 @@ false ${project.build.directory}/generated-sources/graphql-client/transformed com.lahzouz.java.graphql.client.tests - schema ${project.build.directory}/generated-sources/graphql-client true true diff --git a/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt index c53e71a..a2a6923 100644 --- a/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt +++ b/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt @@ -7,7 +7,7 @@ import com.coxautodev.graphql.tools.SchemaParser import com.fasterxml.jackson.databind.ObjectMapper import com.lahzouz.java.graphql.client.tests.queries.GetBooksQuery import com.lahzouz.java.graphql.client.tests.queries.author.GetAuthorsQuery -import com.lahzouz.java.graphql.client.tests.schema.type.CustomType +import com.lahzouz.java.graphql.client.tests.type.CustomType import graphql.schema.GraphQLSchema import graphql.servlet.DefaultGraphQLSchemaProvider import graphql.servlet.GraphQLInvocationInputFactory diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index a84ecc5..ad716c0 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -18,7 +18,7 @@ 3.6.0 2.2.1 - 1.2.0 + 1.2.1 4.5.10 diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index fc94cfe..a0b0a3b 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -1,8 +1,8 @@ package com.lahzouz.java.graphql.client.maven.plugin +import com.apollographql.apollo.compiler.DefaultPackageNameProvider import com.apollographql.apollo.compiler.GraphQLCompiler import com.apollographql.apollo.compiler.NullableValueType -import com.apollographql.apollo.compiler.PackageNameProvider import com.apollographql.apollo.compiler.parser.GraphQLDocumentParser import com.apollographql.apollo.compiler.parser.Schema import com.lahzouz.java.graphql.client.maven.plugin.Introspection.getIntrospectionSchema @@ -44,9 +44,6 @@ class GraphQLClientMojo : AbstractMojo() { @Parameter(property = "rootPackageName", defaultValue = "com.example.graphql.client") private lateinit var rootPackageName: String - @Parameter(property = "schemaPackageName", defaultValue = "schema") - private lateinit var schemaPackageName: String - @Parameter(property = "schemaUrl", defaultValue = "http://localhost/graphql") private lateinit var schemaUrl: String @@ -132,7 +129,11 @@ class GraphQLClientMojo : AbstractMojo() { transformedQueriesOutputDir = null } - val packageNameProvider = PackageNameProvider(rootPackageName, schemaPackageName, null) + val packageNameProvider = DefaultPackageNameProvider( + rootFolders = listOf(sourceDirName), + schemaFile = introspectionFile, + rootPackageName = rootPackageName + ) val graphQLDocumentParser = GraphQLDocumentParser(Schema(introspectionFile), packageNameProvider) val ir = graphQLDocumentParser.parse(queries) From f92c904325cb89f033dd59b641d2efcb66474142 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Thu, 7 Nov 2019 23:44:19 +0100 Subject: [PATCH 52/82] version(*): Bump version to 2.2.0 Update README --- README.md | 4 ++-- apollo-client-maven-plugin-tests/pom.xml | 4 ++-- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 043268e..a776b0b 100644 --- a/README.md +++ b/README.md @@ -42,14 +42,14 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 2.1.0 + 2.2.0 generate - com.my.package.graphql.client + com.example.graphql.client diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index fa34bf7..014dc6e 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.1.1-SNAPSHOT + 2.2.0 .. @@ -22,7 +22,7 @@ 2.22.1 true - 2.1.1-SNAPSHOT + 2.2.0 1.2.1 3.13.2 6.1.3 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index ad716c0..9ae801b 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.1.1-SNAPSHOT + 2.2.0 .. diff --git a/pom.xml b/pom.xml index f79d688..628b6c1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.1.1-SNAPSHOT + 2.2.0 pom apollo-client-maven-plugin-parent From f870b68628ef3abd8c6958f55208fadfc57d381c Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Thu, 7 Nov 2019 23:47:48 +0100 Subject: [PATCH 53/82] version(*): Bump version to 2.2.1-SNAPSHOT --- apollo-client-maven-plugin-tests/pom.xml | 2 +- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 014dc6e..02e0e39 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.0 + 2.2.1-SNAPSHOT .. diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 9ae801b..ffb9dfb 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.0 + 2.2.1-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index 628b6c1..4e5d612 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.0 + 2.2.1-SNAPSHOT pom apollo-client-maven-plugin-parent From 04ec4a92f06da872f47ab90fc5ab83ee14cc7075 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Wed, 4 Dec 2019 00:33:13 +0100 Subject: [PATCH 54/82] refactor(*) Upgrade to Apollo compiler 1.2.2 Upgrade to Kotlin 1.3.61 --- README.md | 15 ++++++++------- apollo-client-maven-plugin-tests/pom.xml | 5 +++-- .../test/kotlin/ApolloClientMavenPluginTest.kt | 2 +- apollo-client-maven-plugin/pom.xml | 2 +- .../client/maven/plugin/GraphQLClientMojo.kt | 4 ++++ pom.xml | 2 +- 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a776b0b..f68b653 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.apollographql.apollo apollo-runtime - 1.2.1 + 1.2.2 @@ -31,7 +31,7 @@ A full usage example can be found in the [test project](https://github.com/sparo org.jetbrains.kotlin kotlin-reflect - 1.3.50 + 1.3.61 ``` @@ -42,7 +42,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 2.2.0 + 2.2.1-SNAPSHOT @@ -60,9 +60,9 @@ A full usage example can be found in the [test project](https://github.com/sparo automatically generate this file by setting `generateIntrospectionFile` to true and `schemaUrl` to your GraphQL endpoint. At build time, the plugin will query the server and install this file per the value of `introspectionFile`. 4. Create files for each query you'd like to generate classes for under `src/main/graphql`: - 1. Query file names must match the name of the query they contain - 2. Query files must end with `.graphql` - 3. Any subdirectories under `src/main/graphql` are treated as extra package names to append to `packageName` in the plugin config. + 1. Query file names must match the name of the query they contain + 2. Query files must end with `.graphql` + 3. Any subdirectories under `src/main/graphql` are treated as extra package names to append to `packageName` in the plugin config. 5. Run `mvn clean generate-sources` to generate classes for your queries. ### Configuration Options @@ -87,6 +87,7 @@ All plugin options and their defaults: JAVA_OPTIONAL false false + false false @@ -182,4 +183,4 @@ public class ApolloClientUtils { } ``` -Properties specified as nullable in the schema will have an java 8 `java.util.optional` type. \ No newline at end of file +Properties specified as nullable in the schema will have a java 8 `java.util.optional` type. \ No newline at end of file diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 02e0e39..8110506 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -22,8 +22,8 @@ 2.22.1 true - 2.2.0 - 1.2.1 + 2.2.1-SNAPSHOT + 1.2.2 3.13.2 6.1.3 5.2.4 @@ -110,6 +110,7 @@ JAVA_OPTIONAL false false + false false java.lang.Long diff --git a/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt index a2a6923..b6ffc4e 100644 --- a/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt +++ b/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt @@ -27,7 +27,7 @@ import javax.servlet.Servlet /** - * @author Sparow199 + * @author AOUDIA Moncef */ @TestInstance(PER_CLASS) class ApolloClientMavenPluginTest { diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index ffb9dfb..2d6f9aa 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -18,7 +18,7 @@ 3.6.0 2.2.1 - 1.2.1 + 1.2.2 4.5.10 diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index a0b0a3b..6fbc3bf 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -83,6 +83,9 @@ class GraphQLClientMojo : AbstractMojo() { @Parameter(property = "generateKotlinModels") private var generateKotlinModels: Boolean = false + @Parameter(property = "generateAsInternal") + private var generateAsInternal: Boolean = false + @Parameter(property = "generateVisitorForPolymorphicDatatypes") private var generateVisitorForPolymorphicDatatypes: Boolean = true @@ -150,6 +153,7 @@ class GraphQLClientMojo : AbstractMojo() { transformedQueriesOutputDir = transformedQueriesOutputDir, suppressRawTypesWarning = suppressRawTypesWarning, generateKotlinModels = generateKotlinModels, + generateAsInternal = generateAsInternal, generateVisitorForPolymorphicDatatypes = generateVisitorForPolymorphicDatatypes) ) diff --git a/pom.xml b/pom.xml index 4e5d612..21974bc 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ UTF-8 UTF-8 - 1.3.50 + 1.3.61 true 1.8 From 3b5c3b8c7ea85477bed929d34273035c775f1a83 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Wed, 4 Dec 2019 00:38:45 +0100 Subject: [PATCH 55/82] version(*): Bump version to 2.2.1 Update README --- README.md | 2 +- apollo-client-maven-plugin-tests/pom.xml | 4 ++-- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f68b653..d98fa57 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 2.2.1-SNAPSHOT + 2.2.1 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 8110506..2374718 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.1-SNAPSHOT + 2.2.1 .. @@ -22,7 +22,7 @@ 2.22.1 true - 2.2.1-SNAPSHOT + 2.2.1 1.2.2 3.13.2 6.1.3 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 2d6f9aa..475f299 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.1-SNAPSHOT + 2.2.1 .. diff --git a/pom.xml b/pom.xml index 21974bc..44527e3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.1-SNAPSHOT + 2.2.1 pom apollo-client-maven-plugin-parent From 677bbed0ea88bdac7be07ce3b8cfafd73496e928 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Wed, 4 Dec 2019 00:46:44 +0100 Subject: [PATCH 56/82] version(*): Bump version to 2.2.2-SNAPSHOT Update README --- README.md | 2 +- apollo-client-maven-plugin-tests/pom.xml | 4 ++-- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d98fa57..759fb51 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Apollo GraphQL Client Code Generation Maven Plugin -[![CircleCI](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin.svg?style=svg)](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin) +[![CircleCI](https://circleci.com/gh/aoudiamoncef/apollo-client-maven-plugin.svg?style=svg)](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin) [![Download](https://api.bintray.com/packages/sparow199/maven/apollo-client-maven-plugin/images/download.svg)](https://bintray.com/sparow199/maven/apollo-client-maven-plugin/_latestVersion) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/71b115f870bb44478dac5d05abc9f378)](https://app.codacy.com/app/Sparow199/apollo-client-maven-plugin?utm_source=github.com&utm_medium=referral&utm_content=Sparow199/apollo-client-maven-plugin&utm_campaign=Badge_Grade_Dashboard) [![Known Vulnerabilities](https://snyk.io/test/github/sparow199/apollo-client-maven-plugin/badge.svg)](https://snyk.io/test/github/Sparow199/apollo-client-maven-plugin) diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 2374718..9d6ef5f 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.1 + 2.2.2-SNAPSHOT .. @@ -22,7 +22,7 @@ 2.22.1 true - 2.2.1 + 2.2.2-SNAPSHOT 1.2.2 3.13.2 6.1.3 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 475f299..529586e 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.1 + 2.2.2-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index 44527e3..22c1fa6 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.1 + 2.2.2-SNAPSHOT pom apollo-client-maven-plugin-parent From 2f4adc3568b106b2866415a24985b04c4d921b23 Mon Sep 17 00:00:00 2001 From: Marcin Zarebski Date: Wed, 18 Dec 2019 11:08:03 +0100 Subject: [PATCH 57/82] Add possibility to define custom HTTP headers for querying introspection schema --- README.md | 1 + .../java/graphql/client/maven/plugin/GraphQLClientMojo.kt | 5 ++++- .../java/graphql/client/maven/plugin/Introspection.kt | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 759fb51..919a4ef 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ All plugin options and their defaults: false ${project.basedir}/src/main/graphql http://localhost/graphql + com.example.graphql.client ${project.build.directory}/generated-sources/graphql-client true diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index 6fbc3bf..18b8c44 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -47,6 +47,9 @@ class GraphQLClientMojo : AbstractMojo() { @Parameter(property = "schemaUrl", defaultValue = "http://localhost/graphql") private lateinit var schemaUrl: String + @Parameter(property = "schemaUrlHeaders") + private var customHeaders: Map = emptyMap() + @Parameter(property = "sourceDirName", defaultValue = "\${project.basedir}/src/main/graphql") private lateinit var sourceDirName: String @@ -116,7 +119,7 @@ class GraphQLClientMojo : AbstractMojo() { if (generateIntrospectionFile) { log.info("Automatically generating introspection file from $schemaUrl") - val schema = getIntrospectionSchema(schemaUrl) + val schema = getIntrospectionSchema(schemaUrl, customHeaders) if (schema.isNotEmpty()) { File(introspectionFile.toURI()).writeText(schema) } else { diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt index a0ae350..db6905b 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt @@ -11,7 +11,7 @@ import java.nio.charset.Charset object Introspection { - fun getIntrospectionSchema(host: String): String { + fun getIntrospectionSchema(host: String, customHeaders: Map): String { val client = HttpClients.custom() .disableContentCompression() .build() @@ -25,6 +25,7 @@ object Introspection { setHeader(HttpHeaders.ACCEPT_ENCODING, "gzip, identity") setHeader(HttpHeaders.ACCEPT_CHARSET, "utf-8") setHeader(HttpHeaders.USER_AGENT, "Apollo Client Maven Plugin") + customHeaders.forEach { (name, value) -> setHeader(name, value) } } val response = client.execute(request) var schema = "" From 949b020cc34560d9036480e2b136ae9497776ecd Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Sat, 21 Dec 2019 16:17:48 +0100 Subject: [PATCH 58/82] version(*): Bump version to 2.2.2 Update README --- apollo-client-maven-plugin-tests/pom.xml | 4 ++-- apollo-client-maven-plugin-tests/src/test/kotlin/Query.kt | 2 +- .../src/test/kotlin/extensions.kt | 2 +- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 9d6ef5f..7c3dd06 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.2-SNAPSHOT + 2.2.2 .. @@ -22,7 +22,7 @@ 2.22.1 true - 2.2.2-SNAPSHOT + 2.2.2 1.2.2 3.13.2 6.1.3 diff --git a/apollo-client-maven-plugin-tests/src/test/kotlin/Query.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/Query.kt index 9a57a99..b35ea1d 100644 --- a/apollo-client-maven-plugin-tests/src/test/kotlin/Query.kt +++ b/apollo-client-maven-plugin-tests/src/test/kotlin/Query.kt @@ -3,7 +3,7 @@ package com.lahzouz.java.graphql.client.tests import com.coxautodev.graphql.tools.GraphQLQueryResolver /** - * @author Sparow199 + * @author AOUDIA Moncef */ class Query : GraphQLQueryResolver { diff --git a/apollo-client-maven-plugin-tests/src/test/kotlin/extensions.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/extensions.kt index 043e506..ca0e858 100644 --- a/apollo-client-maven-plugin-tests/src/test/kotlin/extensions.kt +++ b/apollo-client-maven-plugin-tests/src/test/kotlin/extensions.kt @@ -6,7 +6,7 @@ import com.apollographql.apollo.exception.ApolloException import java.util.concurrent.CompletableFuture /** - * @author Sparow199 + * @author AOUDIA Moncef */ fun ApolloCall.toCompletableFuture(): CompletableFuture> { val completableFuture = CompletableFuture>() diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 529586e..70d2065 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.2-SNAPSHOT + 2.2.2 .. diff --git a/pom.xml b/pom.xml index 22c1fa6..af60214 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.2-SNAPSHOT + 2.2.2 pom apollo-client-maven-plugin-parent From 2896ab7133984e19768e38cb909ba87ef4b48fae Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Sat, 21 Dec 2019 16:20:42 +0100 Subject: [PATCH 59/82] version(*): Bump version to 2.2.3-SNAPSHOT Update README --- apollo-client-maven-plugin-tests/pom.xml | 4 ++-- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 7c3dd06..a103538 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.2 + 2.2.3-SNAPSHOT .. @@ -22,7 +22,7 @@ 2.22.1 true - 2.2.2 + 2.2.3-SNAPSHOT 1.2.2 3.13.2 6.1.3 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 70d2065..99aa7bd 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.2 + 2.2.3-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index af60214..c8fbb7a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.2 + 2.2.3-SNAPSHOT pom apollo-client-maven-plugin-parent From 46ceb69692c5c3bbed612d747994cf008359c4e6 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Tue, 14 Jan 2020 22:40:07 +0100 Subject: [PATCH 60/82] version(*): Bump version to 2.2.3 Update README --- README.md | 9 ++++++--- apollo-client-maven-plugin-tests/pom.xml | 6 +++--- apollo-client-maven-plugin/pom.xml | 4 ++-- .../java/graphql/client/maven/plugin/Introspection.kt | 2 +- pom.xml | 2 +- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 919a4ef..91cb1fa 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.apollographql.apollo apollo-runtime - 1.2.2 + 1.2.3 @@ -42,7 +42,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 2.2.1 + 2.2.3 @@ -106,6 +106,8 @@ Available nullable types: INPUT_TYPE ``` +Properties specified as nullable in the schema will have a java 8 `java.util.optional` type. + #### Custom Types To use the [Custom Scalar Types](https://github.com/apollographql/apollo-android#custom-scalar-types) you need to @@ -183,5 +185,6 @@ public class ApolloClientUtils { } } ``` +#### Using Apollo without `apollo-runtime` -Properties specified as nullable in the schema will have a java 8 `java.util.optional` type. \ No newline at end of file +See [documentation](https://www.apollographql.com/docs/android/advanced/no-runtime/) \ No newline at end of file diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index a103538..809c409 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.3-SNAPSHOT + 2.2.3 .. @@ -22,8 +22,8 @@ 2.22.1 true - 2.2.3-SNAPSHOT - 1.2.2 + 2.2.3 + 1.2.3 3.13.2 6.1.3 5.2.4 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 99aa7bd..8550c36 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.3-SNAPSHOT + 2.2.3 .. @@ -18,7 +18,7 @@ 3.6.0 2.2.1 - 1.2.2 + 1.2.3 4.5.10 diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt index db6905b..b5f2a68 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt @@ -141,6 +141,6 @@ object Introspection { " }\\n" + " " - private const val introspectionQuery = "{\"query\": \"$rawIntrospectionQuery\",\"variables\":{},\"operationName\":\"introspection\"}" + private const val introspectionQuery = "{\"query\": \"$rawIntrospectionQuery\",\"variables\":{},\"operationName\":\"IntrospectionQuery\"}" } \ No newline at end of file diff --git a/pom.xml b/pom.xml index c8fbb7a..10e91ec 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.3-SNAPSHOT + 2.2.3 pom apollo-client-maven-plugin-parent From 34c5d88bf4139f8c5eea018c3358844881615fe9 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Tue, 14 Jan 2020 22:43:03 +0100 Subject: [PATCH 61/82] version(*): Bump version to 2.2.4-SNAPSHOT --- README.md | 2 +- apollo-client-maven-plugin-tests/pom.xml | 4 ++-- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 91cb1fa..0bc1f7b 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ Available nullable types: GUAVA_OPTIONAL JAVA_OPTIONAL INPUT_TYPE -``` +``` Properties specified as nullable in the schema will have a java 8 `java.util.optional` type. diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 809c409..521783d 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.3 + 2.2.4-SNAPSHOT .. @@ -22,7 +22,7 @@ 2.22.1 true - 2.2.3 + 2.2.4-SNAPSHOT 1.2.3 3.13.2 6.1.3 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 8550c36..8d3fc1a 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.3 + 2.2.4-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index 10e91ec..a977d22 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.3 + 2.2.4-SNAPSHOT pom apollo-client-maven-plugin-parent From 158bfceef56847058d0125258f9800fac696dd69 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Thu, 6 Feb 2020 00:15:17 +0100 Subject: [PATCH 62/82] version(*): Bump version to 2.3.0 Upgrade to Apollo compiler 1.2.3 --- README.md | 87 +++++++++---------- apollo-client-maven-plugin-tests/pom.xml | 9 +- apollo-client-maven-plugin/pom.xml | 4 +- .../client/maven/plugin/GraphQLClientMojo.kt | 18 ++-- pom.xml | 2 +- 5 files changed, 60 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index 0bc1f7b..e87d75c 100644 --- a/README.md +++ b/README.md @@ -15,46 +15,46 @@ A full usage example can be found in the [test project](https://github.com/sparo 1. Add the apollo runtime library to your project's dependencies: - ```xml - - - com.apollographql.apollo - apollo-runtime - 1.2.3 - - - - org.jetbrains - annotations - 18.0.0 - - - org.jetbrains.kotlin - kotlin-reflect - 1.3.61 - - - ``` +```xml + + + com.apollographql.apollo + apollo-runtime + 1.3.0 + + + + org.jetbrains + annotations + 18.0.0 + + + org.jetbrains.kotlin + kotlin-reflect + 1.3.61 + + +``` 2. Add the code generator plugin to your project's build: - ```xml - - com.github.sparow199 - apollo-client-maven-plugin - 2.2.3 - - - - generate - - - com.example.graphql.client - - - - - ``` +```xml + + com.github.sparow199 + apollo-client-maven-plugin + 2.3.0 + + + + generate + + + com.example.graphql.client + + + + +``` 3. Create a file `src/main/graphql/schema.json` with the JSON results of an [introspection query](https://gist.github.com/Sparow199/a59527016e16a2d56309d62e01ff2348) OR you can automatically generate this file by setting `generateIntrospectionFile` to true and `schemaUrl` to your GraphQL endpoint. At build time, the plugin will query the server and install this file @@ -74,14 +74,13 @@ All plugin options and their defaults: false true ${project.basedir}/src/main/graphql/schema.json - false - ${project.build.directory}/generated-sources/graphql-client/transformedQueries false ${project.basedir}/src/main/graphql http://localhost/graphql com.example.graphql.client ${project.build.directory}/generated-sources/graphql-client + com.apollographql.apollo.compiler.OperationIdGenerator$Sha256 true true true @@ -99,11 +98,11 @@ All plugin options and their defaults: Available nullable types: ```java - ANNOTATED - APOLLO_OPTIONAL - GUAVA_OPTIONAL - JAVA_OPTIONAL - INPUT_TYPE +ANNOTATED +APOLLO_OPTIONAL +GUAVA_OPTIONAL +JAVA_OPTIONAL +INPUT_TYPE ``` Properties specified as nullable in the schema will have a java 8 `java.util.optional` type. diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 521783d..99e5270 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.4-SNAPSHOT + 2.3.0 .. @@ -22,8 +22,8 @@ 2.22.1 true - 2.2.4-SNAPSHOT - 1.2.3 + 2.3.0 + 1.3.0 3.13.2 6.1.3 5.2.4 @@ -100,10 +100,9 @@ false ${project.basedir}/src/main/graphql ${project.basedir}/src/main/graphql/schema.json - false - ${project.build.directory}/generated-sources/graphql-client/transformed com.lahzouz.java.graphql.client.tests ${project.build.directory}/generated-sources/graphql-client + com.apollographql.apollo.compiler.OperationIdGenerator$Sha256 true true true diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 8d3fc1a..732af23 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.4-SNAPSHOT + 2.3.0 .. @@ -18,7 +18,7 @@ 3.6.0 2.2.1 - 1.2.3 + 1.3.0 4.5.10 diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index 18b8c44..b48eafd 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -3,6 +3,7 @@ package com.lahzouz.java.graphql.client.maven.plugin import com.apollographql.apollo.compiler.DefaultPackageNameProvider import com.apollographql.apollo.compiler.GraphQLCompiler import com.apollographql.apollo.compiler.NullableValueType +import com.apollographql.apollo.compiler.OperationIdGenerator import com.apollographql.apollo.compiler.parser.GraphQLDocumentParser import com.apollographql.apollo.compiler.parser.Schema import com.lahzouz.java.graphql.client.maven.plugin.Introspection.getIntrospectionSchema @@ -16,6 +17,7 @@ import org.apache.maven.project.MavenProject import java.io.File import java.nio.file.Files import java.util.stream.Collectors +import kotlin.reflect.full.createInstance /** @@ -35,9 +37,6 @@ class GraphQLClientMojo : AbstractMojo() { @Parameter(property = "introspectionFile", defaultValue = "\${project.basedir}/src/main/graphql/schema.json") private lateinit var introspectionFile: File - @Parameter(property = "transformedQueriesOutputDir", defaultValue = "\${project.build.directory}/generated-sources/graphql-client/transformed") - private var transformedQueriesOutputDir: File? = null - @Parameter(property = "outputDirectory", defaultValue = "\${project.build.directory}/generated-sources/graphql-client") private lateinit var outputDirectory: File @@ -59,8 +58,8 @@ class GraphQLClientMojo : AbstractMojo() { @Parameter(property = "nullableValueType", defaultValue = "JAVA_OPTIONAL") private lateinit var nullableValueType: NullableValueType - @Parameter(property = "generateTransformedQueries") - private var generateTransformedQueries: Boolean = false + @Parameter(property = "operationIdGeneratorClass") + private var operationIdGeneratorClass: String = "" @Parameter(property = "generateIntrospectionFile") private var generateIntrospectionFile: Boolean = false @@ -131,8 +130,11 @@ class GraphQLClientMojo : AbstractMojo() { throw MojoExecutionException("Introspection schema file not found: ${introspectionFile.absolutePath}") } - if (!generateTransformedQueries) { - transformedQueriesOutputDir = null + val operationIdGenerator = if (operationIdGeneratorClass.isEmpty()) { + Class.forName("com.apollographql.apollo.compiler.OperationIdGenerator\$Sha256").kotlin + .createInstance() as OperationIdGenerator + } else { + Class.forName(operationIdGeneratorClass).kotlin.createInstance() as OperationIdGenerator } val packageNameProvider = DefaultPackageNameProvider( @@ -153,7 +155,7 @@ class GraphQLClientMojo : AbstractMojo() { generateModelBuilder = generateModelBuilder, useJavaBeansSemanticNaming = useJavaBeansSemanticNaming, packageNameProvider = packageNameProvider, - transformedQueriesOutputDir = transformedQueriesOutputDir, + operationIdGenerator = operationIdGenerator, suppressRawTypesWarning = suppressRawTypesWarning, generateKotlinModels = generateKotlinModels, generateAsInternal = generateAsInternal, diff --git a/pom.xml b/pom.xml index a977d22..a7893eb 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.2.4-SNAPSHOT + 2.3.0 pom apollo-client-maven-plugin-parent From a815208ee8c625d40b2e098e9a4480d666de4399 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Fri, 21 Feb 2020 00:39:44 +0100 Subject: [PATCH 63/82] version(*): Bump version to 2.3.1-SNAPSHOT --- apollo-client-maven-plugin-tests/pom.xml | 4 ++-- apollo-client-maven-plugin/pom.xml | 2 +- pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 99e5270..3e16b1d 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.3.0 + 2.3.1-SNAPSHOT .. @@ -22,7 +22,7 @@ 2.22.1 true - 2.3.0 + 2.3.1-SNAPSHOT 1.3.0 3.13.2 6.1.3 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 732af23..7f7e0ab 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.3.0 + 2.3.1-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index a7893eb..5c390e6 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.3.0 + 2.3.1-SNAPSHOT pom apollo-client-maven-plugin-parent From 0aa45efa40d8a31345518fbf1cedf33548066b2a Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Fri, 21 Feb 2020 00:43:37 +0100 Subject: [PATCH 64/82] version(*): Bump version to 2.3.1 Upgrade to Apollo 1.3.2 --- README.md | 6 +++--- apollo-client-maven-plugin-tests/pom.xml | 10 +++++----- apollo-client-maven-plugin/pom.xml | 6 +++--- pom.xml | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e87d75c..9cf9707 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,13 @@ A full usage example can be found in the [test project](https://github.com/sparo com.apollographql.apollo apollo-runtime - 1.3.0 + 1.3.2 org.jetbrains annotations - 18.0.0 + 19.0.0 org.jetbrains.kotlin @@ -42,7 +42,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 2.3.0 + 2.3.1 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 3e16b1d..a24b115 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.3.1-SNAPSHOT + 2.3.1 .. @@ -22,14 +22,14 @@ 2.22.1 true - 2.3.1-SNAPSHOT + 2.3.0 1.3.0 3.13.2 6.1.3 5.2.4 - 5.5.1 - 1.7.28 - 2.0.23.Final + 5.6.0 + 1.7.30 + 2.0.29.Final diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 7f7e0ab..60371f0 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.3.1-SNAPSHOT + 2.3.1 .. @@ -18,8 +18,8 @@ 3.6.0 2.2.1 - 1.3.0 - 4.5.10 + 1.3.2 + 4.5.11 apollo-client-maven-plugin diff --git a/pom.xml b/pom.xml index 5c390e6..1561869 100644 --- a/pom.xml +++ b/pom.xml @@ -4,12 +4,12 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.3.1-SNAPSHOT + 2.3.1 pom apollo-client-maven-plugin-parent Parent Pom for Apollo GraphQL Client Maven Plugin - https://github.com/Sparow199/apollo-client-maven-plugin + https://github.com/aoudiamoncef/apollo-client-maven-plugin UTF-8 From ebbc732d04101cd7ce90570532a05ed47703829d Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Fri, 21 Feb 2020 01:02:17 +0100 Subject: [PATCH 65/82] version(*): Bump version to 2.3.2-SNAPSHOT Update SCM url --- apollo-client-maven-plugin-tests/pom.xml | 10 ++++++---- apollo-client-maven-plugin/pom.xml | 4 ++-- pom.xml | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index a24b115..1e07498 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.3.1 + 2.3.2-SNAPSHOT .. @@ -13,7 +13,7 @@ jar apollo-client-maven-plugin-tests Test for maven plugin - https://github.com/Sparow199/apollo-client-maven-plugin.git + https://github.com/aoudiamoncef/apollo-client-maven-plugin UTF-8 @@ -101,8 +101,10 @@ ${project.basedir}/src/main/graphql ${project.basedir}/src/main/graphql/schema.json com.lahzouz.java.graphql.client.tests - ${project.build.directory}/generated-sources/graphql-client - com.apollographql.apollo.compiler.OperationIdGenerator$Sha256 + ${project.build.directory}/generated-sources/graphql-client + + com.apollographql.apollo.compiler.OperationIdGenerator$Sha256 + true true true diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 60371f0..a5d04be 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.3.1 + 2.3.2-SNAPSHOT .. @@ -24,7 +24,7 @@ apollo-client-maven-plugin Maven plugin for generating graphql clients - https://github.com/Sparow199/apollo-client-maven-plugin.git + https://github.com/aoudiamoncef/apollo-client-maven-plugin diff --git a/pom.xml b/pom.xml index 1561869..3aee866 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.3.1 + 2.3.2-SNAPSHOT pom apollo-client-maven-plugin-parent From 1c59937ce3418c304c8fb9931008d841f3923239 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Wed, 18 Mar 2020 23:32:07 +0100 Subject: [PATCH 66/82] version(*): Bump version to 2.3.2 Upgrade to Apollo 1.3.3 --- README.md | 6 +++--- apollo-client-maven-plugin-tests/pom.xml | 8 ++++---- apollo-client-maven-plugin/pom.xml | 4 ++-- pom.xml | 10 +++++----- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 9cf9707..b4e5b28 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.apollographql.apollo apollo-runtime - 1.3.2 + 1.3.3 @@ -31,7 +31,7 @@ A full usage example can be found in the [test project](https://github.com/sparo org.jetbrains.kotlin kotlin-reflect - 1.3.61 + 1.3.70 ``` @@ -42,7 +42,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 2.3.1 + 2.3.2 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 1e07498..bc68286 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.3.2-SNAPSHOT + 2.3.2 .. @@ -22,9 +22,9 @@ 2.22.1 true - 2.3.0 - 1.3.0 - 3.13.2 + 2.3.2 + 1.3.3 + 3.15.0 6.1.3 5.2.4 5.6.0 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index a5d04be..9eb86d5 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.3.2-SNAPSHOT + 2.3.2 .. @@ -18,7 +18,7 @@ 3.6.0 2.2.1 - 1.3.2 + 1.3.3 4.5.11 diff --git a/pom.xml b/pom.xml index 3aee866..9958221 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.3.2-SNAPSHOT + 2.3.2 pom apollo-client-maven-plugin-parent @@ -14,7 +14,7 @@ UTF-8 UTF-8 - 1.3.61 + 1.3.70 true 1.8 @@ -28,9 +28,9 @@ - scm:git:https://github.com/Sparow199/apollo-client-maven-plugin.git - scm:git:https://github.com/Sparow199/apollo-client-maven-plugin.git - https://github.com/Sparow199/apollo-client-maven-plugin + scm:git:https://github.com/aoudiamoncef/apollo-client-maven-plugin.git + scm:git:https://github.com/aoudiamoncef/apollo-client-maven-plugin.git + https://github.com/aoudiamoncef/apollo-client-maven-plugin HEAD From 3bb8ccb5525af321746e33ac816499a54656b3ae Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Tue, 24 Mar 2020 11:08:04 +0100 Subject: [PATCH 67/82] version(*): Bump version to 2.4.0 Upgrade to Apollo 1.4.1 --- README.md | 6 +++--- apollo-client-maven-plugin-tests/pom.xml | 6 +++--- .../src/test/kotlin/ApolloClientMavenPluginTest.kt | 4 ++-- apollo-client-maven-plugin/pom.xml | 4 ++-- pom.xml | 7 ++++--- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index b4e5b28..bfeab27 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.apollographql.apollo apollo-runtime - 1.3.3 + 1.4.1 @@ -31,7 +31,7 @@ A full usage example can be found in the [test project](https://github.com/sparo org.jetbrains.kotlin kotlin-reflect - 1.3.70 + 1.3.71 ``` @@ -42,7 +42,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 2.3.2 + 2.4.0 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index bc68286..14e3903 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.3.2 + 2.4.0 .. @@ -22,8 +22,8 @@ 2.22.1 true - 2.3.2 - 1.3.3 + 2.4.0 + 1.4.1 3.15.0 6.1.3 5.2.4 diff --git a/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt index b6ffc4e..89dc035 100644 --- a/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt +++ b/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt @@ -1,8 +1,8 @@ package com.lahzouz.java.graphql.client.tests import com.apollographql.apollo.ApolloClient -import com.apollographql.apollo.response.CustomTypeAdapter -import com.apollographql.apollo.response.CustomTypeValue +import com.apollographql.apollo.api.CustomTypeAdapter +import com.apollographql.apollo.api.CustomTypeValue import com.coxautodev.graphql.tools.SchemaParser import com.fasterxml.jackson.databind.ObjectMapper import com.lahzouz.java.graphql.client.tests.queries.GetBooksQuery diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 9eb86d5..04762b6 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.3.2 + 2.4.0 .. @@ -18,7 +18,7 @@ 3.6.0 2.2.1 - 1.3.3 + 1.4.1 4.5.11 diff --git a/pom.xml b/pom.xml index 9958221..fb1e437 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.3.2 + 2.4.0 pom apollo-client-maven-plugin-parent @@ -14,7 +14,7 @@ UTF-8 UTF-8 - 1.3.70 + 1.3.71 true 1.8 @@ -29,7 +29,8 @@ scm:git:https://github.com/aoudiamoncef/apollo-client-maven-plugin.git - scm:git:https://github.com/aoudiamoncef/apollo-client-maven-plugin.git + scm:git:https://github.com/aoudiamoncef/apollo-client-maven-plugin.git + https://github.com/aoudiamoncef/apollo-client-maven-plugin HEAD From afddc0c7131876a384f084562829823aaf8fb01f Mon Sep 17 00:00:00 2001 From: Moncef AOUDIA Date: Tue, 31 Mar 2020 23:32:23 +0200 Subject: [PATCH 68/82] version(*): Bump version to 2.4.1 Upgrade to Apollo 1.4.3 --- README.md | 4 ++-- apollo-client-maven-plugin-tests/pom.xml | 6 +++--- apollo-client-maven-plugin/pom.xml | 4 ++-- pom.xml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index bfeab27..5d95181 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.apollographql.apollo apollo-runtime - 1.4.1 + 1.4.3 @@ -42,7 +42,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 2.4.0 + 2.4.1 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 14e3903..5a26a3a 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.4.0 + 2.4.1 .. @@ -22,8 +22,8 @@ 2.22.1 true - 2.4.0 - 1.4.1 + 2.4.1 + 1.4.3 3.15.0 6.1.3 5.2.4 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 04762b6..e30f891 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.4.0 + 2.4.1 .. @@ -18,7 +18,7 @@ 3.6.0 2.2.1 - 1.4.1 + 1.4.3 4.5.11 diff --git a/pom.xml b/pom.xml index fb1e437..58f7ef1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.4.0 + 2.4.1 pom apollo-client-maven-plugin-parent From dbbc8d7225a6bab804cf86ba7680e7095c77482a Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Tue, 7 Apr 2020 18:19:56 +0200 Subject: [PATCH 69/82] version(*): Bump version to 2.4.2 Upgrade to Apollo 1.4.4 --- README.md | 4 ++-- apollo-client-maven-plugin-tests/pom.xml | 6 +++--- apollo-client-maven-plugin/pom.xml | 4 ++-- pom.xml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5d95181..c786998 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.apollographql.apollo apollo-runtime - 1.4.3 + 1.4.4 @@ -42,7 +42,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 2.4.1 + 2.4.2 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 5a26a3a..7513ffb 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.4.1 + 2.4.2 .. @@ -22,8 +22,8 @@ 2.22.1 true - 2.4.1 - 1.4.3 + 2.4.2 + 1.4.4 3.15.0 6.1.3 5.2.4 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index e30f891..4f5c0b1 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.4.1 + 2.4.2 .. @@ -18,7 +18,7 @@ 3.6.0 2.2.1 - 1.4.3 + 1.4.4 4.5.11 diff --git a/pom.xml b/pom.xml index 58f7ef1..bc15915 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.4.1 + 2.4.2 pom apollo-client-maven-plugin-parent From bfcf4eb98065ba541058c3a0c216e474b5f2ad26 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Fri, 17 Apr 2020 23:11:30 +0200 Subject: [PATCH 70/82] version(*): Bump version to 2.4.3 fix #12 --- README.md | 2 +- apollo-client-maven-plugin-tests/pom.xml | 4 ++-- apollo-client-maven-plugin/pom.xml | 2 +- .../java/graphql/client/maven/plugin/GraphQLClientMojo.kt | 5 ++++- pom.xml | 4 ++-- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c786998..13cae5a 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 2.4.2 + 2.4.3 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 7513ffb..ca96fec 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.4.2 + 2.4.3 .. @@ -22,7 +22,7 @@ 2.22.1 true - 2.4.2 + 2.4.3 1.4.4 3.15.0 6.1.3 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 4f5c0b1..9880a42 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.4.2 + 2.4.3 .. diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index b48eafd..37efc58 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -120,7 +120,10 @@ class GraphQLClientMojo : AbstractMojo() { log.info("Automatically generating introspection file from $schemaUrl") val schema = getIntrospectionSchema(schemaUrl, customHeaders) if (schema.isNotEmpty()) { - File(introspectionFile.toURI()).writeText(schema) + val remoteSchema = File(introspectionFile.toURI()) + remoteSchema.parentFile?.mkdirs() + ?: throw MojoExecutionException("Error, can't create introspection file parent directory") + remoteSchema.writeText(schema) } else { throw MojoExecutionException("Error, can't generate introspection schema file from: $schemaUrl") } diff --git a/pom.xml b/pom.xml index bc15915..e47bad9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.4.2 + 2.4.3 pom apollo-client-maven-plugin-parent @@ -14,7 +14,7 @@ UTF-8 UTF-8 - 1.3.71 + 1.3.72 true 1.8 From 080f2e4ea587ac5c874b5b728d3a03e603b1eacc Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Sat, 18 Apr 2020 11:02:44 +0200 Subject: [PATCH 71/82] version(*): Bump version to 2.4.4 Upgrade to Apollo 1.4.5 --- README.md | 6 +++--- apollo-client-maven-plugin-tests/pom.xml | 8 ++++---- apollo-client-maven-plugin/pom.xml | 4 ++-- pom.xml | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 13cae5a..857ba3c 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.apollographql.apollo apollo-runtime - 1.4.4 + 1.4.5 @@ -31,7 +31,7 @@ A full usage example can be found in the [test project](https://github.com/sparo org.jetbrains.kotlin kotlin-reflect - 1.3.71 + 1.3.72 ``` @@ -42,7 +42,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 2.4.3 + 2.4.4 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index ca96fec..f6d1a6c 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.4.3 + 2.4.4 .. @@ -22,12 +22,12 @@ 2.22.1 true - 2.4.3 - 1.4.4 + 2.4.4 + 1.4.5 3.15.0 6.1.3 5.2.4 - 5.6.0 + 5.6.2 1.7.30 2.0.29.Final diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 9880a42..3905730 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.4.3 + 2.4.4 .. @@ -18,7 +18,7 @@ 3.6.0 2.2.1 - 1.4.4 + 1.4.5 4.5.11 diff --git a/pom.xml b/pom.xml index e47bad9..1c75263 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.4.3 + 2.4.4 pom apollo-client-maven-plugin-parent From fc8c7b434e3a71a3437dbc7176dedd8a263a9e9f Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Wed, 22 Apr 2020 14:16:26 +0200 Subject: [PATCH 72/82] version(*): Bump version to 3.0.0 Upgrade to Apollo 2.0.0 Add Maven sync --- .circleci/config.yml | 20 ++++++++++++++++++- README.md | 6 +++--- apollo-client-maven-plugin-tests/pom.xml | 12 ++++++++--- .../kotlin/ApolloClientMavenPluginTest.kt | 2 +- apollo-client-maven-plugin/pom.xml | 10 ++++++++-- pom.xml | 4 ++-- 6 files changed, 42 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 68a0dfb..3abadcf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,6 +50,14 @@ jobs: name: Deploy the artifacts command: | mvn -s ./.circleci/.circleci.settings.xml -DskipTests deploy -P bintray + sync: + docker: + - image: byrnedo/alpine-curl:0.1.8 + steps: + - run: + name: Sync version Artifacts to Maven Central + command: | + curl -d '{"username": "${SONATYPE_USER_TOKEN}", "password": "${SONATYPE_PASSWORD}"}' -H "Content-Type: application/json" -X POST https://bintray.com/maven_central_sync/sparow199/maven/apollo-client-maven-plugin/3.0.0 workflows: version: 2 @@ -69,4 +77,14 @@ workflows: # ignore any commit on any branch by default branches: ignore: /.*/ - + - sync: + requires: + - build + - deploy + filters: + # only act on version tags + tags: + only: /^v\d+\.\d+\.\d+$/ + # ignore any commit on any branch by default + branches: + ignore: /.*/ diff --git a/README.md b/README.md index 857ba3c..7efd55d 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.apollographql.apollo apollo-runtime - 1.4.5 + 2.0.0 @@ -31,7 +31,7 @@ A full usage example can be found in the [test project](https://github.com/sparo org.jetbrains.kotlin kotlin-reflect - 1.3.72 + 1.6.6 ``` @@ -42,7 +42,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 2.4.4 + 3.0.0 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index f6d1a6c..f28e316 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.4.4 + 3.0.0 .. @@ -22,8 +22,9 @@ 2.22.1 true - 2.4.4 - 1.4.5 + 3.0.0 + 2.0.0 + 19.0.0 3.15.0 6.1.3 5.2.4 @@ -38,6 +39,11 @@ apollo-runtime ${apollo-runtime.version} + + org.jetbrains + annotations + ${annotations.version} + com.graphql-java graphql-java-tools diff --git a/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt index 89dc035..b72985c 100644 --- a/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt +++ b/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt @@ -93,7 +93,7 @@ class ApolloClientMavenPluginTest { val data = mapper.readValue( OkHttpClient().newCall(Request.Builder().url("http://127.0.0.1:$port/graphql/schema.json").build()) .execute() - .body()?.byteStream(), + .body?.byteStream(), Map::class.java ) assertThat(data).isNotEmpty diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 3905730..17c360a 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.4.4 + 3.0.0 .. @@ -18,8 +18,9 @@ 3.6.0 2.2.1 - 1.4.5 + 2.0.0 4.5.11 + 2.5.0 apollo-client-maven-plugin @@ -48,6 +49,11 @@ apollo-compiler ${apollo-compiler.version} + + com.squareup.okio + okio + ${okio.version} + org.apache.httpcomponents httpclient diff --git a/pom.xml b/pom.xml index 1c75263..f40a2fb 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 2.4.4 + 3.0.0 pom apollo-client-maven-plugin-parent @@ -14,7 +14,7 @@ UTF-8 UTF-8 - 1.3.72 + 1.3.61 true 1.8 From 4538832f2c2d097d74b442f6159d7686d10567aa Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Wed, 22 Apr 2020 23:14:22 +0200 Subject: [PATCH 73/82] docs(README): Wrong Kotlin version --- .circleci/config.yml | 1 - README.md | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3abadcf..099d3fb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -79,7 +79,6 @@ workflows: ignore: /.*/ - sync: requires: - - build - deploy filters: # only act on version tags diff --git a/README.md b/README.md index 7efd55d..05f95af 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ A full usage example can be found in the [test project](https://github.com/sparo org.jetbrains.kotlin kotlin-reflect - 1.6.6 + 1.3.71 ``` From 2416ba43d1b99feddfbddcd186042fd20ffb9593 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Thu, 30 Apr 2020 23:47:24 +0200 Subject: [PATCH 74/82] version(*): Bump version to 3.0.1 Upgrade to Apollo 2.0.1 --- .circleci/config.yml | 2 +- README.md | 6 +++--- apollo-client-maven-plugin-tests/pom.xml | 6 +++--- apollo-client-maven-plugin/pom.xml | 4 ++-- pom.xml | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 099d3fb..6e4e1ae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,7 +57,7 @@ jobs: - run: name: Sync version Artifacts to Maven Central command: | - curl -d '{"username": "${SONATYPE_USER_TOKEN}", "password": "${SONATYPE_PASSWORD}"}' -H "Content-Type: application/json" -X POST https://bintray.com/maven_central_sync/sparow199/maven/apollo-client-maven-plugin/3.0.0 + curl -d '{"username": "${SONATYPE_USER_TOKEN}", "password": "${SONATYPE_PASSWORD}"}' -H "Content-Type: application/json" -X POST https://bintray.com/maven_central_sync/sparow199/maven/apollo-client-maven-plugin/3.0.1 workflows: version: 2 diff --git a/README.md b/README.md index 05f95af..8c7207e 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.apollographql.apollo apollo-runtime - 2.0.0 + 2.0.1 @@ -31,7 +31,7 @@ A full usage example can be found in the [test project](https://github.com/sparo org.jetbrains.kotlin kotlin-reflect - 1.3.71 + 1.3.72 ``` @@ -42,7 +42,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 3.0.0 + 3.0.1 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index f28e316..f3e272a 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 3.0.0 + 3.0.1 .. @@ -22,8 +22,8 @@ 2.22.1 true - 3.0.0 - 2.0.0 + 3.0.1 + 2.0.1 19.0.0 3.15.0 6.1.3 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index 17c360a..b34fe05 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 3.0.0 + 3.0.1 .. @@ -18,7 +18,7 @@ 3.6.0 2.2.1 - 2.0.0 + 2.0.1 4.5.11 2.5.0 diff --git a/pom.xml b/pom.xml index f40a2fb..5d72288 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 3.0.0 + 3.0.1 pom apollo-client-maven-plugin-parent @@ -14,7 +14,7 @@ UTF-8 UTF-8 - 1.3.61 + 1.3.72 true 1.8 From d1642593ca2ad7ce81ad1499d6061085387a5b70 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Wed, 6 May 2020 09:59:31 +0200 Subject: [PATCH 75/82] version(*): Bump version to 3.0.2 Upgrade project dependencies --- .circleci/config.yml | 2 +- README.md | 4 ++-- apollo-client-maven-plugin-tests/pom.xml | 10 +++++----- apollo-client-maven-plugin/pom.xml | 4 ++-- pom.xml | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6e4e1ae..4cf1fb9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,7 +57,7 @@ jobs: - run: name: Sync version Artifacts to Maven Central command: | - curl -d '{"username": "${SONATYPE_USER_TOKEN}", "password": "${SONATYPE_PASSWORD}"}' -H "Content-Type: application/json" -X POST https://bintray.com/maven_central_sync/sparow199/maven/apollo-client-maven-plugin/3.0.1 + curl -d '{"username": "${SONATYPE_USER_TOKEN}", "password": "${SONATYPE_PASSWORD}"}' -H "Content-Type: application/json" -X POST https://bintray.com/maven_central_sync/sparow199/maven/apollo-client-maven-plugin/3.0.2 workflows: version: 2 diff --git a/README.md b/README.md index 8c7207e..b8c41f2 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.apollographql.apollo apollo-runtime - 2.0.1 + 2.0.2 @@ -42,7 +42,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 3.0.1 + 3.0.2 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index f3e272a..f4cf081 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 3.0.1 + 3.0.2 .. @@ -22,15 +22,15 @@ 2.22.1 true - 3.0.1 - 2.0.1 + 3.0.2 + 2.0.2 19.0.0 - 3.15.0 + 3.16.0 6.1.3 5.2.4 5.6.2 1.7.30 - 2.0.29.Final + 2.1.0.Final diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index b34fe05..b82193d 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 3.0.1 + 3.0.2 .. @@ -18,7 +18,7 @@ 3.6.0 2.2.1 - 2.0.1 + 2.0.2 4.5.11 2.5.0 diff --git a/pom.xml b/pom.xml index 5d72288..8cfb4df 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 3.0.1 + 3.0.2 pom apollo-client-maven-plugin-parent From 428a2cde5acb27d24b62781e1dd5ea6e395985f0 Mon Sep 17 00:00:00 2001 From: Sparow199 Date: Wed, 6 May 2020 10:15:05 +0200 Subject: [PATCH 76/82] doc(README): Update CircleCI && gist ulrs --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b8c41f2..964a2d3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Apollo GraphQL Client Code Generation Maven Plugin -[![CircleCI](https://circleci.com/gh/aoudiamoncef/apollo-client-maven-plugin.svg?style=svg)](https://circleci.com/gh/Sparow199/apollo-client-maven-plugin) +[![CircleCI](https://circleci.com/gh/aoudiamoncef/apollo-client-maven-plugin.svg?style=svg)](https://circleci.com/gh/aoudiamoncef/apollo-client-maven-plugin) [![Download](https://api.bintray.com/packages/sparow199/maven/apollo-client-maven-plugin/images/download.svg)](https://bintray.com/sparow199/maven/apollo-client-maven-plugin/_latestVersion) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/71b115f870bb44478dac5d05abc9f378)](https://app.codacy.com/app/Sparow199/apollo-client-maven-plugin?utm_source=github.com&utm_medium=referral&utm_content=Sparow199/apollo-client-maven-plugin&utm_campaign=Badge_Grade_Dashboard) [![Known Vulnerabilities](https://snyk.io/test/github/sparow199/apollo-client-maven-plugin/badge.svg)](https://snyk.io/test/github/Sparow199/apollo-client-maven-plugin) @@ -56,7 +56,7 @@ A full usage example can be found in the [test project](https://github.com/sparo ``` -3. Create a file `src/main/graphql/schema.json` with the JSON results of an [introspection query](https://gist.github.com/Sparow199/a59527016e16a2d56309d62e01ff2348) OR you can +3. Create a file `src/main/graphql/schema.json` with the JSON results of an [introspection query](https://gist.github.com/aoudiamoncef/a59527016e16a2d56309d62e01ff2348) OR you can automatically generate this file by setting `generateIntrospectionFile` to true and `schemaUrl` to your GraphQL endpoint. At build time, the plugin will query the server and install this file per the value of `introspectionFile`. 4. Create files for each query you'd like to generate classes for under `src/main/graphql`: From 45b21e2db90be21f8ed5f6873618aa3802d98de3 Mon Sep 17 00:00:00 2001 From: Moncef Date: Mon, 11 May 2020 23:55:29 +0200 Subject: [PATCH 77/82] version(*): Bum version to 3.0.3 Upgrade to Apollo 2.0.3 resolve #26 --- .circleci/config.yml | 2 +- README.md | 5 ++- apollo-client-maven-plugin-tests/pom.xml | 8 ++-- apollo-client-maven-plugin/pom.xml | 4 +- .../client/maven/plugin/GraphQLClientMojo.kt | 5 ++- .../client/maven/plugin/Introspection.kt | 41 ++++++++++++++++--- pom.xml | 2 +- 7 files changed, 51 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4cf1fb9..be5b0d7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,7 +57,7 @@ jobs: - run: name: Sync version Artifacts to Maven Central command: | - curl -d '{"username": "${SONATYPE_USER_TOKEN}", "password": "${SONATYPE_PASSWORD}"}' -H "Content-Type: application/json" -X POST https://bintray.com/maven_central_sync/sparow199/maven/apollo-client-maven-plugin/3.0.2 + curl -d '{"username": "${SONATYPE_USER_TOKEN}", "password": "${SONATYPE_PASSWORD}"}' -H "Content-Type: application/json" -X POST https://bintray.com/maven_central_sync/sparow199/maven/apollo-client-maven-plugin/3.0.3 workflows: version: 2 diff --git a/README.md b/README.md index 964a2d3..41f38a3 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.apollographql.apollo apollo-runtime - 2.0.2 + 2.0.3 @@ -42,7 +42,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 3.0.2 + 3.0.3 @@ -78,6 +78,7 @@ All plugin options and their defaults: ${project.basedir}/src/main/graphql http://localhost/graphql + false com.example.graphql.client ${project.build.directory}/generated-sources/graphql-client com.apollographql.apollo.compiler.OperationIdGenerator$Sha256 diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index f4cf081..727d428 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 3.0.2 + 3.0.3 .. @@ -22,10 +22,10 @@ 2.22.1 true - 3.0.2 - 2.0.2 + 3.0.3 + 2.0.3 19.0.0 - 3.16.0 + 3.16.1 6.1.3 5.2.4 5.6.2 diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index b82193d..fb011cd 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 3.0.2 + 3.0.3 .. @@ -18,7 +18,7 @@ 3.6.0 2.2.1 - 2.0.2 + 2.0.3 4.5.11 2.5.0 diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index 37efc58..8d10517 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -49,6 +49,9 @@ class GraphQLClientMojo : AbstractMojo() { @Parameter(property = "schemaUrlHeaders") private var customHeaders: Map = emptyMap() + @Parameter(property = "useSelfSignedCertificat") + private var useSelfSignedCertificat: Boolean = false + @Parameter(property = "sourceDirName", defaultValue = "\${project.basedir}/src/main/graphql") private lateinit var sourceDirName: String @@ -118,7 +121,7 @@ class GraphQLClientMojo : AbstractMojo() { if (generateIntrospectionFile) { log.info("Automatically generating introspection file from $schemaUrl") - val schema = getIntrospectionSchema(schemaUrl, customHeaders) + val schema = getIntrospectionSchema(schemaUrl, useSelfSignedCertificat, customHeaders) if (schema.isNotEmpty()) { val remoteSchema = File(introspectionFile.toURI()) remoteSchema.parentFile?.mkdirs() diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt index b5f2a68..4b73c44 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt @@ -3,18 +3,47 @@ package com.lahzouz.java.graphql.client.maven.plugin import org.apache.http.HttpHeaders import org.apache.http.client.entity.GzipDecompressingEntity import org.apache.http.client.methods.HttpPost +import org.apache.http.config.RegistryBuilder +import org.apache.http.conn.socket.ConnectionSocketFactory +import org.apache.http.conn.socket.PlainConnectionSocketFactory +import org.apache.http.conn.ssl.NoopHostnameVerifier +import org.apache.http.conn.ssl.SSLConnectionSocketFactory import org.apache.http.entity.StringEntity -import org.apache.http.impl.client.HttpClients +import org.apache.http.impl.client.HttpClientBuilder +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager +import org.apache.http.ssl.SSLContextBuilder import org.apache.http.util.EntityUtils import java.nio.charset.Charset +import java.security.cert.X509Certificate +import javax.net.ssl.SSLContext object Introspection { - fun getIntrospectionSchema(host: String, customHeaders: Map): String { - val client = HttpClients.custom() - .disableContentCompression() - .build() + + fun getIntrospectionSchema(host: String, + useSelfSignedCertificat: Boolean, + customHeaders: Map): String { + + var clientBuilder = HttpClientBuilder.create().disableContentCompression() + + if (useSelfSignedCertificat) { + val sslContext: SSLContext = SSLContextBuilder() + .loadTrustMaterial(null) { x509CertChain: Array?, authType: String? -> true } + .build() + + clientBuilder = HttpClientBuilder.create() + .setSSLContext(sslContext) + .setConnectionManager( + PoolingHttpClientConnectionManager( + RegistryBuilder.create() + .register("http", PlainConnectionSocketFactory.INSTANCE) + .register("https", SSLConnectionSocketFactory(sslContext, + NoopHostnameVerifier.INSTANCE)) + .build() + )) + } + val request = HttpPost(host); val body = StringEntity(introspectionQuery) @@ -27,6 +56,8 @@ object Introspection { setHeader(HttpHeaders.USER_AGENT, "Apollo Client Maven Plugin") customHeaders.forEach { (name, value) -> setHeader(name, value) } } + + val client = clientBuilder.build() val response = client.execute(request) var schema = "" if (200 == response.statusLine.statusCode) { diff --git a/pom.xml b/pom.xml index 8cfb4df..6ee9338 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 3.0.2 + 3.0.3 pom apollo-client-maven-plugin-parent From 7296b82e0ac247c00df91753e2c4e880d2c58d3c Mon Sep 17 00:00:00 2001 From: Moncef Date: Fri, 22 May 2020 13:54:01 +0200 Subject: [PATCH 78/82] version(*): Bump version to 3.1.0 Upgrade to Apollo 2.1.0 --- .circleci/config.yml | 2 +- README.md | 5 +++-- apollo-client-maven-plugin-tests/pom.xml | 6 +++--- .../src/test/kotlin/ApolloClientMavenPluginTest.kt | 6 +++--- apollo-client-maven-plugin/pom.xml | 4 ++-- .../java/graphql/client/maven/plugin/GraphQLClientMojo.kt | 6 +++++- pom.xml | 2 +- 7 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index be5b0d7..444271f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,7 +57,7 @@ jobs: - run: name: Sync version Artifacts to Maven Central command: | - curl -d '{"username": "${SONATYPE_USER_TOKEN}", "password": "${SONATYPE_PASSWORD}"}' -H "Content-Type: application/json" -X POST https://bintray.com/maven_central_sync/sparow199/maven/apollo-client-maven-plugin/3.0.3 + curl -d '{"username": "${SONATYPE_USER_TOKEN}", "password": "${SONATYPE_PASSWORD}"}' -H "Content-Type: application/json" -X POST https://bintray.com/maven_central_sync/sparow199/maven/apollo-client-maven-plugin/3.1.0 workflows: version: 2 diff --git a/README.md b/README.md index 41f38a3..b1940b6 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.apollographql.apollo apollo-runtime - 2.0.3 + 2.1.0 @@ -42,7 +42,7 @@ A full usage example can be found in the [test project](https://github.com/sparo com.github.sparow199 apollo-client-maven-plugin - 3.0.3 + 3.1.0 @@ -91,6 +91,7 @@ All plugin options and their defaults: false false + ``` diff --git a/apollo-client-maven-plugin-tests/pom.xml b/apollo-client-maven-plugin-tests/pom.xml index 727d428..a49730e 100644 --- a/apollo-client-maven-plugin-tests/pom.xml +++ b/apollo-client-maven-plugin-tests/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 3.0.3 + 3.1.0 .. @@ -22,8 +22,8 @@ 2.22.1 true - 3.0.3 - 2.0.3 + 3.1.0 + 2.1.0 19.0.0 3.16.1 6.1.3 diff --git a/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt index b72985c..e94e0f4 100644 --- a/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt +++ b/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt @@ -93,7 +93,7 @@ class ApolloClientMavenPluginTest { val data = mapper.readValue( OkHttpClient().newCall(Request.Builder().url("http://127.0.0.1:$port/graphql/schema.json").build()) .execute() - .body?.byteStream(), + .body()?.byteStream(), Map::class.java ) assertThat(data).isNotEmpty @@ -105,14 +105,14 @@ class ApolloClientMavenPluginTest { @DisplayName("generated book query returns data") fun bookQueryTest() { val response = client.query(GetBooksQuery()).toCompletableFuture().join() - assertThat(response.data()?.get()?.books).isNotEmpty.hasSize(4) + assertThat(response.data?.get()?.books).isNotEmpty.hasSize(4) } @Test @DisplayName("generated author query returns data") fun authorQueryTest() { val response = client.query(GetAuthorsQuery()).toCompletableFuture().join() - assertThat(response.data()?.get()?.authors).isNotEmpty.hasSize(2) + assertThat(response.data?.get()?.authors).isNotEmpty.hasSize(2) } private fun createServlet(schema: GraphQLSchema): SimpleGraphQLHttpServlet { diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml index fb011cd..d40996b 100644 --- a/apollo-client-maven-plugin/pom.xml +++ b/apollo-client-maven-plugin/pom.xml @@ -5,7 +5,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 3.0.3 + 3.1.0 .. @@ -18,7 +18,7 @@ 3.6.0 2.2.1 - 2.0.3 + 2.1.0 4.5.11 2.5.0 diff --git a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt index 8d10517..03f9d96 100644 --- a/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt +++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt @@ -94,6 +94,9 @@ class GraphQLClientMojo : AbstractMojo() { @Parameter(property = "generateVisitorForPolymorphicDatatypes") private var generateVisitorForPolymorphicDatatypes: Boolean = true + @Parameter(property = "enumAsSealedClassPatternFilters") + private var enumAsSealedClassPatternFilters: List = emptyList() + @Throws(MojoExecutionException::class) override fun execute() { @@ -165,7 +168,8 @@ class GraphQLClientMojo : AbstractMojo() { suppressRawTypesWarning = suppressRawTypesWarning, generateKotlinModels = generateKotlinModels, generateAsInternal = generateAsInternal, - generateVisitorForPolymorphicDatatypes = generateVisitorForPolymorphicDatatypes) + generateVisitorForPolymorphicDatatypes = generateVisitorForPolymorphicDatatypes, + enumAsSealedClassPatternFilters = enumAsSealedClassPatternFilters) ) if (addSourceRoot) { diff --git a/pom.xml b/pom.xml index 6ee9338..a536a80 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.github.sparow199 apollo-client-maven-plugin-parent - 3.0.3 + 3.1.0 pom apollo-client-maven-plugin-parent From 4d0388109d607a23493bfa35f5ac4240259349e3 Mon Sep 17 00:00:00 2001 From: Moncef Date: Sat, 13 Jun 2020 13:43:18 +0200 Subject: [PATCH 79/82] style(*): Add Klint Add CONTRIBUTING && CODE_Of_CONDUCT files --- .circleci/config.yml | 2 +- .githooks/commit-msg | 21 ++ CODE_OF_CONDUCT.md | 46 ++++ CONTRIBUTING.md | 128 ++++++++++ README.md | 2 +- apollo-client-maven-plugin-tests/pom.xml | 6 +- .../kotlin/ApolloClientMavenPluginTest.kt | 49 ++-- .../src/test/kotlin/Query.kt | 10 +- apollo-client-maven-plugin/pom.xml | 10 +- .../client/maven/plugin/GraphQLClientMojo.kt | 40 +-- .../client/maven/plugin/Introspection.kt | 227 +++++++++--------- pom.xml | 77 +++++- 12 files changed, 455 insertions(+), 163 deletions(-) create mode 100644 .githooks/commit-msg create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md diff --git a/.circleci/config.yml b/.circleci/config.yml index 444271f..1c11bec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,7 +57,7 @@ jobs: - run: name: Sync version Artifacts to Maven Central command: | - curl -d '{"username": "${SONATYPE_USER_TOKEN}", "password": "${SONATYPE_PASSWORD}"}' -H "Content-Type: application/json" -X POST https://bintray.com/maven_central_sync/sparow199/maven/apollo-client-maven-plugin/3.1.0 + curl -d '{"username": "${SONATYPE_USER_TOKEN}", "password": "${SONATYPE_PASSWORD}"}' -H "Content-Type: application/json" -X POST https://bintray.com/maven_central_sync/sparow199/maven/apollo-client-maven-plugin/3.2.0-SNAPSHOT workflows: version: 2 diff --git a/.githooks/commit-msg b/.githooks/commit-msg new file mode 100644 index 0000000..bc772b6 --- /dev/null +++ b/.githooks/commit-msg @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# Create a regex for a conventional commit. +conventional_commit_regex="^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([a-z \-]+\))?!?: .+$" + +# Get the commit message (the parameter we're given is just the path to the +# temporary file which holds the message). +commit_message=$(cat "$1") + +# Check the message, if we match, all good baby. +if [[ "$commit_message" =~ $conventional_commit_regex ]]; then + echo -e "\e[32mCommit message meets Conventional Commit standards...\e[0m" + exit 0 +fi + +# Uh-oh, this is not a conventional commit, show an example and link to the spec. +echo -e "\e[31mThe commit message does not meet the Conventional Commit standard\e[0m" +echo "An example of a valid message is: " +echo " feat(login): add the 'remember me' button" +echo "More details at: https://www.conventionalcommits.org/en/v1.0.0/#summary" +exit 1 \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..02ff287 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at romain.rouvoy@inria.fr. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..3afbb58 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,128 @@ +# Contributing to the project + +As a contributor, here are the guidelines we would like you to follow: + + - [Commit Message Guidelines](#commit) + - [Commit Message Format](#format) + - [Revert a commit](#revert) + - [Commit type](#type) + - [Commit subject](#subject) + - [Commit body](#body) + - [Commit footer](#footer) +- [WorkFlow](#branch) + - [GitFlow](#gitflow) +- [Code formatter](#code-formatter) + + +## Commit Message Guidelines + +We have very precise rules over how our git commit messages can be formatted. This leads to **more +readable messages** that are easy to follow when looking through the **project history**. + +### Commit Message Format +Each commit message consists of a **header**, a **body** and a **footer**. The header has a special +format that includes a **type** and a **subject**: + +``` +(): + + + +