diff --git a/.circleci/.circleci.settings.xml b/.circleci/.circleci.settings.xml
new file mode 100644
index 0000000..a0492b4
--- /dev/null
+++ b/.circleci/.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
new file mode 100644
index 0000000..08d24a8
--- /dev/null
+++ b/.circleci/config.yml
@@ -0,0 +1,89 @@
+version: 2
+general:
+ branches:
+ only:
+ - master
+ - develop
+ - /feature/.*/
+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:resolve-plugins
+ mvn dependency:go-offline || true
+ - save_cache:
+ paths:
+ - ~/.m2
+ key: v1-dependencies-{{ checksum "pom.xml" }}
+ - run: mvn clean test
+
+ deploy:
+ 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:resolve-plugins
+ mvn dependency:go-offline || true
+ - save_cache:
+ paths:
+ - ~/.m2
+ key: v1-dependencies-{{ checksum "pom.xml" }}
+ - run:
+ 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.2.1
+
+workflows:
+ version: 2
+ build-deploy:
+ jobs:
+ - build:
+ filters:
+ tags:
+ only: /.*/
+ - deploy:
+ requires:
+ - build
+ filters:
+ # only act on version tags
+ tags:
+ only: /^v\d+\.\d+\.\d+$/
+ # ignore any commit on any branch by default
+ branches:
+ ignore: /.*/
+ - sync:
+ requires:
+ - 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/.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/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..b76b895
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,10 @@
+version: 2
+updates:
+ - package-ecosystem: "maven"
+ directory: "/"
+ schedule:
+ interval: "daily"
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "daily"
diff --git a/.gitignore b/.gitignore
index 41694bb..1959293 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,281 @@
-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/**/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
+*.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
+
+### 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
+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
+/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
-node_modules/
-node/
\ No newline at end of file
+apollo-client-maven-plugin/\.factorypath
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.jar b/.mvn/wrapper/maven-wrapper.jar
new file mode 100644
index 0000000..01e6799
Binary files /dev/null and b/.mvn/wrapper/maven-wrapper.jar differ
diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
new file mode 100644
index 0000000..c63408c
--- /dev/null
+++ b/.mvn/wrapper/maven-wrapper.properties
@@ -0,0 +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/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**:
+
+```
+():
+
+
+
+
+```
+
+The **header** is mandatory .
+
+Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
+to read on GitHub as well as in various git tools.
+
+The **header** is mandatory and the **scope** of the header is optional.
+
+Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
+to read on GitHub as well as in various git tools.
+
+The footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any.
+It could be replaced by the reference of your Jira ticket.
+
+
+Samples:
+
+```markdown
+docs(changelog): update changelog to beta.5
+```
+
+```markdown
+fix(release): need to depend on latest Gson library
+
+The version of Gson library need to be updated in order to build the project.
+```
+
+Footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any.
+
+### Revert
+If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit .`, where the hash is the SHA of the commit being reverted.
+
+### Type
+Must be one of the following:
+
+- **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm).
+- **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs).
+- **docs**: Documentation only changes.
+- **feat**: A new feature.
+- **fix**: A bug fix.
+- **perf**: A code change that improves performance.
+- **refactor**: A code change that neither fixes a bug nor adds a feature.
+- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc).
+- **test**: Adding missing tests or correcting existing tests.
+- **chore**: Others modifications that don't modify src or test files.
+- **revert**: Reverts a previous commit.
+
+### Subject
+The subject contains succinct description of the change
+
+### Body
+The body should include the motivation for the change and contrast this with previous behavior.
+
+### Footer
+The footer should contain any information about **Breaking Changes** and is also the place to
+reference GitHub issues that this commit **Closes**.
+
+**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
+
+>notes:
+> Please enable GitHooks in order to check your commit messages:
+> ```console
+> git config core.hooksPath .githooks
+> ```
+
+More information about [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/).
+
+>notes:
+> Force using Linux EOF in your Windows machine repositories:
+> ```shell
+> git config --global core.autocrlf false
+> git config --global core.eol lf
+> git rm --cached -rf .
+> git diff --cached --name-only -z | xargs -n 50 -0 git add -f
+> ```
+
+## WorkFlow
+
+### GitFlow
+
+We adopt towards to [GitFlow](http://nvie.com/posts/a-successful-git-branching-model/) which is a Git workflow design that was first published and made popular by Vincent Driessen at nvie.
+
+Cheatsheet [GitFlow](https://danielkummer.github.io/git-flow-cheatsheet/).
+
+Create a new pull request on Bitbucket (only if Bitbucket don't find any conflict).
+
+French article about [GitFlow](https://fr.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) by Atlassian.
+
+## Code formatter
+
+1. Install [Klint](https://github.com/pinterest/ktlint).
+
+2. Apply Ktlint settings:
+ ```console
+ ktlint applyToIDEAProject
+ ```
\ No newline at end of file
diff --git a/README.md b/README.md
index e6da560..6519d1b 100644
--- a/README.md
+++ b/README.md
@@ -1,40 +1,69 @@
# Apollo GraphQL Client Code Generation 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)
+![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/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
-**NOTE: This plugin requires a nodejs environment to execute the bundled apollo-codegen node module.**
+1. Add the apollo runtime library to your project's dependencies:
-1. Add the apollo runtime library and guava to your project's depedencies:
- ```xml
+```xml
+
+
+ com.apollographql.apollo
+ apollo-runtime
+ 2.2.2
+
- com.apollographql.apollo
- apollo-runtime
- 0.4.0
+ com.squareup.okio
+ okio
+ 2.5.0
- ```
-2. Add the code generator plugin to your project's build (if codegen is desired):
- ```xml
-
- com.coxautodev
- apollo-client-maven-plugin
- 1.1.0
-
-
-
- generate
-
-
- com.my.package.graphql.client
-
-
-
-
- ```
-3. Create a file `src/main/graphql/schema.json` with the JSON results of an [introspection query](https://gist.github.com/craigbeck/b90915d49fda19d5b2b17ead14dcd6da)
+
+
+ org.jetbrains
+ annotations
+ 19.0.0
+
+
+ org.jetbrains.kotlin
+ kotlin-reflect
+ 1.3.72
+
+
+```
+
+2. Add the code generator plugin to your project's build:
+
+```xml
+
+ com.github.sparow199
+ apollo-client-maven-plugin
+ 3.2.1
+
+
+
+ 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/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`:
1. Query file names must match the name of the query they contain
2. Query files must end with `.graphql`
@@ -44,12 +73,58 @@ A full usage example can be found in the [test project](https://github.com/Cox-A
### Configuration Options
All plugin options and their defaults:
+
```xml
- ${project.build.directory}/generated-sources/graphql-client
- com.example.graphql.client
- ${project.basedir}/src/main/graphql/schema.json
+ false
true
+ ${project.basedir}/src/main/graphql/schema.json
+ false
+ ${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
+ true
+ true
+ true
+ JAVA_OPTIONAL
+ false
+ false
+ false
+ false
+
+
+
+```
+
+#### Nullable Types
+
+Available nullable types:
+
+```java
+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.
+
+#### 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
+
```
@@ -69,12 +144,53 @@ 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 ApolloException t) {
+ ...
+ }
+ });
+```
+
+#### 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;
+ }
}
```
+#### Using Apollo without `apollo-runtime`
-Properties specified as nullable in the schema will have an java 8 `java.util.optional` type.
+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 fcfe29f..adb6787 100644
--- a/apollo-client-maven-plugin-tests/pom.xml
+++ b/apollo-client-maven-plugin-tests/pom.xml
@@ -1,42 +1,59 @@
-
+
4.0.0
- com.coxautodev
+ com.github.sparow199
apollo-client-maven-plugin-parent
- 1.1.3-SNAPSHOT
+ 3.2.1
..
apollo-client-maven-plugin-tests
jar
-
apollo-client-maven-plugin-tests
Test for maven plugin
- https://github.com/Cox-Automotive/apollo-client-maven-plugin
+ https://github.com/aoudiamoncef/apollo-client-maven-plugin
+ UTF-8
+ UTF-8
+
+ 2.22.1
true
- 1.4.14.Final
+
+ 3.2.1
+ 2.2.2
+ 19.0.0
+ 3.16.1
+ 6.1.3
+ 5.2.4
+ 5.6.2
+ 1.7.30
+ 2.1.3.Final
com.apollographql.apollo
apollo-runtime
- 0.4.0
+ ${apollo-runtime.version}
+
+
+ org.jetbrains
+ annotations
+ ${annotations.version}
-
com.graphql-java
graphql-java-tools
- 2.2.0
+ ${graphql-java-tools.version}
test
com.graphql-java
graphql-java-servlet
- 3.0.1
+ ${graphql-java-servlet.version}
test
@@ -45,6 +62,12 @@
${undertow.version}
test
+
+ org.assertj
+ assertj-core
+ ${assertj-core.version}
+ test
+
io.undertow
undertow-servlet
@@ -52,30 +75,90 @@
test
- org.springframework
- spring-test
- 4.3.8.RELEASE
+ org.junit.jupiter
+ junit-jupiter
+ ${junit.jupiter.version}
+ test
+
+
+ org.slf4j
+ slf4j-simple
+ ${slf4j-simple.version}
test
+ ${project.basedir}/src/test/kotlin
- com.coxautodev
+ com.github.sparow199
apollo-client-maven-plugin
- 1.1.3-SNAPSHOT
+ ${apollo-client-maven-plugin.version}
generate
- com.coxautodev.java.graphql.client.tests
+ false
+ true
+ false
+ ${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
+
+ true
+ true
+ true
+ JAVA_OPTIONAL
+ false
+ false
+ false
+ false
+
+ java.lang.Long
+
+
+
+
+
+
+ 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
+
+
\ No newline at end of file
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..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,147 +1,305 @@
{
- "__schema" : {
- "queryType" : {
- "name" : "Query"
- },
- "mutationType" : null,
- "subscriptionType" : null,
- "types" : [ {
- "kind" : "OBJECT",
- "name" : "Query",
- "description" : null,
- "fields" : [ {
- "name" : "books",
- "description" : null,
- "args" : [ ],
- "type" : {
- "kind" : "NON_NULL",
- "name" : null,
- "ofType" : {
- "kind" : "LIST",
+ "data" : {
+ "__schema" : {
+ "queryType" : {
+ "name" : "Query"
+ },
+ "mutationType" : null,
+ "subscriptionType" : null,
+ "types" : [ {
+ "kind" : "OBJECT",
+ "name" : "Query",
+ "description" : "",
+ "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
- }, {
- "name" : "authors",
- "description" : null,
- "args" : [ ],
- "type" : {
- "kind" : "NON_NULL",
- "name" : null,
- "ofType" : {
- "kind" : "LIST",
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "authors",
+ "description" : "",
+ "args" : [ ],
+ "type" : {
+ "kind" : "NON_NULL",
"name" : null,
"ofType" : {
- "kind" : "NON_NULL",
+ "kind" : "LIST",
"name" : null,
"ofType" : {
- "kind" : "OBJECT",
- "name" : "Author"
+ "kind" : "NON_NULL",
+ "name" : null,
+ "ofType" : {
+ "kind" : "OBJECT",
+ "name" : "Author"
+ }
}
}
- }
- },
- "isDeprecated" : false,
- "deprecationReason" : null
- } ],
- "inputFields" : null,
- "interfaces" : [ ],
- "enumValues" : null,
- "possibleTypes" : null
- }, {
- "kind" : "OBJECT",
- "name" : "Book",
- "description" : null,
- "fields" : [ {
- "name" : "title",
- "description" : null,
- "args" : [ ],
- "type" : {
- "kind" : "NON_NULL",
- "name" : null,
- "ofType" : {
- "kind" : "SCALAR",
- "name" : "String",
+ },
+ "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",
+ "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" : "NON_NULL",
+ "name" : null,
+ "ofType" : {
+ "kind" : "OBJECT",
+ "name" : "__Type"
+ }
+ }
+ }
+ },
+ "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" : null,
- "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
- } ],
- "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" : "OBJECT",
- "name" : "Author",
- "description" : null,
- "fields" : [ {
- "name" : "name",
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ } ],
+ "inputFields" : null,
+ "interfaces" : [ ],
+ "enumValues" : null,
+ "possibleTypes" : null
+ }, {
+ "kind" : "OBJECT",
+ "name" : "__Type",
"description" : null,
- "args" : [ ],
- "type" : {
- "kind" : "NON_NULL",
- "name" : null,
- "ofType" : {
+ "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" : "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" : "description",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "SCALAR",
+ "name" : "String",
+ "ofType" : null
+ },
+ "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" : {
@@ -149,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" : {
@@ -197,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" : {
@@ -304,555 +528,413 @@
"name" : "__Type",
"ofType" : null
}
- }
- },
- "isDeprecated" : false,
- "deprecationReason" : null
- }, {
- "name" : "possibleTypes",
- "description" : null,
- "args" : [ ],
- "type" : {
- "kind" : "LIST",
- "name" : null,
- "ofType" : {
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "isDeprecated",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
"kind" : "NON_NULL",
"name" : null,
"ofType" : {
- "kind" : "OBJECT",
- "name" : "__Type",
+ "kind" : "SCALAR",
+ "name" : "Boolean",
"ofType" : null
}
- }
- },
- "isDeprecated" : false,
- "deprecationReason" : null
- }, {
- "name" : "enumValues",
- "description" : null,
- "args" : [ {
- "name" : "includeDeprecated",
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "deprecationReason",
"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" : "OBJECT",
+ "name" : "__InputValue",
+ "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" : "type",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
"kind" : "NON_NULL",
"name" : null,
"ofType" : {
"kind" : "OBJECT",
- "name" : "__InputValue",
+ "name" : "__Type",
"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" : "defaultValue",
+ "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" : "args",
- "description" : null,
- "args" : [ ],
- "type" : {
- "kind" : "NON_NULL",
- "name" : null,
- "ofType" : {
- "kind" : "LIST",
+ },
+ "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" : {
- "kind" : "NON_NULL",
- "name" : null,
- "ofType" : {
- "kind" : "OBJECT",
- "name" : "__InputValue"
- }
+ "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" : "isDeprecated",
- "description" : null,
- "args" : [ ],
- "type" : {
- "kind" : "NON_NULL",
- "name" : null,
- "ofType" : {
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "description",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
"kind" : "SCALAR",
- "name" : "Boolean",
+ "name" : "String",
"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" : {
+ },
+ "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
- }, {
- "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
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ } ],
+ "inputFields" : null,
+ "interfaces" : [ ],
+ "enumValues" : null,
+ "possibleTypes" : 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",
+ "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" : "isDeprecated",
- "description" : null,
- "args" : [ ],
- "type" : {
- "kind" : "NON_NULL",
- "name" : null,
- "ofType" : {
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "description",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
"kind" : "SCALAR",
- "name" : "Boolean",
+ "name" : "String",
"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" : "__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" : {
- "kind" : "NON_NULL",
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "locations",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "LIST",
"name" : null,
"ofType" : {
- "kind" : "ENUM",
- "name" : "__DirectiveLocation",
- "ofType" : null
+ "kind" : "NON_NULL",
+ "name" : null,
+ "ofType" : {
+ "kind" : "ENUM",
+ "name" : "__DirectiveLocation",
+ "ofType" : null
+ }
}
- }
- },
- "isDeprecated" : false,
- "deprecationReason" : null
- }, {
- "name" : "args",
- "description" : null,
- "args" : [ ],
- "type" : {
- "kind" : "NON_NULL",
- "name" : null,
- "ofType" : {
- "kind" : "LIST",
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "args",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
+ "kind" : "NON_NULL",
"name" : null,
"ofType" : {
- "kind" : "NON_NULL",
+ "kind" : "LIST",
"name" : null,
"ofType" : {
- "kind" : "OBJECT",
- "name" : "__InputValue"
+ "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" : 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
- } ],
- "possibleTypes" : null
- } ],
- "directives" : [ {
- "name" : "include",
- "description" : "Directs the executor to include this field or fragment only when the `if` argument is true",
- "args" : [ {
- "name" : "if",
- "description" : "Included when true.",
- "type" : {
- "kind" : "NON_NULL",
- "name" : null,
- "ofType" : {
+ },
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ }, {
+ "name" : "onOperation",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
"kind" : "SCALAR",
"name" : "Boolean",
"ofType" : null
- }
- },
- "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.",
- "args" : [ {
- "name" : "if",
- "description" : "Skipped when true.",
- "type" : {
- "kind" : "NON_NULL",
- "name" : null,
- "ofType" : {
+ },
+ "isDeprecated" : true,
+ "deprecationReason" : "Use `locations`."
+ }, {
+ "name" : "onFragment",
+ "description" : null,
+ "args" : [ ],
+ "type" : {
"kind" : "SCALAR",
"name" : "Boolean",
"ofType" : null
- }
- },
- "defaultValue" : 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
+ }, {
+ "name" : "INPUT_FIELD_DEFINITION",
+ "description" : "Indicates the directive is valid on an input object field SDL definition.",
+ "isDeprecated" : false,
+ "deprecationReason" : null
+ } ],
+ "possibleTypes" : null
} ],
- "onOperation" : false,
- "onFragment" : true,
- "onField" : true
- } ]
+ "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" : [ ]
+ } ]
+ }
}
}
\ No newline at end of file
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
deleted file mode 100644
index fded993..0000000
--- a/apollo-client-maven-plugin-tests/src/test/groovy/com/coxautodev/java/graphql/client/tests/IntegrationSpec.groovy
+++ /dev/null
@@ -1,102 +0,0 @@
-package com.coxautodev.java.graphql.client.tests
-
-import com.apollographql.apollo.ApolloClient
-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.fasterxml.jackson.databind.ObjectMapper
-import graphql.execution.SimpleExecutionStrategy
-import graphql.servlet.GraphQLServlet
-import graphql.servlet.SimpleGraphQLServlet
-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 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() {
- GraphQLServlet servlet = new SimpleGraphQLServlet(
- SchemaParser.newParser()
- .file('schema.graphqls')
- .resolvers(new Query())
- .dataClasses(Query.Book, Query.Author)
- .build()
- .makeExecutableSchema(),
-
- new SimpleExecutionStrategy()
- )
-
- DeploymentInfo servletBuilder = Servlets.deployment()
- .setClassLoader(getClass().getClassLoader())
- .setContextPath("/")
- .setDeploymentName("test")
- .addServlets(Servlets.servlet("GraphQLServlet", GraphQLServlet, 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()
-
- client = ApolloClient.builder()
- .serverUrl("http://127.0.0.1:$port/graphql")
- .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"() {
- expect:
- client.newCall(new GetBooksQuery()).execute().data().get().books().size() == 4
- }
-
- def "generated author query returns data"() {
- expect:
- client.newCall(new GetAuthorsQuery()).execute().data().get().authors().size() == 2
- }
-}
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
deleted file mode 100644
index 9f9572b..0000000
--- a/apollo-client-maven-plugin-tests/src/test/groovy/com/coxautodev/java/graphql/client/tests/Query.groovy
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.coxautodev.java.graphql.client.tests
-
-import com.coxautodev.graphql.tools.GraphQLRootResolver
-
-/**
- * @author Andrew Potter
- */
-class Query implements GraphQLRootResolver {
-
- 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),
- 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),
- )
- }
-
- List getBooks() {
- return books
- }
-
- List getAuthors() {
- return authors
- }
-
- static class Book {
- private String title
- private Author author
-
- String getTitle() {
- return title
- }
-
- Author getAuthor() {
- return author
- }
- }
-
- static class Author {
- private String name
-
- String getName() {
- return name
- }
- }
-}
diff --git a/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt
new file mode 100644
index 0000000..64563fc
--- /dev/null
+++ b/apollo-client-maven-plugin-tests/src/test/kotlin/ApolloClientMavenPluginTest.kt
@@ -0,0 +1,130 @@
+package com.lahzouz.java.graphql.client.tests
+
+import com.apollographql.apollo.ApolloClient
+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
+import com.lahzouz.java.graphql.client.tests.queries.author.GetAuthorsQuery
+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.assertj.core.api.Assertions.assertThat
+import org.junit.jupiter.api.AfterAll
+import org.junit.jupiter.api.BeforeAll
+import org.junit.jupiter.api.DisplayName
+import org.junit.jupiter.api.Test
+import org.junit.jupiter.api.TestInstance
+import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
+import java.io.File
+import java.math.BigDecimal
+import java.net.InetSocketAddress
+import javax.servlet.Servlet
+
+/**
+ * @author AOUDIA Moncef
+ */
+@TestInstance(PER_CLASS)
+class ApolloClientMavenPluginTest {
+
+ 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 as 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
+ @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())
+ .execute()
+ .body()?.byteStream(),
+ Map::class.java
+ )
+ assertThat(data).isNotEmpty
+
+ File("src/main/graphql/schema.json").writeText(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(data))
+ }
+
+ @Test
+ @DisplayName("generated book query returns data")
+ fun bookQueryTest() {
+ 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 response = client.query(GetAuthorsQuery()).toCompletableFuture().join()
+ assertThat(response.data?.get()?.authors).isNotEmpty.hasSize(2)
+ }
+
+ 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..ba0fbde
--- /dev/null
+++ b/apollo-client-maven-plugin-tests/src/test/kotlin/Query.kt
@@ -0,0 +1,27 @@
+package com.lahzouz.java.graphql.client.tests
+
+import com.coxautodev.graphql.tools.GraphQLQueryResolver
+
+/**
+ * @author AOUDIA Moncef
+ */
+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/extensions.kt b/apollo-client-maven-plugin-tests/src/test/kotlin/extensions.kt
new file mode 100644
index 0000000..ca0e858
--- /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 AOUDIA Moncef
+ */
+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
+}
diff --git a/apollo-client-maven-plugin/pom.xml b/apollo-client-maven-plugin/pom.xml
index 4b399f5..c85ab1b 100644
--- a/apollo-client-maven-plugin/pom.xml
+++ b/apollo-client-maven-plugin/pom.xml
@@ -1,85 +1,69 @@
-
+
4.0.0
- com.coxautodev
+ com.github.sparow199
apollo-client-maven-plugin-parent
- 1.1.3-SNAPSHOT
+ 3.2.1
..
apollo-client-maven-plugin
maven-plugin
+
+ UTF-8
+ UTF-8
+
+ 3.6.0
+ 2.2.1
+ 2.2.2
+ 4.5.11
+ 2.5.0
+
+
apollo-client-maven-plugin
Maven plugin for generating graphql clients
- https://github.com/Cox-Automotive/apollo-client-maven-plugin
+ https://github.com/aoudiamoncef/apollo-client-maven-plugin
+
org.apache.maven
maven-plugin-api
- 3.0
+ ${maven-plugin.version}
org.apache.maven.plugin-tools
maven-plugin-annotations
- 3.4
+ ${maven-plugin.version}
provided
org.apache.maven
maven-project
- 2.2.1
+ ${maven-project.version}
-
com.apollographql.apollo
- compiler
- 0.4.0
+ apollo-compiler
+ ${apollo-compiler.version}
-
- commons-io
- commons-io
- 2.5
+ com.squareup.okio
+ okio
+ ${okio.version}
- org.reflections
- reflections
- 0.9.11
+ org.apache.httpcomponents
+ httpclient
+ ${httpclient.version}
-
-
- ${project.build.directory}/node_modules
- node_modules
-
-
-
-
- org.codehaus.mojo
- exec-maven-plugin
- 1.6.0
-
-
- generate-resources
-
- exec
-
-
-
-
- npm
- ${project.build.directory}
-
- install
- apollo-codegen
-
-
-
-
+ ${project.basedir}/src/main/kotlin
-
\ No newline at end of file
+
+
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
deleted file mode 100644
index 4fbfac4..0000000
--- a/apollo-client-maven-plugin/src/main/kotlin/com/coxautodev/java/graphql/client/maven/plugin/GraphQLClientMojo.kt
+++ /dev/null
@@ -1,140 +0,0 @@
-package com.coxautodev.java.graphql.client.maven.plugin
-
-import com.apollographql.apollo.compiler.GraphQLCompiler
-import com.apollographql.apollo.compiler.NullableValueType
-import org.apache.maven.plugin.AbstractMojo
-import org.apache.maven.plugin.MojoExecutionException
-import org.apache.maven.plugins.annotations.LifecyclePhase
-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
-
-
-/**
- * Generates classes for a graphql API
- */
-@Mojo(name = "generate",
- requiresDependencyCollection = ResolutionScope.COMPILE,
- requiresDependencyResolution = ResolutionScope.COMPILE,
- defaultPhase = LifecyclePhase.GENERATE_SOURCES,
- threadSafe = true
-)
-class GraphQLClientMojo: AbstractMojo() {
-
- @Parameter(property = "outputDirectory", defaultValue = "\${project.build.directory}/generated-sources/graphql-client")
- private var outputDirectory: File? = null
-
- @Parameter(property = "basePackage", defaultValue = "com.example.graphql.client")
- private var basePackage: 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
-
- @Throws(MojoExecutionException::class)
- override fun execute() {
- val project = this.project!!
- val outputDirectory = this.outputDirectory!!
- val basePackage = this.basePackage!!
- val introspectionFile = this.introspectionFile!!
-
- 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")
- }
-
- 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}")
- }
-
- 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(Regex("/"), 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 IllegalArgumentException("Introspection JSON not found: ${introspectionFile.absolutePath}")
- }
-
- if(!apolloCli.isFile) {
- throw IllegalStateException("Apollo codegen cli not found: '${apolloCli.absolutePath}'")
- }
-
- 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)
- }
-
- // 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())
- .directory(nodeModules.parentFile)
- .inheritIO()
- .start()
-
- if(proc.waitFor() != 0) {
- throw IllegalStateException("Apollo codegen cli command failed")
- }
-
- val compiler = GraphQLCompiler()
- compiler.write(GraphQLCompiler.Arguments(schema, outputDirectory, mapOf(), NullableValueType.JAVA_OPTIONAL, true, true))
-
- if(addSourceRoot == true) {
- project.addCompileSourceRoot(outputDirectory.absolutePath)
- }
- }
-
- 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/GraphQLClientMojo.kt b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt
new file mode 100644
index 0000000..e171784
--- /dev/null
+++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/GraphQLClientMojo.kt
@@ -0,0 +1,186 @@
+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
+import org.apache.maven.plugin.AbstractMojo
+import org.apache.maven.plugin.MojoExecutionException
+import org.apache.maven.plugins.annotations.LifecyclePhase
+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 java.io.File
+import java.nio.file.Files
+import java.util.stream.Collectors
+import kotlin.reflect.full.createInstance
+
+/**
+ * Generate queries classes for a GraphQl API
+ */
+@Mojo(
+ name = "generate",
+ requiresDependencyCollection = ResolutionScope.COMPILE,
+ requiresDependencyResolution = ResolutionScope.COMPILE,
+ defaultPhase = LifecyclePhase.GENERATE_SOURCES,
+ threadSafe = true
+)
+class GraphQLClientMojo : AbstractMojo() {
+
+ @Parameter(defaultValue = "\${project}")
+ private lateinit var project: MavenProject
+
+ @Parameter(property = "introspectionFile", defaultValue = "\${project.basedir}/src/main/graphql/schema.json")
+ private lateinit var introspectionFile: File
+
+ @Parameter(
+ property = "outputDirectory",
+ defaultValue = "\${project.build.directory}/generated-sources/graphql-client"
+ )
+ private lateinit var outputDirectory: File
+
+ @Parameter(property = "rootPackageName", defaultValue = "com.example.graphql.client")
+ private lateinit var rootPackageName: String
+
+ @Parameter(property = "schemaUrl", defaultValue = "http://localhost/graphql")
+ private lateinit var schemaUrl: String
+
+ @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
+
+ @Parameter(property = "customTypeMap")
+ private var customTypeMap: Map = emptyMap()
+
+ @Parameter(property = "nullableValueType", defaultValue = "JAVA_OPTIONAL")
+ private lateinit var nullableValueType: NullableValueType
+
+ @Parameter(property = "operationIdGeneratorClass")
+ private var operationIdGeneratorClass: String = ""
+
+ @Parameter(property = "generateIntrospectionFile")
+ private var generateIntrospectionFile: Boolean = false
+
+ @Parameter(property = "skip")
+ private var skip: Boolean = false
+
+ @Parameter(property = "addSourceRoot")
+ private var addSourceRoot: Boolean = true
+
+ @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 = true
+
+ @Parameter(property = "generateKotlinModels")
+ private var generateKotlinModels: Boolean = false
+
+ @Parameter(property = "generateAsInternal")
+ private var generateAsInternal: Boolean = false
+
+ @Parameter(property = "generateVisitorForPolymorphicDatatypes")
+ private var generateVisitorForPolymorphicDatatypes: Boolean = true
+
+ @Parameter(property = "enumAsSealedClassPatternFilters")
+ private var enumAsSealedClassPatternFilters: List = emptyList()
+
+ @Throws(MojoExecutionException::class)
+ override fun execute() {
+
+ if (skip) {
+ log.info("Skipping execution because skip option is true")
+ return
+ }
+
+ log.info("Apollo GraphQL Client Code Generation task started")
+ val queryDir = File(sourceDirName)
+
+ if (!queryDir.isDirectory) {
+ throw MojoExecutionException("'${queryDir.absolutePath}' must be a directory")
+ }
+
+ log.info("Read queries files")
+ val queries = Files.walk(queryDir.toPath())
+ .filter { it.toFile().isFile && it.toFile().name.endsWith(".graphql") }
+ .map { it.toFile() }
+ .collect(Collectors.toList())
+
+ if (queries.isEmpty()) {
+ throw MojoExecutionException("No queries found under '${queryDir.absolutePath}")
+ }
+
+ if (generateIntrospectionFile) {
+ log.info("Automatically generating introspection file from $schemaUrl")
+ val schema = getIntrospectionSchema(schemaUrl, useSelfSignedCertificat, customHeaders)
+ if (schema.isNotEmpty()) {
+ 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")
+ }
+ }
+
+ if (!introspectionFile.isFile) {
+ throw MojoExecutionException("Introspection schema file not found: ${introspectionFile.absolutePath}")
+ }
+
+ 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(
+ rootFolders = listOf(queryDir),
+ schemaFile = introspectionFile,
+ rootPackageName = rootPackageName
+ )
+ val graphQLDocumentParser = GraphQLDocumentParser(Schema(introspectionFile), packageNameProvider)
+ val ir = graphQLDocumentParser.parse(queries)
+
+ val compiler = GraphQLCompiler()
+ compiler.write(
+ GraphQLCompiler.Arguments(
+ ir = ir,
+ outputDir = outputDirectory,
+ customTypeMap = customTypeMap,
+ nullableValueType = nullableValueType,
+ useSemanticNaming = useSemanticNaming,
+ generateModelBuilder = generateModelBuilder,
+ useJavaBeansSemanticNaming = useJavaBeansSemanticNaming,
+ packageNameProvider = packageNameProvider,
+ operationIdGenerator = operationIdGenerator,
+ suppressRawTypesWarning = suppressRawTypesWarning,
+ generateKotlinModels = generateKotlinModels,
+ generateAsInternal = generateAsInternal,
+ generateVisitorForPolymorphicDatatypes = generateVisitorForPolymorphicDatatypes,
+ enumAsSealedClassPatternFilters = enumAsSealedClassPatternFilters
+ )
+ )
+
+ if (addSourceRoot) {
+ log.info("Add the compiled sources to project root")
+ project.addCompileSourceRoot(outputDirectory.absolutePath)
+ }
+ log.info("Apollo GraphQL Client Code Generation task finished")
+ }
+}
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..bcaa29c
--- /dev/null
+++ b/apollo-client-maven-plugin/src/main/kotlin/com/lahzouz/java/graphql/client/maven/plugin/Introspection.kt
@@ -0,0 +1,182 @@
+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.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,
+ useSelfSignedCertificat: Boolean,
+ customHeaders: Map
+ ): String {
+
+ var clientBuilder = HttpClientBuilder.create().disableContentCompression()
+
+ if (useSelfSignedCertificat) {
+ val sslContext: SSLContext = SSLContextBuilder()
+ .loadTrustMaterial(null) { _: Array?, _: 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)
+
+ 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")
+ customHeaders.forEach { (name, value) -> setHeader(name, value) }
+ }
+
+ val client = clientBuilder.build()
+ 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\":\"IntrospectionQuery\"}"
+}
diff --git a/mvnw b/mvnw
new file mode 100755
index 0000000..5551fde
--- /dev/null
+++ b/mvnw
@@ -0,0 +1,286 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven2 Start Up Batch script
+#
+# Required ENV vars:
+# ------------------
+# JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+# M2_HOME - location of maven2's installed home dir
+# MAVEN_OPTS - parameters passed to the Java VM when running Maven
+# e.g. to debug Maven itself, use
+# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+# ----------------------------------------------------------------------------
+
+if [ -z "$MAVEN_SKIP_RC" ] ; then
+
+ if [ -f /etc/mavenrc ] ; then
+ . /etc/mavenrc
+ fi
+
+ if [ -f "$HOME/.mavenrc" ] ; then
+ . "$HOME/.mavenrc"
+ fi
+
+fi
+
+# OS specific support. $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+mingw=false
+case "`uname`" in
+ CYGWIN*) cygwin=true ;;
+ MINGW*) mingw=true;;
+ Darwin*) darwin=true
+ # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
+ # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
+ if [ -z "$JAVA_HOME" ]; then
+ if [ -x "/usr/libexec/java_home" ]; then
+ export JAVA_HOME="`/usr/libexec/java_home`"
+ else
+ export JAVA_HOME="/Library/Java/Home"
+ fi
+ fi
+ ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+ if [ -r /etc/gentoo-release ] ; then
+ JAVA_HOME=`java-config --jre-home`
+ fi
+fi
+
+if [ -z "$M2_HOME" ] ; then
+ ## resolve links - $0 may be a link to maven's home
+ PRG="$0"
+
+ # need this for relative symlinks
+ while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ 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 c4d0244..52181c8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,23 +1,45 @@
-
+
4.0.0
- com.coxautodev
+ com.github.sparow199
apollo-client-maven-plugin-parent
- 1.1.3-SNAPSHOT
+ 3.2.1
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/aoudiamoncef/apollo-client-maven-plugin
- 1.1.2-2
+ UTF-8
+ UTF-8
+ 1.3.72
+ true
1.8
true
+
+ 2.11.0
+ 1.4.1
+
+ Github
+ 3.2.1
+ 0.9.17
+ 3.8.1
+ 1.5.1
+ 3.8.2
+
+ 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
+
+
apollo-client-maven-plugin
apollo-client-maven-plugin-tests
@@ -29,40 +51,20 @@
kotlin-stdlib
${kotlin.version}
-
-
- org.spockframework
- spock-core
- 1.0-groovy-2.4
- test
-
- org.codehaus.groovy
- groovy-all
- 2.4.7
-
-
- cglib
- cglib-nodep
- 3.2.4
- test
-
-
- org.objenesis
- objenesis
- 2.5.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.6.1
+ ${maven-compiler-plugin.version}
${java.version}
${java.version}
@@ -82,31 +84,78 @@
-
- org.codehaus.gmavenplus
- gmavenplus-plugin
- 1.5
-
-
-
- testCompile
-
-
-
-
org.apache.maven.plugins
- maven-release-plugin
- 2.5.3
-
- @{project.version}
- false
-
+ maven-site-plugin
+ ${maven-site-plugin.version}
+
+
+
+ com.github.gantsign.maven
+ ktlint-maven-plugin
+ ${ktlint-maven-plugin.version}
+
+
+
+
+
+ format
+
+ true
+
+ !no-format
+
+
+
+
+
+ com.github.gantsign.maven
+ ktlint-maven-plugin
+ ${ktlint-maven-plugin.version}
+
+
+ format
+
+ format
+
+
+
+
+
+
+
+
+
+ validate
+
+ true
+
+ no-format
+
+
+
+
+
+ com.github.gantsign.maven
+ ktlint-maven-plugin
+ ${ktlint-maven-plugin.version}
+
+
+ check
+
+ check
+
+
+
+
+
+
+
bintray
@@ -114,7 +163,7 @@
org.apache.maven.plugins
maven-source-plugin
- 3.0.1
+ ${maven-source-plugin.version}
attach-sources
@@ -128,7 +177,7 @@
org.jetbrains.dokka
dokka-maven-plugin
- 0.9.9
+ ${dokka-maven-plugin.version}
package
@@ -143,6 +192,14 @@
+
+
+ jcenter
+ JCenter
+ https://jcenter.bintray.com/
+
+
+
Andrew Potter
@@ -150,6 +207,10 @@
Cox Automotive
http://www.coxautoinc.com
+
+ Moncef AOUDIA
+ mf.aoudia@gmail.com
+
@@ -159,20 +220,23 @@
- bintray
- https://api.bintray.com/maven/apottere/maven/apollo-client-maven-plugin
+ bintray-sparow199-maven
+ sparow199-maven
+ 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
+ bintray-sparow199-maven
+ sparow199-maven
+ 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
- HEAD
-
+
+
+
+ jcenter
+ https://jcenter.bintray.com/
+
+
\ No newline at end of file