Repository: oembedler/graphql-spring-boot
Branch: master
Commit: e6deedbc4552
Files: 79
Total size: 161.6 KB
Directory structure:
gitextract_bf5_cnpc/
├── .gitignore
├── .travis.yml
├── LICENSE.md
├── README.md
├── build.gradle
├── gradle/
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── graphiql-spring-boot-autoconfigure/
│ ├── LICENSE.md
│ ├── build.gradle
│ ├── gradle/
│ │ └── wrapper/
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradle.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── settings.gradle
│ └── src/
│ └── main/
│ └── resources/
│ └── META-INF/
│ └── resources/
│ ├── graphiql-config.js
│ └── index.html
├── graphiql-spring-boot-starter/
│ ├── LICENSE.md
│ ├── build.gradle
│ ├── gradle/
│ │ └── wrapper/
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradle.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
├── graphql-sample-app/
│ ├── LICENSE.md
│ ├── build.gradle
│ ├── gradle/
│ │ └── wrapper/
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradle.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── settings.gradle
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── embedler/
│ │ │ └── moon/
│ │ │ └── graphql/
│ │ │ └── boot/
│ │ │ └── sample/
│ │ │ ├── ApplicationBootConfiguration.java
│ │ │ ├── SimpleListConnection.java
│ │ │ ├── TodoSimpleListConnection.java
│ │ │ └── schema/
│ │ │ ├── TodoSchema.java
│ │ │ └── objecttype/
│ │ │ ├── BaseObjectType.java
│ │ │ ├── RootObjectType.java
│ │ │ ├── TodoObjectType.java
│ │ │ └── UserObjectType.java
│ │ └── resources/
│ │ └── application.yml
│ └── test/
│ └── java/
│ └── com/
│ └── embedler/
│ └── moon/
│ └── graphql/
│ └── boot/
│ └── sample/
│ └── test/
│ └── GenericTodoSchemaParserTest.java
├── graphql-spring-boot-autoconfigure/
│ ├── LICENSE.md
│ ├── build.gradle
│ ├── gradle/
│ │ └── wrapper/
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradle.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── settings.gradle
│ └── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── oembedler/
│ │ │ └── moon/
│ │ │ └── graphql/
│ │ │ └── boot/
│ │ │ ├── EnableGraphQLServer.java
│ │ │ ├── ErrorGraphQLQueryEvaluation.java
│ │ │ ├── ErrorGraphQLSchemaUndefined.java
│ │ │ ├── ErrorGraphQLServer.java
│ │ │ ├── GlobalDefaultExceptionHandler.java
│ │ │ ├── GraphQLAutoConfiguration.java
│ │ │ ├── GraphQLContext.java
│ │ │ ├── GraphQLProperties.java
│ │ │ ├── GraphQLSchemaLocator.java
│ │ │ ├── GraphQLServerController.java
│ │ │ ├── GraphQLServerRequest.java
│ │ │ ├── GraphQLServerResult.java
│ │ │ └── GraphQLWebAutoConfiguration.java
│ │ └── resources/
│ │ └── META-INF/
│ │ └── spring.factories
│ └── test/
│ └── java/
│ └── com/
│ └── oembedler/
│ └── moon/
│ └── graphql/
│ └── boot/
│ └── test/
│ ├── GraphQLAutoConfigurationTest.java
│ └── schema/
│ └── EmptySchema.java
├── graphql-spring-boot-starter/
│ ├── LICENSE.md
│ ├── build.gradle
│ ├── gradle/
│ │ └── wrapper/
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradle.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
└── settings.gradle
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
*.iml
## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:
# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries
# .idea/shelf
# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml
# Gradle:
# .idea/gradle.xml
# .idea/libraries
# Mongo Explorer plugin:
# .idea/mongoSettings.xml
## File-based project format:
*.ipr
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
================================================
FILE: .travis.yml
================================================
language: java
jdk:
- oraclejdk8
before_install:
- chmod +x gradlew
after_success:
- ./gradlew bintrayUpload -x check --info
================================================
FILE: LICENSE.md
================================================
The MIT License (MIT)
Copyright (c) 2016 Oembedler Inc. and Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: README.md
================================================
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**
- [GraphQL Spring Framework Boot Starter](#graphql-spring-framework-boot-starter)
- [Intro](#intro)
- [Requires](#requires)
- [Enable GraphQL Server](#enable-graphql-server)
- [Enable GraphiQL Tool](#enable-graphiql-tool)
- [Contributions](#contributions)
- [License](#license)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
# GraphQL and GraphiQL Spring Framework Boot Starters
[](https://travis-ci.org/oembedler/graphql-spring-boot)
GraphQL Starter
[  ](https://bintray.com/oembedler/maven/graphql-spring-boot-starter/_latestVersion)
GraphiQL Starter
[  ](https://bintray.com/oembedler/maven/graphiql-spring-boot-starter/_latestVersion)
# Intro
Repository contains:
* `graphql-spring-boot-starter` to turn your boot application into GraphQL server (see [express-graphql](https://github.com/graphql/express-graphql))
* `graphiql-spring-boot-starter`to embed `GraphiQL` tool for schema introspection and query debugging (see [graphiql](https://github.com/graphql/graphiql))
# Requires
* Java 1.8
* [Spring Framework GraphQL Common Library](https://github.com/oembedler/spring-graphql-common)
* Spring Framework Boot 1.3.x (web)
Add repository:
```gradle
repositories {
// stable build
jcenter()
// development build
maven { url "http://dl.bintray.com/oembedler/maven" }
}
```
Dependency:
```gradle
dependencies {
compile 'com.embedler.moon.graphql.boot:graphql-spring-boot-starter:INSERT_LATEST_VERSION_HERE'
// to embed GraphiQL tool
compile 'com.embedler.moon.graphql.boot:graphiql-spring-boot-starter:INSERT_LATEST_VERSION_HERE'
}
```
How to use the latest build with Maven:
```xml
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-oembedler-maven</id>
<name>bintray</name>
<url>http://dl.bintray.com/oembedler/maven</url>
</repository>
```
Dependency:
```xml
<dependency>
<groupId>com.embedler.moon.graphql.boot</groupId>
<artifactId>graphql-spring-boot-starter</artifactId>
<version>INSERT_LATEST_VERSION_HERE</version>
</dependency>
<!-- to embed GraphiQL tool -->
<dependency>
<groupId>com.embedler.moon.graphql.boot</groupId>
<artifactId>graphiql-spring-boot-starter</artifactId>
<version>INSERT_LATEST_VERSION_HERE</version>
</dependency>
```
# Enable GraphQL Server
Server becomes accessible at `/graphql` if `graphql-spring-boot-starter` added as a dependency to a boot application
and `@EnableGraphQLServer` annotation is set at the main java configuration class.
GraphQL schemas are automatically discovered extracting all classes from Spring context marked as `@GraphQLSchema`.
Request parameters:
* **`query`**: A string GraphQL document to be executed.
* **`variables`**: The runtime values to use for any GraphQL query variables
as a JSON object.
* **`operationName`**: If the provided `query` contains multiple named
operations, this specifies which operation should be executed. If not
provided, an error will be returned if the `query` contains multiple
named operations.
GraphQL will first look for each parameter in the URL's query-string:
```
/graphql?query=query+getUser($id:ID){user(id:$id){name}}&variables={"id":"4"}
```
If not found in the query-string, it will look in the POST request body.
Server uses [`commons-fileupload`][] middleware to add support
for `multipart/form-data` content, which may be useful for GraphQL mutations
involving uploading files (see test application for more details).
`GraphQLContext` is a map of objects (context) for the current query execution.
In order to get access to uploaded file
`com.oembedler.moon.graphql.boot.GraphQLContext` should be passed as input parameter to datafetcher or mutation (don't need to be annotated).
Calling method `GraphQLContext.getUploadedFile()` returns instance of [MultipartFile](https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/multipart/MultipartFile.html).
If the POST body has not yet been parsed, graphql-express will interpret it
depending on the provided *Content-Type* header.
* **`application/json`**: the POST body will be parsed as a JSON
object of parameters.
* **`application/x-www-form-urlencoded`**: this POST body will be
parsed as a url-encoded string of key-value pairs.
* **`multipart/form-data`**: this POST body will be
parsed as a string of key-value pairs and it supports file upload (see above).
* **`application/graphql`**: The POST body will be parsed as GraphQL
query string, which provides the `query` parameter.
Available Spring Boot configuration parameters (either `application.yml` or `application.properties`):
Server can host multiple schemas (all are registered at the startup time).
To run query against particular schema - HTTP header `graphql-schema` parameter passed along with the query should contain graphql schema name of interest.
```yaml
graphql:
server:
mapping: /graphql
corsEnabled: true
suppressSpringResponseCodes: true
query-key: query
variables-key: variables
uploadMaxFileSize: 128KB
uploadMaxRequestSize: 128KB
schema:
clientMutationIdName: clientMutationId
injectClientMutationId: true
allowEmptyClientMutationId: false
mutationInputArgumentName: input
outputObjectNamePrefix: Payload
inputObjectNamePrefix: Input
schemaMutationObjectName: Mutation
```
To facilitate access from Nodejs frontend to GraphQL backend by default system enables global CORS filter for `/graphql/**` context.
The `corsEnabled` can be set to `false` to disable it.
By default system register `GlobalDefaultExceptionHandler` which suppresses Spring framework error responses and responds with standard GraphQL server error.
Application configuration `suppressSpringResponseCodes` property can be set to `false` to disable that handler.
# Enable GraphiQL Tool
Tool becomes accessible at the root `/` if `graphiql-spring-boot-starter` added as a dependency to a boot application.
Note that GraphQL server must be available at `/graphql` context to be discovered by GraphiQL.
# Contributions
Contributions are welcome.
Tips:
- Respect the [Code of Conduct](http://contributor-covenant.org/version/1/3/0/).
- Before opening an Issue to report a bug, please try the latest development version.
It might happen that the problem is already solved.
- Please use Markdown to format your comments properly.
If you are not familiar with that: [Getting started with writing and formatting on GitHub](https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/)
- For Pull Requests:
- Here are some [general tips](https://github.com/blog/1943-how-to-write-the-perfect-pull-request)
- Please be a as focused and clear as possible and don't mix concerns.
This includes refactorings mixed with bug-fixes/features, see [Open Source Contribution Etiquette](http://tirania.org/blog/archive/2010/Dec-31.html)
- It would be good to add an automatic test(s).
# License
`graphql-spring-boot-starter` and `graphiql-spring-boot-starter` are licensed under the MIT License. See [LICENSE](LICENSE.md) for details.
[spring-graphql-common License](https://github.com/oembedler/spring-graphql-common/blob/master/LICENSE.md)
[graphql-java License](https://github.com/andimarek/graphql-java/blob/master/LICENSE.md)
[graphiql License](https://github.com/graphql/graphiql/blob/master/LICENSE)
[graphql-js License](https://github.com/graphql/graphql-js/blob/master/LICENSE)
================================================
FILE: build.gradle
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import java.text.SimpleDateFormat
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
maven { url 'http://repo.spring.io/plugins-release' }
}
dependencies {
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6"
}
}
subprojects {
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'propdeps'
apply plugin: 'propdeps-maven'
apply plugin: 'propdeps-idea'
apply plugin: 'propdeps-eclipse'
apply plugin: "com.jfrog.bintray"
version = System.env.TRAVIS_TAG ? PROJECT_VERSION : PROJECT_VERSION + '-' + new SimpleDateFormat('yyyy-MM-dd\'T\'HH-mm-ss').format(new Date())
group = PROJECT_GROUP
repositories {
jcenter()
maven { url "http://dl.bintray.com/oembedler/maven" }
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
compileJava {
sourceCompatibility = SOURCE_COMPATIBILITY
targetCompatibility = TARGET_COMPATIBILITY
}
jar {
from "LICENSE.md"
}
task sourcesJar(type: Jar) {
dependsOn classes
classifier 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
publishing {
publications {
mainProjectPublication(MavenPublication) {
version version
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name PROJECT_NAME
description PROJECT_DESC
url PROJECT_GIT_REPO_URL
scm {
url PROJECT_GIT_REPO_URL
connection PROJECT_GIT_REPO_URL
developerConnection PROJECT_GIT_REPO_URL
}
licenses {
license {
name PROJECT_LICENSE
url PROJECT_LICENSE_URL
distribution 'repo'
}
}
developers {
developer {
id PROJECT_DEV_ID
name PROJECT_DEV_NAME
}
}
}
}
}
}
}
bintray {
user = System.env.BINTRAY_USER ?: project["bintray.user"]
key = System.env.BINTRAY_API_KEY ?: project["bintray.key"]
publications = ['mainProjectPublication']
publish = true
pkg {
repo = 'maven'
name = PROJECT_NAME
desc = PROJECT_DESC
licenses = [PROJECT_LICENSE]
vcsUrl = PROJECT_GIT_REPO_URL
}
}
task wrapper(type: Wrapper) {
gradleVersion = "${GRADLE_WRAPPER_VER}"
}
}
================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Sun Mar 27 20:34:11 BST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip
================================================
FILE: gradle.properties
================================================
#
# The MIT License (MIT)
#
# Copyright (c) 2016 oEmbedler Inc. and Contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
PROJECT_VERSION = 2.1.0
PROJECT_GROUP = com.embedler.moon.graphql.boot
PROJECT_NAME = spring-boot-graphql
PROJECT_DESC = GraphQL Spring Framework Boot
PROJECT_GIT_REPO_URL = https://github.com/oembedler/graphql-spring-boot
PROJECT_LICENSE = MIT
PROJECT_LICENSE_URL = https://github.com/oembedler/spring-boot-graphql/blob/master/LICENSE.md
PROJECT_DEV_ID = oembedler
PROJECT_DEV_NAME = Embedler Inc.
VCS=Git
###
SOURCE_COMPATIBILITY = 1.8
TARGET_COMPATIBILITY = 1.8
###
LIB_SPRING_GRAPHQL_COMMON_VER = 2.1.+
LIB_JUNIT_VER = 4.12
LIB_SPRING_CORE_VER = 4.2.4.RELEASE
LIB_SPRING_BOOT_VER = 1.3.3.RELEASE
LIB_COMMON_UPLOAD = 1.3.1
GRADLE_WRAPPER_VER = 2.9
###
org.gradle.daemon=true
bintray.user=USER
bintray.key=KEY
================================================
FILE: gradlew
================================================
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
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
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
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
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
================================================
FILE: gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: graphiql-spring-boot-autoconfigure/LICENSE.md
================================================
The MIT License (MIT)
Copyright (c) 2016 Oembedler Inc. and Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: graphiql-spring-boot-autoconfigure/build.gradle
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6"
}
}
dependencies{
compile "org.webjars:react:$LIB_WEBJARS_REACT_VER"
}
================================================
FILE: graphiql-spring-boot-autoconfigure/gradle/wrapper/gradle-wrapper.properties
================================================
#Sun Mar 27 20:34:11 BST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip
================================================
FILE: graphiql-spring-boot-autoconfigure/gradle.properties
================================================
#
# The MIT License (MIT)
#
# Copyright (c) 2016 oEmbedler Inc. and Contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
PROJECT_VERSION = 2.1.0
PROJECT_GROUP = com.embedler.moon.graphql.boot.autoconfigure
PROJECT_NAME = graphiql-spring-boot-autoconfigure
PROJECT_DESC = GraphiQL Spring Framework Boot Autoconfigure
PROJECT_GIT_REPO_URL = https://github.com/oembedler/graphql-spring-boot
PROJECT_LICENSE = MIT
PROJECT_LICENSE_URL = https://github.com/oembedler/spring-boot-graphql/blob/master/LICENSE.md
PROJECT_DEV_ID = oembedler
PROJECT_DEV_NAME = Embedler Inc.
VCS=Git
###
SOURCE_COMPATIBILITY = 1.8
TARGET_COMPATIBILITY = 1.8
###
LIB_WEBJARS_GRAPHIQL_VER = 0.3.1-1
LIB_WEBJARS_REACT_VER = 0.14.7
GRADLE_WRAPPER_VER = 2.9
###
org.gradle.daemon=true
bintray.user=USER
bintray.key=KEY
================================================
FILE: graphiql-spring-boot-autoconfigure/gradlew
================================================
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
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
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
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
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
================================================
FILE: graphiql-spring-boot-autoconfigure/gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: graphiql-spring-boot-autoconfigure/settings.gradle
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
rootProject.name = PROJECT_NAME
================================================
FILE: graphiql-spring-boot-autoconfigure/src/main/resources/META-INF/resources/graphiql-config.js
================================================
(function(f){
var graphql_server_context = '{{graphql_server_context}}'
});
================================================
FILE: graphiql-spring-boot-autoconfigure/src/main/resources/META-INF/resources/index.html
================================================
<!DOCTYPE html>
<html>
<head>
<style>body{height:100%;margin:0;width:100%;overflow:hidden}#graphiql{height:100vh}</style>
<link rel=stylesheet href="webjars/graphiql/0.6.6/graphiql.min.css" />
<script src="webjars/fetch/0.9.0/fetch.min.js"></script>
<script src="webjars/react/0.14.7/react.min.js"></script>
<script src="webjars/react/0.14.7/react-dom.min.js"></script>
<script src="webjars/graphiql/0.6.6/graphiql.min.js"></script>
</head>
<body>
<div id=graphiql>Loading...</div>
<script>var search=window.location.search;var parameters={};search.substr(1).split("&").forEach(function(b){var a=b.indexOf("=");if(a>=0){parameters[decodeURIComponent(b.slice(0,a))]=decodeURIComponent(b.slice(a+1))}});if(parameters.variables){try{parameters.variables=JSON.stringify(JSON.parse(parameters.variables),null,2)}catch(e){}}function onEditQuery(a){parameters.query=a;updateURL()}function onEditVariables(a){parameters.variables=a;updateURL()}function onEditOperationName(a){parameters.operationName=a;updateURL()}function updateURL(){var a="?"+Object.keys(parameters).filter(function(b){return Boolean(parameters[b])}).map(function(b){return encodeURIComponent(b)+"="+encodeURIComponent(parameters[b])}).join("&");history.replaceState(null,null,a)}function graphQLFetcher(a){return fetch(window.location.origin+"/graphql",{method:"post",headers:{Accept:"application/json","Content-Type":"application/json",},body:JSON.stringify(a),credentials:"include",}).then(function(b){return b.text()}).then(function(c){try{return JSON.parse(c)}catch(b){return c}})}ReactDOM.render(React.createElement(GraphiQL,{fetcher:graphQLFetcher,query:parameters.query,variables:parameters.variables,operationName:parameters.operationName,onEditQuery:onEditQuery,onEditVariables:onEditVariables,onEditOperationName:onEditOperationName}),document.getElementById("graphiql"));</script>
</body>
</html>
================================================
FILE: graphiql-spring-boot-starter/LICENSE.md
================================================
The MIT License (MIT)
Copyright (c) 2016 Oembedler Inc. and Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: graphiql-spring-boot-starter/build.gradle
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6"
}
}
dependencies {
compile(project(':graphiql-spring-boot-autoconfigure'))
}
================================================
FILE: graphiql-spring-boot-starter/gradle/wrapper/gradle-wrapper.properties
================================================
#Sun Mar 27 20:34:11 BST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip
================================================
FILE: graphiql-spring-boot-starter/gradle.properties
================================================
#
# The MIT License (MIT)
#
# Copyright (c) 2016 oEmbedler Inc. and Contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
PROJECT_VERSION = 2.1.0
PROJECT_GROUP = com.embedler.moon.graphql.boot.starter
PROJECT_NAME = graphiql-spring-boot-starter
PROJECT_DESC = GraphiQL Spring Framework Boot Starter
PROJECT_GIT_REPO_URL = https://github.com/oembedler/graphql-spring-boot
PROJECT_LICENSE = MIT
PROJECT_LICENSE_URL = https://github.com/oembedler/spring-boot-graphql/blob/master/LICENSE.md
PROJECT_DEV_ID = oembedler
PROJECT_DEV_NAME = Embedler Inc.
VCS=Git
###
SOURCE_COMPATIBILITY = 1.8
TARGET_COMPATIBILITY = 1.8
###
GRADLE_WRAPPER_VER = 2.9
###
org.gradle.daemon=true
bintray.user=USER
bintray.key=KEY
================================================
FILE: graphiql-spring-boot-starter/gradlew
================================================
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
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
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
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
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
================================================
FILE: graphiql-spring-boot-starter/gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: graphiql-spring-boot-starter/settings.gradle
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
rootProject.name = PROJECT_NAME
================================================
FILE: graphql-sample-app/LICENSE.md
================================================
The MIT License (MIT)
Copyright (c) 2016 Oembedler Inc. and Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: graphql-sample-app/build.gradle
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
maven { url 'http://repo.spring.io/plugins-release' }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.3.RELEASE")
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6"
}
}
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'spring-boot'
repositories {
jcenter()
}
dependencies{
compile(project(":graphql-spring-boot-starter"))
compile(project(":graphiql-spring-boot-starter"))
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.boot:spring-boot-starter-actuator")
testCompile("org.springframework.boot:spring-boot-starter-test")
}
================================================
FILE: graphql-sample-app/gradle/wrapper/gradle-wrapper.properties
================================================
#Sun Mar 27 20:34:11 BST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip
================================================
FILE: graphql-sample-app/gradle.properties
================================================
#
# The MIT License (MIT)
#
# Copyright (c) 2016 oEmbedler Inc. and Contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
PROJECT_VERSION = 2.1.0
PROJECT_GROUP = com.embedler.moon.graphql.boot.sample
PROJECT_NAME = graphql-sample-app
PROJECT_DESC = GraphQL Spring Framework Boot Sample App
PROJECT_GIT_REPO_URL = https://github.com/oembedler/graphql-spring-boot
PROJECT_LICENSE = MIT
PROJECT_LICENSE_URL = https://github.com/oembedler/spring-boot-graphql/blob/master/LICENSE.md
PROJECT_DEV_ID = oembedler
PROJECT_DEV_NAME = Embedler Inc.
VCS=Git
###
SOURCE_COMPATIBILITY = 1.8
TARGET_COMPATIBILITY = 1.8
###
GRADLE_WRAPPER_VER = 2.9
###
org.gradle.daemon=true
bintray.user=USER
bintray.key=KEY
================================================
FILE: graphql-sample-app/gradlew
================================================
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
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
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
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
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
================================================
FILE: graphql-sample-app/gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: graphql-sample-app/settings.gradle
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
rootProject.name = PROJECT_NAME
================================================
FILE: graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/ApplicationBootConfiguration.java
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.embedler.moon.graphql.boot.sample;
import com.oembedler.moon.graphql.boot.EnableGraphQLServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
@SpringBootApplication
@EnableGraphQLServer
public class ApplicationBootConfiguration {
public static void main(String[] args) throws Exception {
SpringApplication.run(ApplicationBootConfiguration.class, args);
}
}
================================================
FILE: graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/SimpleListConnection.java
================================================
package com.embedler.moon.graphql.boot.sample;
import com.oembedler.moon.graphql.engine.relay.ConnectionObjectType;
import com.oembedler.moon.graphql.engine.relay.EdgeObjectType;
import com.oembedler.moon.graphql.engine.relay.PageInfoObjectType;
import graphql.relay.Base64;
import graphql.relay.ConnectionCursor;
import graphql.schema.DataFetchingEnvironment;
import java.util.ArrayList;
import java.util.List;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
public class SimpleListConnection {
private static final String DUMMY_CURSOR_PREFIX = "simple-cursor";
private List<?> data = new ArrayList<Object>();
public SimpleListConnection(List<?> data) {
this.data = data;
}
public <T extends EdgeObjectType> T createEdgeObject() {
return (T) new EdgeObjectType();
}
public <T extends ConnectionObjectType> T createConnectionObject() {
return (T) new ConnectionObjectType();
}
private List<EdgeObjectType> buildEdges() {
List<EdgeObjectType> edges = new ArrayList<>();
int ix = 0;
for (Object object : data) {
EdgeObjectType edge = createEdgeObject();
edge.setNode(object);
edge.setCursor(createCursor(ix++));
edges.add(edge);
}
return edges;
}
public <T extends ConnectionObjectType> T get(DataFetchingEnvironment environment) {
List<EdgeObjectType> edges = buildEdges();
int afterOffset = getOffsetFromCursor(environment.<String>getArgument("after"), -1);
int begin = Math.max(afterOffset, -1) + 1;
int beforeOffset = getOffsetFromCursor(environment.<String>getArgument("before"), edges.size());
int end = Math.min(beforeOffset, edges.size());
edges = edges.subList(begin, end);
if (edges.size() == 0) {
return emptyConnection();
}
Integer first = environment.<Integer>getArgument("first");
Integer last = environment.<Integer>getArgument("last");
String firstPresliceCursor = edges.get(0).getCursor();
String lastPresliceCursor = edges.get(edges.size() - 1).getCursor();
if (first != null) {
edges = edges.subList(0, first <= edges.size() ? first : edges.size());
}
if (last != null) {
edges = edges.subList(edges.size() - last, edges.size());
}
if (edges.size() == 0) {
return emptyConnection();
}
EdgeObjectType firstEdge = edges.get(0);
EdgeObjectType lastEdge = edges.get(edges.size() - 1);
PageInfoObjectType pageInfo = new PageInfoObjectType();
pageInfo.setStartCursor(firstEdge.getCursor());
pageInfo.setEndCursor(lastEdge.getCursor());
pageInfo.setHasPreviousPage(!firstEdge.getCursor().equals(firstPresliceCursor));
pageInfo.setHasNextPage(!lastEdge.getCursor().equals(lastPresliceCursor));
ConnectionObjectType connection = createConnectionObject();
connection.setEdges(edges);
connection.setPageInfo(pageInfo);
return (T) connection;
}
private <T extends ConnectionObjectType> T emptyConnection() {
ConnectionObjectType connection = createConnectionObject();
connection.setPageInfo(new PageInfoObjectType());
return (T) connection;
}
public ConnectionCursor cursorForObjectInConnection(Object object) {
int index = data.indexOf(object);
String cursor = createCursor(index);
return new ConnectionCursor(cursor);
}
private int getOffsetFromCursor(String cursor, int defaultValue) {
if (cursor == null) return defaultValue;
String string = Base64.fromBase64(cursor);
return Integer.parseInt(string.substring(DUMMY_CURSOR_PREFIX.length()));
}
private String createCursor(int offset) {
String string = Base64.toBase64(DUMMY_CURSOR_PREFIX + Integer.toString(offset));
return string;
}
}
================================================
FILE: graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/TodoSimpleListConnection.java
================================================
package com.embedler.moon.graphql.boot.sample;
import com.embedler.moon.graphql.boot.sample.schema.objecttype.TodoObjectType;
import com.oembedler.moon.graphql.engine.relay.ConnectionObjectType;
import com.oembedler.moon.graphql.engine.relay.EdgeObjectType;
import java.util.ArrayList;
import java.util.List;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
public class TodoSimpleListConnection extends SimpleListConnection {
private static final String DUMMY_CURSOR_PREFIX = "simple-cursor";
private List<?> data = new ArrayList<Object>();
public TodoSimpleListConnection(List<?> data) {
super(data);
}
public <T extends EdgeObjectType> T createEdgeObject() {
return (T) new TodoObjectType.TodoEdgeObjectType();
}
public <T extends ConnectionObjectType> T createConnectionObject() {
return (T) new TodoObjectType.TodoConnectionObjectType();
}
}
================================================
FILE: graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/TodoSchema.java
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.embedler.moon.graphql.boot.sample.schema;
import com.embedler.moon.graphql.boot.sample.TodoSimpleListConnection;
import com.embedler.moon.graphql.boot.sample.schema.objecttype.RootObjectType;
import com.embedler.moon.graphql.boot.sample.schema.objecttype.TodoObjectType;
import com.embedler.moon.graphql.boot.sample.schema.objecttype.UserObjectType;
import com.oembedler.moon.graphql.boot.GraphQLContext;
import com.oembedler.moon.graphql.engine.stereotype.*;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@GraphQLSchema
public class TodoSchema {
@GraphQLSchemaQuery
private RootObjectType root;
private UserObjectType theOnlyUser = new UserObjectType();
private List<TodoObjectType> todos = new ArrayList<>();
private TodoSimpleListConnection simpleConnectionTodo;
private int nextTodoId = 0;
public TodoSchema() {
addTodo("Do Something");
addTodo("Other todo");
simpleConnectionTodo = new TodoSimpleListConnection(todos);
}
public String addTodo(String text) {
TodoObjectType newTodo = new TodoObjectType();
newTodo.setId(Integer.toString(nextTodoId++));
newTodo.setText(text);
todos.add(newTodo);
return newTodo.getId(newTodo);
}
public void removeTodo(String id) {
TodoObjectType del = todos.stream().filter(todo -> todo.getId(todo).equals(id)).findFirst().get();
todos.remove(del);
}
public void renameTodo(String id, String text) {
TodoObjectType matchedTodo = todos.stream().filter(todo -> todo.getId(todo).equals(id)).findFirst().get();
matchedTodo.setText(text);
}
public List<String> removeCompletedTodos() {
List<String> toDelete = todos.stream()
.filter(TodoObjectType::isComplete)
.map(todoObjectType -> todoObjectType.getId(todoObjectType))
.collect(Collectors.toList());
todos.removeIf(todo -> toDelete.contains(todo.getId(todo)));
return toDelete;
}
public List<String> markAllTodos(boolean complete) {
List<String> changed = new ArrayList<>();
todos.stream().filter(todo -> complete != todo.isComplete()).forEach(todo -> {
changed.add(todo.getId(todo));
todo.setComplete(complete);
});
return changed;
}
public void changeTodoStatus(String id, boolean complete) {
TodoObjectType todo = getTodo(id);
todo.setComplete(complete);
}
public TodoObjectType getTodo(String id) {
return todos.stream().filter(todo -> todo.getId(todo).equals(id)).findFirst().get();
}
public List<TodoObjectType> getTodos(List<String> ids) {
return todos.stream().filter(todo -> ids.contains(todo.getId(todo))).collect(Collectors.toList());
}
public UserObjectType getTheOnlyUser() {
return theOnlyUser;
}
public TodoSimpleListConnection getSimpleConnectionTodo() {
return simpleConnectionTodo;
}
public static class AddTodoIn {
private String text;
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}
// --- mutations
@GraphQLMutation
@GraphQLDescription("Mutation to add new todo item")
public
@GraphQLOut("todoEdge")
TodoObjectType.TodoEdgeObjectType addTodoMutation(@GraphQLIn("addTodoInput") AddTodoIn addTodoInput) {
TodoObjectType.TodoEdgeObjectType todoEdgeObjectType = new TodoObjectType.TodoEdgeObjectType();
todoEdgeObjectType.setCursor("test-cursor");
todoEdgeObjectType.setNode(new TodoObjectType());
todoEdgeObjectType.getNode().setId("id-12345");
todoEdgeObjectType.getNode().setText("simple text");
todoEdgeObjectType.getNode().setComplete(false);
return todoEdgeObjectType;
}
@GraphQLMutation
public
@GraphQLOut("filename")
String uploadFile(GraphQLContext graphQLContext) {
return graphQLContext.getUploadedFile().getName();
}
@GraphQLMutation
public String updateTodoMutation(@GraphQLIn("updateTodoInput") String newText) {
return "Simple output string";
}
}
================================================
FILE: graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/objecttype/BaseObjectType.java
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.embedler.moon.graphql.boot.sample.schema.objecttype;
import com.oembedler.moon.graphql.engine.relay.RelayNode;
import com.oembedler.moon.graphql.engine.stereotype.GraphQLDescription;
import com.oembedler.moon.graphql.engine.stereotype.GraphQLID;
import com.oembedler.moon.graphql.engine.stereotype.GraphQLIgnore;
import com.oembedler.moon.graphql.engine.stereotype.GraphQLNonNull;
import graphql.relay.Relay;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
public class BaseObjectType implements RelayNode {
@GraphQLIgnore
private String id;
@GraphQLID("id")
@GraphQLNonNull
@GraphQLDescription("Global object unique identifier")
public String getId(RelayNode relayNode) {
BaseObjectType baseObjectType = (BaseObjectType) relayNode;
return new Relay().toGlobalId(relayNode.getClass().getSimpleName(), baseObjectType.id);
}
public void setId(String id) {
this.id = id;
}
}
================================================
FILE: graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/objecttype/RootObjectType.java
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.embedler.moon.graphql.boot.sample.schema.objecttype;
import com.embedler.moon.graphql.boot.sample.schema.TodoSchema;
import com.oembedler.moon.graphql.boot.GraphQLContext;
import com.oembedler.moon.graphql.engine.relay.RelayNode;
import com.oembedler.moon.graphql.engine.stereotype.*;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
@GraphQLObject("Root")
public class RootObjectType {
@GraphQLNonNull
@GraphQLField("version")
@GraphQLDescription("Root query version number")
public static final String VERSION = "0.9.0.2";
@Autowired
@GraphQLIgnore
private TodoSchema todoSchema;
@GraphQLField
public UserObjectType viewer() {
return todoSchema.getTheOnlyUser();
}
@GraphQLField
public RelayNode node(@GraphQLID @GraphQLNonNull @GraphQLIn("id") final String id) {
return new UserObjectType();
}
}
================================================
FILE: graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/objecttype/TodoObjectType.java
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.embedler.moon.graphql.boot.sample.schema.objecttype;
import com.oembedler.moon.graphql.engine.relay.ConnectionObjectType;
import com.oembedler.moon.graphql.engine.relay.EdgeObjectType;
import com.oembedler.moon.graphql.engine.relay.PageInfoObjectType;
import com.oembedler.moon.graphql.engine.stereotype.GraphQLObject;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
@GraphQLObject("Todo")
public class TodoObjectType extends BaseObjectType {
private String text;
private boolean complete;
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public boolean isComplete() {
return complete;
}
public void setComplete(boolean complete) {
this.complete = complete;
}
@GraphQLObject
public static class TodoConnectionObjectType extends ConnectionObjectType<TodoEdgeObjectType, PageInfoObjectType> {
}
@GraphQLObject
public static class TodoEdgeObjectType extends EdgeObjectType<TodoObjectType> {
}
}
================================================
FILE: graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/objecttype/UserObjectType.java
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.embedler.moon.graphql.boot.sample.schema.objecttype;
import com.embedler.moon.graphql.boot.sample.schema.TodoSchema;
import com.oembedler.moon.graphql.engine.stereotype.GraphQLField;
import com.oembedler.moon.graphql.engine.stereotype.GraphQLIgnore;
import com.oembedler.moon.graphql.engine.stereotype.GraphQLIn;
import com.oembedler.moon.graphql.engine.stereotype.GraphQLObject;
import graphql.schema.DataFetchingEnvironment;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
@GraphQLObject("User")
public class UserObjectType extends BaseObjectType {
@Autowired
@GraphQLIgnore
private TodoSchema todoSchema;
private String name = "someId";
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@GraphQLField
public TodoObjectType.TodoConnectionObjectType todos(@GraphQLIn("before") String before,
@GraphQLIn("after") String after,
@GraphQLIn(value = "first", defaultSpel = "1") Integer first,
@GraphQLIn(value = "last", defaultProvider = "1") Integer last,
DataFetchingEnvironment environment) {
return todoSchema.getSimpleConnectionTodo().get(environment);
}
}
================================================
FILE: graphql-sample-app/src/main/resources/application.yml
================================================
spring:
application:
name: graphql-todo-app
server:
port: 9000
graphql:
server:
mapping: /graphql
corsEnabled: true
suppressSpringResponseCodes: true
query-key: query
variables-key: variables
uploadMaxFileSize: 128KB
uploadMaxRequestSize: 128KB
schema:
clientMutationIdName: clientMutationId
injectClientMutationId: true
allowEmptyClientMutationId: false
mutationInputArgumentName: input
outputObjectNamePrefix: Payload
inputObjectNamePrefix: Input
schemaMutationObjectName: Mutation
================================================
FILE: graphql-sample-app/src/test/java/com/embedler/moon/graphql/boot/sample/test/GenericTodoSchemaParserTest.java
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.embedler.moon.graphql.boot.sample.test;
import com.embedler.moon.graphql.boot.sample.ApplicationBootConfiguration;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.oembedler.moon.graphql.boot.GraphQLServerRequest;
import com.oembedler.moon.graphql.boot.GraphQLServerResult;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.IntegrationTest;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.boot.test.TestRestTemplate;
import org.springframework.boot.test.WebIntegrationTest;
import org.springframework.core.io.ClassPathResource;
import org.springframework.http.*;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.util.CollectionUtils;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(ApplicationBootConfiguration.class)
@WebIntegrationTest("server.port=0")
public class GenericTodoSchemaParserTest {
private static final Logger LOGGER = LoggerFactory.getLogger(GenericTodoSchemaParserTest.class);
@Value("${local.server.port}")
private int port;
private RestTemplate restTemplate = new TestRestTemplate();
private ObjectMapper objectMapper = new ObjectMapper();
@Test
public void restViewerByIdTest() throws IOException {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
GraphQLServerRequest qlQuery = new GraphQLServerRequest("{viewer{ id }}");
HttpEntity<GraphQLServerRequest> httpEntity = new HttpEntity<>(qlQuery, headers);
ResponseEntity<GraphQLServerResult> responseEntity = restTemplate.exchange("http://localhost:" + port + "/graphql", HttpMethod.POST, httpEntity, GraphQLServerResult.class);
GraphQLServerResult result = responseEntity.getBody();
Assert.assertTrue(CollectionUtils.isEmpty(result.getErrors()));
Assert.assertFalse(CollectionUtils.isEmpty(result.getData()));
LOGGER.info(objectMapper.writeValueAsString(result.getData()));
}
@Test
public void restSchemaDoesNotExistsTest() throws IOException {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
headers.add("graphql-schema", "no-such-schema");
GraphQLServerRequest qlQuery = new GraphQLServerRequest("{viewer{ id }}");
HttpEntity<GraphQLServerRequest> httpEntity = new HttpEntity<>(qlQuery, headers);
ResponseEntity<GraphQLServerResult> responseEntity = restTemplate.exchange("http://localhost:" + port + "/graphql", HttpMethod.POST, httpEntity, GraphQLServerResult.class);
GraphQLServerResult result = responseEntity.getBody();
Assert.assertFalse(CollectionUtils.isEmpty(result.getErrors()));
LOGGER.info(objectMapper.writeValueAsString(result));
}
@Test
public void restUnsupportedOperationErrorTest() throws IOException {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
GraphQLServerRequest qlQuery = new GraphQLServerRequest("{viewer{ id }}");
HttpEntity<GraphQLServerRequest> httpEntity = new HttpEntity<>(qlQuery, headers);
ResponseEntity<GraphQLServerResult> responseEntity = restTemplate.exchange("http://localhost:" + port + "/graphql", HttpMethod.PUT, httpEntity, GraphQLServerResult.class);
GraphQLServerResult result = responseEntity.getBody();
Assert.assertFalse(CollectionUtils.isEmpty(result.getErrors()));
LOGGER.info(objectMapper.writeValueAsString(result));
}
@Test
public void restViewerJsonTest() throws IOException {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
String qlQuery = "{viewer{ id }}";
Map<String, Object> variables = new HashMap<>();
variables.put("test-key", "key-0.9.0");
ResponseEntity<GraphQLServerResult> responseEntity =
restTemplate.getForEntity("http://localhost:" + port + "/graphql?query={0}&variables={1}",
GraphQLServerResult.class, qlQuery, objectMapper.writeValueAsString(variables));
GraphQLServerResult result = responseEntity.getBody();
Assert.assertTrue(CollectionUtils.isEmpty(result.getErrors()));
Assert.assertFalse(CollectionUtils.isEmpty(result.getData()));
LOGGER.info(objectMapper.writeValueAsString(result.getData()));
}
@Test
public void restUploadFileTest() throws IOException {
LinkedMultiValueMap<String, Object> map = new LinkedMultiValueMap<>();
map.add("file", new ClassPathResource("application.yml"));
String qlQuery = "mutation UploadFileMutation{uploadFile(input: {clientMutationId:\"m-123\"}){ filename }}";
map.add("query", qlQuery);
map.add("variables", "{}");
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
HttpEntity<LinkedMultiValueMap<String, Object>> requestEntity = new HttpEntity<>(map, headers);
ResponseEntity<GraphQLServerResult> responseEntity =
restTemplate.exchange("http://localhost:" + port + "/graphql", HttpMethod.POST, requestEntity, GraphQLServerResult.class);
GraphQLServerResult result = responseEntity.getBody();
Assert.assertTrue(CollectionUtils.isEmpty(result.getErrors()));
Assert.assertFalse(CollectionUtils.isEmpty(result.getData()));
LOGGER.info(objectMapper.writeValueAsString(result.getData()));
}
@Test
public void restUploadFileUrlEncodedTest() throws IOException {
LinkedMultiValueMap<String, Object> map = new LinkedMultiValueMap<>();
map.add("query", "mutation AddTodoMutationMutation{addTodoMutation(input: {clientMutationId:\"m-123\", addTodoInput:{text: \"text\"}}){ clientMutationId, todoEdge {cursor, node {text, complete}} }}");
map.add("variables", "{}");
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
HttpEntity<LinkedMultiValueMap<String, Object>> requestEntity = new HttpEntity<>(map, headers);
ResponseEntity<GraphQLServerResult> responseEntity =
restTemplate.exchange("http://localhost:" + port + "/graphql", HttpMethod.POST, requestEntity, GraphQLServerResult.class);
GraphQLServerResult result = responseEntity.getBody();
Assert.assertTrue(CollectionUtils.isEmpty(result.getErrors()));
Assert.assertFalse(CollectionUtils.isEmpty(result.getData()));
LOGGER.info(objectMapper.writeValueAsString(result.getData()));
}
}
================================================
FILE: graphql-spring-boot-autoconfigure/LICENSE.md
================================================
The MIT License (MIT)
Copyright (c) 2016 Oembedler Inc. and Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: graphql-spring-boot-autoconfigure/build.gradle
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6"
}
}
dependencies {
compile "com.embedler.moon.graphql:spring-graphql-common:$LIB_SPRING_GRAPHQL_COMMON_VER"
compile "org.springframework.boot:spring-boot-configuration-processor:$LIB_SPRING_BOOT_VER"
compile "org.springframework.boot:spring-boot-autoconfigure:$LIB_SPRING_BOOT_VER"
provided "org.springframework.boot:spring-boot-starter-web:$LIB_SPRING_BOOT_VER"
provided "commons-fileupload:commons-fileupload:$LIB_COMMON_UPLOAD"
testCompile "org.springframework.boot:spring-boot-starter-test:$LIB_SPRING_BOOT_VER"
}
================================================
FILE: graphql-spring-boot-autoconfigure/gradle/wrapper/gradle-wrapper.properties
================================================
#Sun Mar 27 20:34:11 BST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip
================================================
FILE: graphql-spring-boot-autoconfigure/gradle.properties
================================================
#
# The MIT License (MIT)
#
# Copyright (c) 2016 oEmbedler Inc. and Contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
PROJECT_VERSION = 2.1.0
PROJECT_GROUP = com.embedler.moon.graphql.boot.autoconfigure
PROJECT_NAME = graphql-spring-boot-autoconfigure
PROJECT_DESC = GraphQL Spring Framework Boot Autoconfigure
PROJECT_GIT_REPO_URL = https://github.com/oembedler/graphql-spring-boot
PROJECT_LICENSE = MIT
PROJECT_LICENSE_URL = https://github.com/oembedler/spring-boot-graphql/blob/master/LICENSE.md
PROJECT_DEV_ID = oembedler
PROJECT_DEV_NAME = Embedler Inc.
VCS=Git
###
SOURCE_COMPATIBILITY = 1.8
TARGET_COMPATIBILITY = 1.8
###
LIB_SPRING_GRAPHQL_COMMON_VER = 2+
LIB_JUNIT_VER = 4.12
LIB_SPRING_CORE_VER = 4.2.4.RELEASE
LIB_SPRING_BOOT_VER = 1.3.2.RELEASE
GRADLE_WRAPPER_VER = 2.9
###
org.gradle.daemon=true
bintray.user=USER
bintray.key=KEY
================================================
FILE: graphql-spring-boot-autoconfigure/gradlew
================================================
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
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
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
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
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
================================================
FILE: graphql-spring-boot-autoconfigure/gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: graphql-spring-boot-autoconfigure/settings.gradle
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
rootProject.name = PROJECT_NAME
================================================
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/EnableGraphQLServer.java
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.oembedler.moon.graphql.boot;
import org.springframework.context.annotation.Import;
import java.lang.annotation.*;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = {ElementType.TYPE})
@Documented
@Import(GraphQLWebAutoConfiguration.class)
public @interface EnableGraphQLServer {
}
================================================
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/ErrorGraphQLQueryEvaluation.java
================================================
package com.oembedler.moon.graphql.boot;
import graphql.ErrorType;
import graphql.GraphQLError;
import graphql.language.SourceLocation;
import java.util.List;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
public class ErrorGraphQLQueryEvaluation implements GraphQLError {
@Override
public String getMessage() {
return "Error evaluating GraphQL schema";
}
@Override
public List<SourceLocation> getLocations() {
return null;
}
@Override
public ErrorType getErrorType() {
return ErrorType.ValidationError;
}
}
================================================
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/ErrorGraphQLSchemaUndefined.java
================================================
package com.oembedler.moon.graphql.boot;
import graphql.ErrorType;
import graphql.GraphQLError;
import graphql.language.SourceLocation;
import java.util.List;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
public class ErrorGraphQLSchemaUndefined implements GraphQLError {
@Override
public String getMessage() {
return "No GraphQL schema definition found";
}
@Override
public List<SourceLocation> getLocations() {
return null;
}
@Override
public ErrorType getErrorType() {
return ErrorType.ValidationError;
}
}
================================================
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/ErrorGraphQLServer.java
================================================
package com.oembedler.moon.graphql.boot;
import graphql.ErrorType;
import graphql.GraphQLError;
import graphql.language.SourceLocation;
import java.util.List;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
public class ErrorGraphQLServer implements GraphQLError {
private String message;
public ErrorGraphQLServer(String message) {
this.message = message;
}
@Override
public String getMessage() {
return message;
}
@Override
public List<SourceLocation> getLocations() {
return null;
}
@Override
public ErrorType getErrorType() {
return ErrorType.ValidationError;
}
}
================================================
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GlobalDefaultExceptionHandler.java
================================================
package com.oembedler.moon.graphql.boot;
import com.google.common.collect.Maps;
import graphql.ErrorType;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.Map;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
@ControllerAdvice
public class GlobalDefaultExceptionHandler {
public static final String ERROR_MESSAGE = "message";
public static final String ERROR_TYPE = "type";
@ExceptionHandler(Exception.class)
public ResponseEntity<GraphQLServerResult> defaultErrorHandler(HttpServletRequest req, Exception e) throws Exception {
// if the exception is annotated with @ResponseStatus rethrow it and let the framework handle it
if (AnnotationUtils.findAnnotation(e.getClass(), ResponseStatus.class) != null) {
throw e;
}
Map<String, String> map = Maps.newHashMap();
map.put(ERROR_MESSAGE, e.getMessage());
map.put(ERROR_TYPE, ErrorType.ValidationError.toString());
return ResponseEntity.ok(new GraphQLServerResult(Arrays.asList(map)));
}
}
================================================
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLAutoConfiguration.java
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.oembedler.moon.graphql.boot;
import com.oembedler.moon.graphql.GraphQLSchemaBeanFactory;
import com.oembedler.moon.graphql.SpringGraphQLSchemaBeanFactory;
import com.oembedler.moon.graphql.engine.GraphQLSchemaBuilder;
import com.oembedler.moon.graphql.engine.GraphQLSchemaConfig;
import com.oembedler.moon.graphql.engine.GraphQLSchemaHolder;
import com.oembedler.moon.graphql.engine.stereotype.GraphQLSchema;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
@Configuration
@EnableConfigurationProperties(GraphQLProperties.class)
public class GraphQLAutoConfiguration {
@Autowired
private GraphQLProperties graphQLProperties;
@Autowired
private ApplicationContext applicationContext;
@Bean
@ConditionalOnMissingBean
public GraphQLSchemaBeanFactory graphQLSchemaBeanFactory() {
return new SpringGraphQLSchemaBeanFactory();
}
@Bean
@ConditionalOnMissingBean
public GraphQLSchemaConfig graphQLSchemaConfig() {
GraphQLSchemaConfig graphQLSchemaConfig = new GraphQLSchemaConfig();
// --- populate schema config based on boot GraphQL properties
GraphQLProperties.Schema schema = graphQLProperties.getSchema();
if (schema != null) {
if (schema.getAllowEmptyClientMutationId() != null)
graphQLSchemaConfig.setAllowEmptyClientMutationId(schema.getAllowEmptyClientMutationId());
if (schema.getInjectClientMutationId() != null)
graphQLSchemaConfig.setInjectClientMutationId(schema.getInjectClientMutationId());
if (StringUtils.hasText(schema.getClientMutationIdName()))
graphQLSchemaConfig.setClientMutationIdName(schema.getClientMutationIdName());
if (StringUtils.hasText(schema.getInputObjectNamePrefix()))
graphQLSchemaConfig.setInputObjectNamePrefix(schema.getInputObjectNamePrefix());
if (StringUtils.hasText(schema.getMutationInputArgumentName()))
graphQLSchemaConfig.setMutationInputArgumentName(schema.getMutationInputArgumentName());
if (StringUtils.hasText(schema.getOutputObjectNamePrefix()))
graphQLSchemaConfig.setOutputObjectNamePrefix(schema.getOutputObjectNamePrefix());
if (StringUtils.hasText(schema.getSchemaMutationObjectName()))
graphQLSchemaConfig.setSchemaMutationObjectName(schema.getSchemaMutationObjectName());
}
return graphQLSchemaConfig;
}
@Bean
@ConditionalOnMissingBean
public GraphQLSchemaBuilder graphQLSchemaBuilder() {
return new GraphQLSchemaBuilder(graphQLSchemaConfig(), graphQLSchemaBeanFactory());
}
@Bean
@ConditionalOnMissingBean
public GraphQLSchemaLocator graphQLSchemaLocator() throws ClassNotFoundException {
Map<String, GraphQLSchemaHolder> graphQLSchemaHolders = new HashMap<>();
GraphQLSchemaBuilder graphQLSchemaBuilder = graphQLSchemaBuilder();
Set<Class<?>> schemaClasses = initialSchemaClassesSet();
if (schemaClasses.size() > 0) {
for (Class<?> schema : schemaClasses) {
GraphQLSchemaHolder schemaHolder = graphQLSchemaBuilder.buildSchema(schema);
graphQLSchemaHolders.put(schemaHolder.getSchemaName(), schemaHolder);
}
}
return new GraphQLSchemaLocator(graphQLSchemaHolders);
}
protected Set<Class<?>> initialSchemaClassesSet() {
// scans the application context for classes annotated with {@link GraphQLSchema}
Map<String, Object> potentialCandidates = applicationContext.getBeansWithAnnotation(GraphQLSchema.class);
return potentialCandidates.values().stream().map(x -> x.getClass()).collect(Collectors.toSet());
}
}
================================================
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLContext.java
================================================
package com.oembedler.moon.graphql.boot;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
public class GraphQLContext extends HashMap<String, Object> {
public static final String KEY_FILE_UPLOAD = "file";
public static final String KEY_HTTP_REQUEST = "http-request";
public HttpServletRequest setHttpRequest(final HttpServletRequest request) {
this.put(KEY_HTTP_REQUEST, request);
return getHttpRequest();
}
public MultipartFile setUploadedFile(final MultipartFile file) {
this.put(KEY_FILE_UPLOAD, file);
return getUploadedFile();
}
public MultipartFile getUploadedFile() {
return (MultipartFile) this.get(KEY_FILE_UPLOAD);
}
public HttpServletRequest getHttpRequest() {
return (HttpServletRequest) this.get(KEY_HTTP_REQUEST);
}
}
================================================
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLProperties.java
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.oembedler.moon.graphql.boot;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.context.annotation.Configuration;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
@Configuration
@ConfigurationProperties(prefix = "graphql")
public class GraphQLProperties {
@NestedConfigurationProperty
private Server server;
@NestedConfigurationProperty
private Schema schema;
public static class Server {
private String mapping;
private String queryKey;
private String variablesKey;
private String uploadMaxFileSize;
private String uploadMaxRequestSize;
private Boolean suppressSpringResponseCodes;
public String getMapping() {
return mapping;
}
public void setMapping(String mapping) {
this.mapping = mapping;
}
public String getQueryKey() {
return queryKey;
}
public void setQueryKey(String queryKey) {
this.queryKey = queryKey;
}
public String getVariablesKey() {
return variablesKey;
}
public void setVariablesKey(String variablesKey) {
this.variablesKey = variablesKey;
}
public String getUploadMaxFileSize() {
return uploadMaxFileSize;
}
public void setUploadMaxFileSize(String uploadMaxFileSize) {
this.uploadMaxFileSize = uploadMaxFileSize;
}
public String getUploadMaxRequestSize() {
return uploadMaxRequestSize;
}
public void setUploadMaxRequestSize(String uploadMaxRequestSize) {
this.uploadMaxRequestSize = uploadMaxRequestSize;
}
public Boolean getSuppressSpringResponseCodes() {
return suppressSpringResponseCodes;
}
public void setSuppressSpringResponseCodes(Boolean suppressSpringResponseCodes) {
this.suppressSpringResponseCodes = suppressSpringResponseCodes;
}
}
public static class Schema {
private String clientMutationIdName;
private Boolean injectClientMutationId;
private Boolean allowEmptyClientMutationId;
private String mutationInputArgumentName;
private String outputObjectNamePrefix;
private String inputObjectNamePrefix;
private String schemaMutationObjectName;
public String getClientMutationIdName() {
return clientMutationIdName;
}
public void setClientMutationIdName(String clientMutationIdName) {
this.clientMutationIdName = clientMutationIdName;
}
public Boolean getInjectClientMutationId() {
return injectClientMutationId;
}
public void setInjectClientMutationId(Boolean injectClientMutationId) {
this.injectClientMutationId = injectClientMutationId;
}
public Boolean getAllowEmptyClientMutationId() {
return allowEmptyClientMutationId;
}
public void setAllowEmptyClientMutationId(Boolean allowEmptyClientMutationId) {
this.allowEmptyClientMutationId = allowEmptyClientMutationId;
}
public String getMutationInputArgumentName() {
return mutationInputArgumentName;
}
public void setMutationInputArgumentName(String mutationInputArgumentName) {
this.mutationInputArgumentName = mutationInputArgumentName;
}
public String getOutputObjectNamePrefix() {
return outputObjectNamePrefix;
}
public void setOutputObjectNamePrefix(String outputObjectNamePrefix) {
this.outputObjectNamePrefix = outputObjectNamePrefix;
}
public String getInputObjectNamePrefix() {
return inputObjectNamePrefix;
}
public void setInputObjectNamePrefix(String inputObjectNamePrefix) {
this.inputObjectNamePrefix = inputObjectNamePrefix;
}
public String getSchemaMutationObjectName() {
return schemaMutationObjectName;
}
public void setSchemaMutationObjectName(String schemaMutationObjectName) {
this.schemaMutationObjectName = schemaMutationObjectName;
}
}
public Server getServer() {
return server;
}
public void setServer(Server server) {
this.server = server;
}
public Schema getSchema() {
return schema;
}
public void setSchema(Schema schema) {
this.schema = schema;
}
}
================================================
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLSchemaLocator.java
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.oembedler.moon.graphql.boot;
import com.google.common.collect.Maps;
import com.oembedler.moon.graphql.engine.GraphQLSchemaHolder;
import graphql.Assert;
import java.util.Map;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
public class GraphQLSchemaLocator {
private final Map<String, GraphQLSchemaHolder> graphQLSchemaHolders;
private final int totalNumberOfSchemas;
public GraphQLSchemaLocator(Map<String, GraphQLSchemaHolder> graphQLSchemaHolders) {
this.graphQLSchemaHolders = Maps.newHashMap();
this.graphQLSchemaHolders.putAll(graphQLSchemaHolders);
this.totalNumberOfSchemas = this.graphQLSchemaHolders.size();
}
public GraphQLSchemaHolder getGraphQLSchemaHolder(final String schemaName) {
Assert.assertNotNull(schemaName, "Schema name can not be null");
return graphQLSchemaHolders.get(schemaName);
}
public GraphQLSchemaHolder getSingleSchema() {
return getTotalNumberOfSchemas() == 1 ?
graphQLSchemaHolders.get(graphQLSchemaHolders.keySet().iterator().next()) :
null;
}
public int getTotalNumberOfSchemas() {
return totalNumberOfSchemas;
}
public boolean containsSchema(final String schemaName) {
Assert.assertNotNull(schemaName, "Schema name can not be null");
return graphQLSchemaHolders.containsKey(schemaName);
}
}
================================================
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLServerController.java
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.oembedler.moon.graphql.boot;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.Lists;
import com.oembedler.moon.graphql.engine.GraphQLSchemaHolder;
import com.oembedler.moon.graphql.engine.execute.GraphQLQueryExecutor;
import graphql.ExecutionResult;
import graphql.ExecutionResultImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
@RestController
@RequestMapping("${graphql.server.mapping:/graphql}")
public class GraphQLServerController {
private static final Logger LOGGER = LoggerFactory.getLogger(GraphQLServerController.class);
public static final String DEFAULT_QUERY_KEY = "query";
public static final String DEFAULT_VARIABLES_KEY = "variables";
public static final String DEFAULT_OPERATION_NAME_KEY = "operationName";
public static final String DEFAULT_DATA_KEY = "data";
public static final String DEFAULT_FILENAME_UPLOAD_KEY = "file";
public static final String DEFAULT_ERRORS_KEY = "errors";
public static final String HEADER_SCHEMA_NAME = "graphql-schema";
// ---
@Autowired
private GraphQLProperties graphQLProperties;
@Autowired
private GraphQLSchemaLocator graphQLSchemaLocator;
private ObjectMapper objectMapper = new ObjectMapper();
// ---
@RequestMapping(method = RequestMethod.GET)
public ResponseEntity<Map<String, Object>> getJson(@RequestParam(DEFAULT_QUERY_KEY) String query,
@RequestParam(value = DEFAULT_VARIABLES_KEY, required = false) String variables,
@RequestParam(value = DEFAULT_OPERATION_NAME_KEY, required = false) String operationName,
@RequestHeader(value = HEADER_SCHEMA_NAME, required = false) String graphQLSchemaName,
HttpServletRequest httpServletRequest) throws IOException {
final GraphQLContext graphQLContext = new GraphQLContext();
graphQLContext.setHttpRequest(httpServletRequest);
final Map<String, Object> result = evaluateAndBuildResponseMap(query, operationName, graphQLContext, decodeIntoMap(variables), graphQLSchemaName);
return ResponseEntity.ok(result);
}
@RequestMapping(method = RequestMethod.POST, consumes = "application/graphql")
public ResponseEntity<Map<String, Object>> postGraphQL(@RequestBody String query,
@RequestParam(value = DEFAULT_OPERATION_NAME_KEY, required = false) String operationName,
@RequestHeader(value = HEADER_SCHEMA_NAME, required = false) String graphQLSchemaName,
HttpServletRequest httpServletRequest) {
final GraphQLContext graphQLContext = new GraphQLContext();
graphQLContext.setHttpRequest(httpServletRequest);
final Map<String, Object> result = evaluateAndBuildResponseMap(query, operationName, graphQLContext, new HashMap<>(), graphQLSchemaName);
return ResponseEntity.ok(result);
}
@RequestMapping(method = RequestMethod.POST, consumes = "application/json")
public ResponseEntity<Map<String, Object>> postJson(@RequestBody Map<String, Object> body,
@RequestHeader(value = HEADER_SCHEMA_NAME, required = false) String graphQLSchemaName,
HttpServletRequest httpServletRequest) {
final String query = (String) body.get(getQueryKey());
final String operationName = (String) body.get(DEFAULT_OPERATION_NAME_KEY);
Map<String, Object> variables = null;
Object variablesObject = body.get(getVariablesKey());
if (variablesObject != null && variablesObject instanceof Map)
variables = (Map<String, Object>) variablesObject;
final GraphQLContext graphQLContext = new GraphQLContext();
graphQLContext.setHttpRequest(httpServletRequest);
final Map<String, Object> result = evaluateAndBuildResponseMap(query, operationName, graphQLContext, variables, graphQLSchemaName);
return ResponseEntity.ok(result);
}
@RequestMapping(method = RequestMethod.POST, consumes = "multipart/form-data")
public ResponseEntity<Map<String, Object>> uploadFile(@RequestParam(DEFAULT_FILENAME_UPLOAD_KEY) MultipartFile file,
@RequestParam(DEFAULT_QUERY_KEY) String query,
@RequestParam(value = DEFAULT_VARIABLES_KEY, required = false) String variables,
@RequestParam(value = DEFAULT_OPERATION_NAME_KEY, required = false) String operationName,
@RequestHeader(value = HEADER_SCHEMA_NAME, required = false) String graphQLSchemaName,
HttpServletRequest httpServletRequest) throws IOException {
final GraphQLContext graphQLContext = new GraphQLContext();
graphQLContext.setUploadedFile(file);
graphQLContext.setHttpRequest(httpServletRequest);
final Map<String, Object> result = evaluateAndBuildResponseMap(query, operationName, graphQLContext, decodeIntoMap(variables), graphQLSchemaName);
return ResponseEntity.ok(result);
}
@RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urlencoded")
public ResponseEntity<Map<String, Object>> uploadSmallFile(@RequestParam(DEFAULT_QUERY_KEY) String query,
@RequestParam(value = DEFAULT_VARIABLES_KEY, required = false) String variables,
@RequestParam(value = DEFAULT_OPERATION_NAME_KEY, required = false) String operationName,
@RequestHeader(value = HEADER_SCHEMA_NAME, required = false) String graphQLSchemaName,
HttpServletRequest httpServletRequest) throws IOException {
final GraphQLContext graphQLContext = new GraphQLContext();
graphQLContext.setHttpRequest(httpServletRequest);
final Map<String, Object> result = evaluateAndBuildResponseMap(query, operationName, graphQLContext, decodeIntoMap(variables), graphQLSchemaName);
return ResponseEntity.ok(result);
}
private Map<String, Object> decodeIntoMap(final String variablesParam) throws IOException {
return objectMapper.readValue(variablesParam, Map.class);
}
private Map<String, Object> evaluateAndBuildResponseMap(final String query,
final String operationName,
final GraphQLContext graphQLContext,
final Map<String, Object> variables,
final String graphQLSchemaName) {
final Map<String, Object> result = new LinkedHashMap<>();
final GraphQLSchemaHolder graphQLSchemaHolder = getGraphQLSchemaContainer(graphQLSchemaName);
final ExecutionResult executionResult = evaluate(query, operationName, graphQLContext, variables, graphQLSchemaHolder);
if (executionResult.getErrors().size() > 0) {
result.put(DEFAULT_ERRORS_KEY, executionResult.getErrors());
LOGGER.error("Errors: {}", executionResult.getErrors());
}
result.put(DEFAULT_DATA_KEY, executionResult.getData());
return result;
}
private ExecutionResult evaluate(final String query,
final String operationName,
final GraphQLContext graphQLContext,
final Map<String, Object> variables,
final GraphQLSchemaHolder graphQLSchemaHolder) {
ExecutionResult executionResult;
if (graphQLSchemaHolder == null) {
executionResult = new ExecutionResultImpl(Lists.newArrayList(new ErrorGraphQLSchemaUndefined()));
} else {
try {
GraphQLQueryExecutor graphQLQueryExecutor = GraphQLQueryExecutor.create(graphQLSchemaHolder)
.query(query).context(graphQLContext);
if (variables != null)
graphQLQueryExecutor.arguments(variables);
if (StringUtils.hasText(operationName))
graphQLQueryExecutor.operation(operationName);
executionResult = graphQLQueryExecutor.execute();
} catch (Exception e) {
LOGGER.error("Error occurred evaluating query: {}", query);
executionResult = new ExecutionResultImpl(Lists.newArrayList(new ErrorGraphQLQueryEvaluation()));
}
}
return executionResult;
}
private String getQueryKey() {
return StringUtils.hasText(graphQLProperties.getServer().getQueryKey()) ?
graphQLProperties.getServer().getQueryKey() : DEFAULT_QUERY_KEY;
}
private String getVariablesKey() {
return StringUtils.hasText(graphQLProperties.getServer().getVariablesKey()) ?
graphQLProperties.getServer().getVariablesKey() : DEFAULT_VARIABLES_KEY;
}
public GraphQLSchemaHolder getGraphQLSchemaContainer(String graphQLSchema) {
if (StringUtils.hasText(graphQLSchema))
return graphQLSchemaLocator.getGraphQLSchemaHolder(graphQLSchema);
else if (graphQLSchemaLocator.getTotalNumberOfSchemas() == 1)
return graphQLSchemaLocator.getSingleSchema();
return null;
}
}
================================================
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLServerRequest.java
================================================
package com.oembedler.moon.graphql.boot;
import java.util.HashMap;
import java.util.Map;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
public class GraphQLServerRequest {
private String query;
private Map<String, Object> variables = new HashMap<>();
public GraphQLServerRequest() {
}
public GraphQLServerRequest(String query) {
this.query = query;
}
public GraphQLServerRequest(String query, Map<String, Object> variables) {
this.query = query;
this.variables = variables;
}
public String getQuery() {
return query;
}
public Map<String, Object> getVariables() {
return variables;
}
}
================================================
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLServerResult.java
================================================
package com.oembedler.moon.graphql.boot;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
public class GraphQLServerResult {
private List<Map<String, String>> errors;
private Map<String, Object> data;
public GraphQLServerResult() {
}
public GraphQLServerResult(Map<String, Object> data) {
this(Collections.EMPTY_LIST, data);
}
public GraphQLServerResult(List<Map<String, String>> errors) {
this(errors, Collections.EMPTY_MAP);
}
public GraphQLServerResult(List<Map<String, String>> errors, Map<String, Object> data) {
this.errors = errors;
this.data = data;
}
public List<Map<String, String>> getErrors() {
return errors;
}
public void setErrors(List<Map<String, String>> errors) {
this.errors = errors;
}
public Map<String, Object> getData() {
return data;
}
public void setData(Map<String, Object> data) {
this.data = data;
}
}
================================================
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLWebAutoConfiguration.java
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.oembedler.moon.graphql.boot;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.context.embedded.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.StringUtils;
import org.springframework.web.servlet.DispatcherServlet;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import javax.servlet.MultipartConfigElement;
import javax.servlet.Servlet;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
@Configuration
@ConditionalOnWebApplication
@ConditionalOnClass({Servlet.class, DispatcherServlet.class, WebMvcConfigurerAdapter.class})
@AutoConfigureAfter({GraphQLAutoConfiguration.class, WebMvcConfigurerAdapter.class})
public class GraphQLWebAutoConfiguration {
private static final String DEFAULT_UPLOAD_MAX_FILE_SIZE = "128KB";
private static final String DEFAULT_UPLOAD_MAX_REQUEST_SIZE = "128KB";
@Value("${graphql.server.mapping:/graphql}")
private String graphQLServerMapping;
@Bean
@ConditionalOnProperty(value = "graphql.server.corsEnabled", havingValue = "true", matchIfMissing = true)
public WebMvcConfigurer corsConfigurer() {
return new WebMvcConfigurerAdapter() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping(graphQLServerMapping);
}
};
}
@Bean
@ConditionalOnMissingBean(GraphQLServerController.class)
public GraphQLServerController basicGraphQLController() {
return new GraphQLServerController();
}
@Bean
@ConditionalOnMissingBean(GlobalDefaultExceptionHandler.class)
@ConditionalOnProperty(value = "graphql.server.suppressSpringResponseCodes", havingValue = "true", matchIfMissing = true)
public GlobalDefaultExceptionHandler globalDefaultExceptionHandler() {
return new GlobalDefaultExceptionHandler();
}
@Bean
@ConditionalOnMissingBean(MultipartConfigElement.class)
public MultipartConfigElement multipartConfigElement(GraphQLProperties graphQLProperties) {
MultipartConfigFactory factory = new MultipartConfigFactory();
factory.setMaxFileSize(DEFAULT_UPLOAD_MAX_FILE_SIZE);
factory.setMaxRequestSize(DEFAULT_UPLOAD_MAX_REQUEST_SIZE);
String temp = graphQLProperties.getServer().getUploadMaxFileSize();
if (StringUtils.hasText(temp))
factory.setMaxFileSize(temp);
temp = graphQLProperties.getServer().getUploadMaxRequestSize();
if (StringUtils.hasText(temp))
factory.setMaxRequestSize(temp);
return factory.createMultipartConfig();
}
}
================================================
FILE: graphql-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories
================================================
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.oembedler.moon.graphql.boot.GraphQLAutoConfiguration
================================================
FILE: graphql-spring-boot-autoconfigure/src/test/java/com/oembedler/moon/graphql/boot/test/GraphQLAutoConfigurationTest.java
================================================
package com.oembedler.moon.graphql.boot.test;
import com.oembedler.moon.graphql.GraphQLSchemaBeanFactory;
import com.oembedler.moon.graphql.boot.GraphQLAutoConfiguration;
import com.oembedler.moon.graphql.boot.GraphQLSchemaLocator;
import com.oembedler.moon.graphql.engine.GraphQLSchemaBuilder;
import com.oembedler.moon.graphql.engine.GraphQLSchemaConfig;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.boot.test.EnvironmentTestUtils;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
public class GraphQLAutoConfigurationTest {
private static final String BASE_PACKAGE = "com.oembedler.moon.graphql.boot.test";
private AnnotationConfigApplicationContext context;
@After
public void tearDown() {
if (this.context != null) {
this.context.close();
}
}
@Test
public void defaultSettingsLoad() {
load(EmptyConfiguration.class, "");
GraphQLSchemaBeanFactory graphQLSchemaBeanFactory = this.context.getBean(GraphQLSchemaBeanFactory.class);
GraphQLSchemaConfig graphQLSchemaConfig = this.context.getBean(GraphQLSchemaConfig.class);
GraphQLSchemaBuilder graphQLSchemaBuilder = this.context.getBean(GraphQLSchemaBuilder.class);
GraphQLSchemaLocator graphQLSchemaLocator = this.context.getBean(GraphQLSchemaLocator.class);
Assert.assertTrue(graphQLSchemaBeanFactory.containsBean(GraphQLSchemaBeanFactory.class));
Assert.assertEquals(graphQLSchemaBeanFactory, graphQLSchemaBeanFactory.getBeanByType(GraphQLSchemaBeanFactory.class));
Assert.assertEquals(graphQLSchemaBeanFactory, graphQLSchemaBuilder.getGraphQLSchemaBeanFactory());
Assert.assertEquals(graphQLSchemaConfig, graphQLSchemaBuilder.getGraphQLSchemaConfig());
Assert.assertEquals(1, graphQLSchemaLocator.getTotalNumberOfSchemas());
}
private void load(Class<?> config, String... environment) {
AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
EnvironmentTestUtils.addEnvironment(applicationContext, environment);
applicationContext.register(config);
applicationContext.register(GraphQLAutoConfiguration.class);
applicationContext.refresh();
this.context = applicationContext;
}
@Configuration
@ComponentScan(BASE_PACKAGE)
static class EmptyConfiguration {
}
}
================================================
FILE: graphql-spring-boot-autoconfigure/src/test/java/com/oembedler/moon/graphql/boot/test/schema/EmptySchema.java
================================================
package com.oembedler.moon.graphql.boot.test.schema;
import com.oembedler.moon.graphql.engine.stereotype.GraphQLObject;
import com.oembedler.moon.graphql.engine.stereotype.GraphQLSchema;
import com.oembedler.moon.graphql.engine.stereotype.GraphQLSchemaQuery;
/**
* @author <a href="mailto:java.lang.RuntimeException@gmail.com">oEmbedler Inc.</a>
*/
@GraphQLSchema("EmptySchema")
public class EmptySchema {
@GraphQLSchemaQuery
private Root root;
@GraphQLObject
public static class Root {
}
}
================================================
FILE: graphql-spring-boot-starter/LICENSE.md
================================================
The MIT License (MIT)
Copyright (c) 2015 Oembedler Inc. and Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: graphql-spring-boot-starter/build.gradle
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6"
}
}
dependencies {
compile(project(':graphql-spring-boot-autoconfigure'))
}
================================================
FILE: graphql-spring-boot-starter/gradle/wrapper/gradle-wrapper.properties
================================================
#Sun Mar 27 20:34:11 BST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip
================================================
FILE: graphql-spring-boot-starter/gradle.properties
================================================
#
# The MIT License (MIT)
#
# Copyright (c) 2016 oEmbedler Inc. and Contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
PROJECT_VERSION = 2.1.0
PROJECT_GROUP = com.embedler.moon.graphql.boot.starter
PROJECT_NAME = graphql-spring-boot-starter
PROJECT_DESC = GraphQL Spring Framework Boot Starter
PROJECT_GIT_REPO_URL = https://github.com/oembedler/graphql-spring-boot
PROJECT_LICENSE = MIT
PROJECT_LICENSE_URL = https://github.com/oembedler/spring-boot-graphql/blob/master/LICENSE.md
PROJECT_DEV_ID = oembedler
PROJECT_DEV_NAME = Embedler Inc.
VCS=Git
###
SOURCE_COMPATIBILITY = 1.8
TARGET_COMPATIBILITY = 1.8
###
LIB_SPRING_GRAPHQL_COMMON_VER = 2+
LIB_JUNIT_VER = 4.12
LIB_SPRING_CORE_VER = 4.2.4.RELEASE
LIB_SPRING_BOOT_VER = 1.3.2.RELEASE
GRADLE_WRAPPER_VER = 2.9
###
org.gradle.daemon=true
bintray.user=USER
bintray.key=KEY
================================================
FILE: graphql-spring-boot-starter/gradlew
================================================
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
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
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
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
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
================================================
FILE: graphql-spring-boot-starter/gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: graphql-spring-boot-starter/settings.gradle
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
rootProject.name = PROJECT_NAME
================================================
FILE: settings.gradle
================================================
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 oEmbedler Inc. and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
* persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
rootProject.name = PROJECT_NAME
include ":graphql-spring-boot-autoconfigure", ":graphql-spring-boot-starter"
include ":graphiql-spring-boot-autoconfigure", ":graphiql-spring-boot-starter"
include ":graphql-sample-app"
gitextract_bf5_cnpc/ ├── .gitignore ├── .travis.yml ├── LICENSE.md ├── README.md ├── build.gradle ├── gradle/ │ └── wrapper/ │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── gradlew ├── gradlew.bat ├── graphiql-spring-boot-autoconfigure/ │ ├── LICENSE.md │ ├── build.gradle │ ├── gradle/ │ │ └── wrapper/ │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradle.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src/ │ └── main/ │ └── resources/ │ └── META-INF/ │ └── resources/ │ ├── graphiql-config.js │ └── index.html ├── graphiql-spring-boot-starter/ │ ├── LICENSE.md │ ├── build.gradle │ ├── gradle/ │ │ └── wrapper/ │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradle.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── graphql-sample-app/ │ ├── LICENSE.md │ ├── build.gradle │ ├── gradle/ │ │ └── wrapper/ │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradle.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src/ │ ├── main/ │ │ ├── java/ │ │ │ └── com/ │ │ │ └── embedler/ │ │ │ └── moon/ │ │ │ └── graphql/ │ │ │ └── boot/ │ │ │ └── sample/ │ │ │ ├── ApplicationBootConfiguration.java │ │ │ ├── SimpleListConnection.java │ │ │ ├── TodoSimpleListConnection.java │ │ │ └── schema/ │ │ │ ├── TodoSchema.java │ │ │ └── objecttype/ │ │ │ ├── BaseObjectType.java │ │ │ ├── RootObjectType.java │ │ │ ├── TodoObjectType.java │ │ │ └── UserObjectType.java │ │ └── resources/ │ │ └── application.yml │ └── test/ │ └── java/ │ └── com/ │ └── embedler/ │ └── moon/ │ └── graphql/ │ └── boot/ │ └── sample/ │ └── test/ │ └── GenericTodoSchemaParserTest.java ├── graphql-spring-boot-autoconfigure/ │ ├── LICENSE.md │ ├── build.gradle │ ├── gradle/ │ │ └── wrapper/ │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradle.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src/ │ ├── main/ │ │ ├── java/ │ │ │ └── com/ │ │ │ └── oembedler/ │ │ │ └── moon/ │ │ │ └── graphql/ │ │ │ └── boot/ │ │ │ ├── EnableGraphQLServer.java │ │ │ ├── ErrorGraphQLQueryEvaluation.java │ │ │ ├── ErrorGraphQLSchemaUndefined.java │ │ │ ├── ErrorGraphQLServer.java │ │ │ ├── GlobalDefaultExceptionHandler.java │ │ │ ├── GraphQLAutoConfiguration.java │ │ │ ├── GraphQLContext.java │ │ │ ├── GraphQLProperties.java │ │ │ ├── GraphQLSchemaLocator.java │ │ │ ├── GraphQLServerController.java │ │ │ ├── GraphQLServerRequest.java │ │ │ ├── GraphQLServerResult.java │ │ │ └── GraphQLWebAutoConfiguration.java │ │ └── resources/ │ │ └── META-INF/ │ │ └── spring.factories │ └── test/ │ └── java/ │ └── com/ │ └── oembedler/ │ └── moon/ │ └── graphql/ │ └── boot/ │ └── test/ │ ├── GraphQLAutoConfigurationTest.java │ └── schema/ │ └── EmptySchema.java ├── graphql-spring-boot-starter/ │ ├── LICENSE.md │ ├── build.gradle │ ├── gradle/ │ │ └── wrapper/ │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradle.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle └── settings.gradle
SYMBOL INDEX (162 symbols across 23 files)
FILE: graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/ApplicationBootConfiguration.java
class ApplicationBootConfiguration (line 29) | @SpringBootApplication
method main (line 33) | public static void main(String[] args) throws Exception {
FILE: graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/SimpleListConnection.java
class SimpleListConnection (line 16) | public class SimpleListConnection {
method SimpleListConnection (line 21) | public SimpleListConnection(List<?> data) {
method createEdgeObject (line 25) | public <T extends EdgeObjectType> T createEdgeObject() {
method createConnectionObject (line 29) | public <T extends ConnectionObjectType> T createConnectionObject() {
method buildEdges (line 33) | private List<EdgeObjectType> buildEdges() {
method get (line 45) | public <T extends ConnectionObjectType> T get(DataFetchingEnvironment ...
method emptyConnection (line 92) | private <T extends ConnectionObjectType> T emptyConnection() {
method cursorForObjectInConnection (line 98) | public ConnectionCursor cursorForObjectInConnection(Object object) {
method getOffsetFromCursor (line 104) | private int getOffsetFromCursor(String cursor, int defaultValue) {
method createCursor (line 110) | private String createCursor(int offset) {
FILE: graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/TodoSimpleListConnection.java
class TodoSimpleListConnection (line 13) | public class TodoSimpleListConnection extends SimpleListConnection {
method TodoSimpleListConnection (line 18) | public TodoSimpleListConnection(List<?> data) {
method createEdgeObject (line 22) | public <T extends EdgeObjectType> T createEdgeObject() {
method createConnectionObject (line 26) | public <T extends ConnectionObjectType> T createConnectionObject() {
FILE: graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/TodoSchema.java
class TodoSchema (line 33) | @GraphQLSchema
method TodoSchema (line 46) | public TodoSchema() {
method addTodo (line 53) | public String addTodo(String text) {
method removeTodo (line 61) | public void removeTodo(String id) {
method renameTodo (line 66) | public void renameTodo(String id, String text) {
method removeCompletedTodos (line 71) | public List<String> removeCompletedTodos() {
method markAllTodos (line 80) | public List<String> markAllTodos(boolean complete) {
method changeTodoStatus (line 90) | public void changeTodoStatus(String id, boolean complete) {
method getTodo (line 95) | public TodoObjectType getTodo(String id) {
method getTodos (line 99) | public List<TodoObjectType> getTodos(List<String> ids) {
method getTheOnlyUser (line 103) | public UserObjectType getTheOnlyUser() {
method getSimpleConnectionTodo (line 108) | public TodoSimpleListConnection getSimpleConnectionTodo() {
class AddTodoIn (line 112) | public static class AddTodoIn {
method getText (line 115) | public String getText() {
method setText (line 119) | public void setText(String text) {
method addTodoMutation (line 126) | @GraphQLMutation
method uploadFile (line 142) | @GraphQLMutation
method updateTodoMutation (line 149) | @GraphQLMutation
FILE: graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/objecttype/BaseObjectType.java
class BaseObjectType (line 32) | public class BaseObjectType implements RelayNode {
method getId (line 37) | @GraphQLID("id")
method setId (line 45) | public void setId(String id) {
FILE: graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/objecttype/RootObjectType.java
class RootObjectType (line 31) | @GraphQLObject("Root")
method viewer (line 43) | @GraphQLField
method node (line 48) | @GraphQLField
FILE: graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/objecttype/TodoObjectType.java
class TodoObjectType (line 30) | @GraphQLObject("Todo")
method getText (line 35) | public String getText() {
method setText (line 39) | public void setText(String text) {
method isComplete (line 43) | public boolean isComplete() {
method setComplete (line 47) | public void setComplete(boolean complete) {
class TodoConnectionObjectType (line 51) | @GraphQLObject
class TodoEdgeObjectType (line 55) | @GraphQLObject
FILE: graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/objecttype/UserObjectType.java
class UserObjectType (line 33) | @GraphQLObject("User")
method getName (line 42) | public String getName() {
method setName (line 46) | public void setName(String name) {
method todos (line 50) | @GraphQLField
FILE: graphql-sample-app/src/test/java/com/embedler/moon/graphql/boot/sample/test/GenericTodoSchemaParserTest.java
class GenericTodoSchemaParserTest (line 51) | @RunWith(SpringJUnit4ClassRunner.class)
method restViewerByIdTest (line 64) | @Test
method restSchemaDoesNotExistsTest (line 80) | @Test
method restUnsupportedOperationErrorTest (line 96) | @Test
method restViewerJsonTest (line 110) | @Test
method restUploadFileTest (line 128) | @Test
method restUploadFileUrlEncodedTest (line 150) | @Test
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/ErrorGraphQLQueryEvaluation.java
class ErrorGraphQLQueryEvaluation (line 12) | public class ErrorGraphQLQueryEvaluation implements GraphQLError {
method getMessage (line 14) | @Override
method getLocations (line 19) | @Override
method getErrorType (line 24) | @Override
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/ErrorGraphQLSchemaUndefined.java
class ErrorGraphQLSchemaUndefined (line 12) | public class ErrorGraphQLSchemaUndefined implements GraphQLError {
method getMessage (line 14) | @Override
method getLocations (line 19) | @Override
method getErrorType (line 24) | @Override
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/ErrorGraphQLServer.java
class ErrorGraphQLServer (line 12) | public class ErrorGraphQLServer implements GraphQLError {
method ErrorGraphQLServer (line 16) | public ErrorGraphQLServer(String message) {
method getMessage (line 20) | @Override
method getLocations (line 25) | @Override
method getErrorType (line 30) | @Override
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GlobalDefaultExceptionHandler.java
class GlobalDefaultExceptionHandler (line 18) | @ControllerAdvice
method defaultErrorHandler (line 24) | @ExceptionHandler(Exception.class)
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLAutoConfiguration.java
class GraphQLAutoConfiguration (line 44) | @Configuration
method graphQLSchemaBeanFactory (line 54) | @Bean
method graphQLSchemaConfig (line 60) | @Bean
method graphQLSchemaBuilder (line 87) | @Bean
method graphQLSchemaLocator (line 93) | @Bean
method initialSchemaClassesSet (line 108) | protected Set<Class<?>> initialSchemaClassesSet() {
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLContext.java
class GraphQLContext (line 11) | public class GraphQLContext extends HashMap<String, Object> {
method setHttpRequest (line 16) | public HttpServletRequest setHttpRequest(final HttpServletRequest requ...
method setUploadedFile (line 21) | public MultipartFile setUploadedFile(final MultipartFile file) {
method getUploadedFile (line 26) | public MultipartFile getUploadedFile() {
method getHttpRequest (line 30) | public HttpServletRequest getHttpRequest() {
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLProperties.java
class GraphQLProperties (line 29) | @Configuration
class Server (line 39) | public static class Server {
method getMapping (line 47) | public String getMapping() {
method setMapping (line 51) | public void setMapping(String mapping) {
method getQueryKey (line 55) | public String getQueryKey() {
method setQueryKey (line 59) | public void setQueryKey(String queryKey) {
method getVariablesKey (line 63) | public String getVariablesKey() {
method setVariablesKey (line 67) | public void setVariablesKey(String variablesKey) {
method getUploadMaxFileSize (line 71) | public String getUploadMaxFileSize() {
method setUploadMaxFileSize (line 75) | public void setUploadMaxFileSize(String uploadMaxFileSize) {
method getUploadMaxRequestSize (line 79) | public String getUploadMaxRequestSize() {
method setUploadMaxRequestSize (line 83) | public void setUploadMaxRequestSize(String uploadMaxRequestSize) {
method getSuppressSpringResponseCodes (line 87) | public Boolean getSuppressSpringResponseCodes() {
method setSuppressSpringResponseCodes (line 91) | public void setSuppressSpringResponseCodes(Boolean suppressSpringRes...
class Schema (line 96) | public static class Schema {
method getClientMutationIdName (line 105) | public String getClientMutationIdName() {
method setClientMutationIdName (line 109) | public void setClientMutationIdName(String clientMutationIdName) {
method getInjectClientMutationId (line 113) | public Boolean getInjectClientMutationId() {
method setInjectClientMutationId (line 117) | public void setInjectClientMutationId(Boolean injectClientMutationId) {
method getAllowEmptyClientMutationId (line 121) | public Boolean getAllowEmptyClientMutationId() {
method setAllowEmptyClientMutationId (line 125) | public void setAllowEmptyClientMutationId(Boolean allowEmptyClientMu...
method getMutationInputArgumentName (line 129) | public String getMutationInputArgumentName() {
method setMutationInputArgumentName (line 133) | public void setMutationInputArgumentName(String mutationInputArgumen...
method getOutputObjectNamePrefix (line 137) | public String getOutputObjectNamePrefix() {
method setOutputObjectNamePrefix (line 141) | public void setOutputObjectNamePrefix(String outputObjectNamePrefix) {
method getInputObjectNamePrefix (line 145) | public String getInputObjectNamePrefix() {
method setInputObjectNamePrefix (line 149) | public void setInputObjectNamePrefix(String inputObjectNamePrefix) {
method getSchemaMutationObjectName (line 153) | public String getSchemaMutationObjectName() {
method setSchemaMutationObjectName (line 157) | public void setSchemaMutationObjectName(String schemaMutationObjectN...
method getServer (line 162) | public Server getServer() {
method setServer (line 166) | public void setServer(Server server) {
method getSchema (line 170) | public Schema getSchema() {
method setSchema (line 174) | public void setSchema(Schema schema) {
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLSchemaLocator.java
class GraphQLSchemaLocator (line 31) | public class GraphQLSchemaLocator {
method GraphQLSchemaLocator (line 36) | public GraphQLSchemaLocator(Map<String, GraphQLSchemaHolder> graphQLSc...
method getGraphQLSchemaHolder (line 42) | public GraphQLSchemaHolder getGraphQLSchemaHolder(final String schemaN...
method getSingleSchema (line 47) | public GraphQLSchemaHolder getSingleSchema() {
method getTotalNumberOfSchemas (line 53) | public int getTotalNumberOfSchemas() {
method containsSchema (line 57) | public boolean containsSchema(final String schemaName) {
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLServerController.java
class GraphQLServerController (line 44) | @RestController
method getJson (line 69) | @RequestMapping(method = RequestMethod.GET)
method postGraphQL (line 83) | @RequestMapping(method = RequestMethod.POST, consumes = "application/g...
method postJson (line 96) | @RequestMapping(method = RequestMethod.POST, consumes = "application/j...
method uploadFile (line 117) | @RequestMapping(method = RequestMethod.POST, consumes = "multipart/for...
method uploadSmallFile (line 133) | @RequestMapping(method = RequestMethod.POST, consumes = "application/x...
method decodeIntoMap (line 147) | private Map<String, Object> decodeIntoMap(final String variablesParam)...
method evaluateAndBuildResponseMap (line 151) | private Map<String, Object> evaluateAndBuildResponseMap(final String q...
method evaluate (line 169) | private ExecutionResult evaluate(final String query,
method getQueryKey (line 200) | private String getQueryKey() {
method getVariablesKey (line 205) | private String getVariablesKey() {
method getGraphQLSchemaContainer (line 210) | public GraphQLSchemaHolder getGraphQLSchemaContainer(String graphQLSch...
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLServerRequest.java
class GraphQLServerRequest (line 9) | public class GraphQLServerRequest {
method GraphQLServerRequest (line 13) | public GraphQLServerRequest() {
method GraphQLServerRequest (line 16) | public GraphQLServerRequest(String query) {
method GraphQLServerRequest (line 20) | public GraphQLServerRequest(String query, Map<String, Object> variable...
method getQuery (line 25) | public String getQuery() {
method getVariables (line 29) | public Map<String, Object> getVariables() {
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLServerResult.java
class GraphQLServerResult (line 10) | public class GraphQLServerResult {
method GraphQLServerResult (line 14) | public GraphQLServerResult() {
method GraphQLServerResult (line 17) | public GraphQLServerResult(Map<String, Object> data) {
method GraphQLServerResult (line 21) | public GraphQLServerResult(List<Map<String, String>> errors) {
method GraphQLServerResult (line 25) | public GraphQLServerResult(List<Map<String, String>> errors, Map<Strin...
method getErrors (line 30) | public List<Map<String, String>> getErrors() {
method setErrors (line 34) | public void setErrors(List<Map<String, String>> errors) {
method getData (line 38) | public Map<String, Object> getData() {
method setData (line 42) | public void setData(Map<String, Object> data) {
FILE: graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLWebAutoConfiguration.java
class GraphQLWebAutoConfiguration (line 43) | @Configuration
method corsConfigurer (line 55) | @Bean
method basicGraphQLController (line 66) | @Bean
method globalDefaultExceptionHandler (line 72) | @Bean
method multipartConfigElement (line 79) | @Bean
FILE: graphql-spring-boot-autoconfigure/src/test/java/com/oembedler/moon/graphql/boot/test/GraphQLAutoConfigurationTest.java
class GraphQLAutoConfigurationTest (line 19) | public class GraphQLAutoConfigurationTest {
method tearDown (line 24) | @After
method defaultSettingsLoad (line 31) | @Test
method load (line 46) | private void load(Class<?> config, String... environment) {
class EmptyConfiguration (line 55) | @Configuration
FILE: graphql-spring-boot-autoconfigure/src/test/java/com/oembedler/moon/graphql/boot/test/schema/EmptySchema.java
class EmptySchema (line 10) | @GraphQLSchema("EmptySchema")
class Root (line 16) | @GraphQLObject
Condensed preview — 79 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (179K chars).
[
{
"path": ".gitignore",
"chars": 905,
"preview": "# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm\n\n*.iml\n\n## D"
},
{
"path": ".travis.yml",
"chars": 131,
"preview": "language: java\njdk:\n - oraclejdk8\nbefore_install:\n - chmod +x gradlew \nafter_success:\n - ./gradlew bintrayUpload -x c"
},
{
"path": "LICENSE.md",
"chars": 1097,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2016 Oembedler Inc. and Contributors\n\nPermission is hereby granted, free of charge,"
},
{
"path": "README.md",
"chars": 8198,
"preview": "<!-- START doctoc generated TOC please keep comment here to allow auto update -->\n<!-- DON'T EDIT THIS SECTION, INSTEAD "
},
{
"path": "build.gradle",
"chars": 4717,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "gradle/wrapper/gradle-wrapper.properties",
"chars": 230,
"preview": "#Sun Mar 27 20:34:11 BST 2016\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
},
{
"path": "gradle.properties",
"chars": 1855,
"preview": "#\n# The MIT License (MIT)\n#\n# Copyright (c) 2016 oEmbedler Inc. and Contributors\n#\n# Permission is hereby granted, free "
},
{
"path": "gradlew",
"chars": 4971,
"preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n## Gradle start "
},
{
"path": "gradlew.bat",
"chars": 2314,
"preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
},
{
"path": "graphiql-spring-boot-autoconfigure/LICENSE.md",
"chars": 1097,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2016 Oembedler Inc. and Contributors\n\nPermission is hereby granted, free of charge,"
},
{
"path": "graphiql-spring-boot-autoconfigure/build.gradle",
"chars": 1416,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphiql-spring-boot-autoconfigure/gradle/wrapper/gradle-wrapper.properties",
"chars": 230,
"preview": "#Sun Mar 27 20:34:11 BST 2016\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
},
{
"path": "graphiql-spring-boot-autoconfigure/gradle.properties",
"chars": 1807,
"preview": "#\n# The MIT License (MIT)\n#\n# Copyright (c) 2016 oEmbedler Inc. and Contributors\n#\n# Permission is hereby granted, free "
},
{
"path": "graphiql-spring-boot-autoconfigure/gradlew",
"chars": 4971,
"preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n## Gradle start "
},
{
"path": "graphiql-spring-boot-autoconfigure/gradlew.bat",
"chars": 2314,
"preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
},
{
"path": "graphiql-spring-boot-autoconfigure/settings.gradle",
"chars": 1184,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphiql-spring-boot-autoconfigure/src/main/resources/META-INF/resources/graphiql-config.js",
"chars": 78,
"preview": "(function(f){\n var graphql_server_context = '{{graphql_server_context}}'\n});"
},
{
"path": "graphiql-spring-boot-autoconfigure/src/main/resources/META-INF/resources/index.html",
"chars": 1894,
"preview": "<!DOCTYPE html>\n<html>\n<head>\n <style>body{height:100%;margin:0;width:100%;overflow:hidden}#graphiql{height:100vh}</s"
},
{
"path": "graphiql-spring-boot-starter/LICENSE.md",
"chars": 1097,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2016 Oembedler Inc. and Contributors\n\nPermission is hereby granted, free of charge,"
},
{
"path": "graphiql-spring-boot-starter/build.gradle",
"chars": 1421,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphiql-spring-boot-starter/gradle/wrapper/gradle-wrapper.properties",
"chars": 230,
"preview": "#Sun Mar 27 20:34:11 BST 2016\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
},
{
"path": "graphiql-spring-boot-starter/gradle.properties",
"chars": 1722,
"preview": "#\n# The MIT License (MIT)\n#\n# Copyright (c) 2016 oEmbedler Inc. and Contributors\n#\n# Permission is hereby granted, free "
},
{
"path": "graphiql-spring-boot-starter/gradlew",
"chars": 4971,
"preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n## Gradle start "
},
{
"path": "graphiql-spring-boot-starter/gradlew.bat",
"chars": 2314,
"preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
},
{
"path": "graphiql-spring-boot-starter/settings.gradle",
"chars": 1184,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphql-sample-app/LICENSE.md",
"chars": 1097,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2016 Oembedler Inc. and Contributors\n\nPermission is hereby granted, free of charge,"
},
{
"path": "graphql-sample-app/build.gradle",
"chars": 1921,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphql-sample-app/gradle/wrapper/gradle-wrapper.properties",
"chars": 230,
"preview": "#Sun Mar 27 20:34:11 BST 2016\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
},
{
"path": "graphql-sample-app/gradle.properties",
"chars": 1713,
"preview": "#\n# The MIT License (MIT)\n#\n# Copyright (c) 2016 oEmbedler Inc. and Contributors\n#\n# Permission is hereby granted, free "
},
{
"path": "graphql-sample-app/gradlew",
"chars": 4971,
"preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n## Gradle start "
},
{
"path": "graphql-sample-app/gradlew.bat",
"chars": 2314,
"preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
},
{
"path": "graphql-sample-app/settings.gradle",
"chars": 1184,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/ApplicationBootConfiguration.java",
"chars": 1706,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/SimpleListConnection.java",
"chars": 4023,
"preview": "package com.embedler.moon.graphql.boot.sample;\n\nimport com.oembedler.moon.graphql.engine.relay.ConnectionObjectType;\nimp"
},
{
"path": "graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/TodoSimpleListConnection.java",
"chars": 953,
"preview": "package com.embedler.moon.graphql.boot.sample;\n\nimport com.embedler.moon.graphql.boot.sample.schema.objecttype.TodoObjec"
},
{
"path": "graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/TodoSchema.java",
"chars": 5440,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/objecttype/BaseObjectType.java",
"chars": 2146,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/objecttype/RootObjectType.java",
"chars": 2144,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/objecttype/TodoObjectType.java",
"chars": 2253,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/objecttype/UserObjectType.java",
"chars": 2680,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphql-sample-app/src/main/resources/application.yml",
"chars": 733,
"preview": "spring:\n application:\n name: graphql-todo-app\nserver:\n port: 9000\ngraphql:\n server:\n "
},
{
"path": "graphql-sample-app/src/test/java/com/embedler/moon/graphql/boot/sample/test/GenericTodoSchemaParserTest.java",
"chars": 8414,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphql-spring-boot-autoconfigure/LICENSE.md",
"chars": 1097,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2016 Oembedler Inc. and Contributors\n\nPermission is hereby granted, free of charge,"
},
{
"path": "graphql-spring-boot-autoconfigure/build.gradle",
"chars": 1885,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphql-spring-boot-autoconfigure/gradle/wrapper/gradle-wrapper.properties",
"chars": 230,
"preview": "#Sun Mar 27 20:34:11 BST 2016\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
},
{
"path": "graphql-spring-boot-autoconfigure/gradle.properties",
"chars": 1867,
"preview": "#\n# The MIT License (MIT)\n#\n# Copyright (c) 2016 oEmbedler Inc. and Contributors\n#\n# Permission is hereby granted, free "
},
{
"path": "graphql-spring-boot-autoconfigure/gradlew",
"chars": 4971,
"preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n## Gradle start "
},
{
"path": "graphql-spring-boot-autoconfigure/gradlew.bat",
"chars": 2314,
"preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
},
{
"path": "graphql-spring-boot-autoconfigure/settings.gradle",
"chars": 1184,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/EnableGraphQLServer.java",
"chars": 1550,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/ErrorGraphQLQueryEvaluation.java",
"chars": 619,
"preview": "package com.oembedler.moon.graphql.boot;\n\nimport graphql.ErrorType;\nimport graphql.GraphQLError;\nimport graphql.language"
},
{
"path": "graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/ErrorGraphQLSchemaUndefined.java",
"chars": 622,
"preview": "package com.oembedler.moon.graphql.boot;\n\nimport graphql.ErrorType;\nimport graphql.GraphQLError;\nimport graphql.language"
},
{
"path": "graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/ErrorGraphQLServer.java",
"chars": 700,
"preview": "package com.oembedler.moon.graphql.boot;\n\nimport graphql.ErrorType;\nimport graphql.GraphQLError;\nimport graphql.language"
},
{
"path": "graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GlobalDefaultExceptionHandler.java",
"chars": 1414,
"preview": "package com.oembedler.moon.graphql.boot;\n\nimport com.google.common.collect.Maps;\nimport graphql.ErrorType;\nimport org.sp"
},
{
"path": "graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLAutoConfiguration.java",
"chars": 5505,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLContext.java",
"chars": 999,
"preview": "package com.oembedler.moon.graphql.boot;\n\nimport org.springframework.web.multipart.MultipartFile;\n\nimport javax.servlet."
},
{
"path": "graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLProperties.java",
"chars": 5867,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLSchemaLocator.java",
"chars": 2599,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLServerController.java",
"chars": 11689,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLServerRequest.java",
"chars": 725,
"preview": "package com.oembedler.moon.graphql.boot;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author <a href=\"mailt"
},
{
"path": "graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLServerResult.java",
"chars": 1094,
"preview": "package com.oembedler.moon.graphql.boot;\n\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Map;\n\n/*"
},
{
"path": "graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLWebAutoConfiguration.java",
"chars": 4488,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphql-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories",
"chars": 121,
"preview": "org.springframework.boot.autoconfigure.EnableAutoConfiguration=\\\ncom.oembedler.moon.graphql.boot.GraphQLAutoConfiguratio"
},
{
"path": "graphql-spring-boot-autoconfigure/src/test/java/com/oembedler/moon/graphql/boot/test/GraphQLAutoConfigurationTest.java",
"chars": 2679,
"preview": "package com.oembedler.moon.graphql.boot.test;\n\nimport com.oembedler.moon.graphql.GraphQLSchemaBeanFactory;\nimport com.oe"
},
{
"path": "graphql-spring-boot-autoconfigure/src/test/java/com/oembedler/moon/graphql/boot/test/schema/EmptySchema.java",
"chars": 518,
"preview": "package com.oembedler.moon.graphql.boot.test.schema;\n\nimport com.oembedler.moon.graphql.engine.stereotype.GraphQLObject;"
},
{
"path": "graphql-spring-boot-starter/LICENSE.md",
"chars": 1097,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2015 Oembedler Inc. and Contributors\n\nPermission is hereby granted, free of charge,"
},
{
"path": "graphql-spring-boot-starter/build.gradle",
"chars": 1420,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "graphql-spring-boot-starter/gradle/wrapper/gradle-wrapper.properties",
"chars": 230,
"preview": "#Sun Mar 27 20:34:11 BST 2016\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
},
{
"path": "graphql-spring-boot-starter/gradle.properties",
"chars": 1849,
"preview": "#\n# The MIT License (MIT)\n#\n# Copyright (c) 2016 oEmbedler Inc. and Contributors\n#\n# Permission is hereby granted, free "
},
{
"path": "graphql-spring-boot-starter/gradlew",
"chars": 4971,
"preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n## Gradle start "
},
{
"path": "graphql-spring-boot-starter/gradlew.bat",
"chars": 2314,
"preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
},
{
"path": "graphql-spring-boot-starter/settings.gradle",
"chars": 1184,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
},
{
"path": "settings.gradle",
"chars": 1371,
"preview": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 oEmbedler Inc. and Contributors\n *\n * Permission is hereby granted,"
}
]
// ... and 6 more files (download for full content)
About this extraction
This page contains the full source code of the oembedler/graphql-spring-boot GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 79 files (161.6 KB), approximately 42.1k tokens, and a symbol index with 162 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.