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 ================================================ **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) # GraphQL and GraphiQL Spring Framework Boot Starters [![Build Status](https://travis-ci.org/oembedler/graphql-spring-boot.svg?branch=master)](https://travis-ci.org/oembedler/graphql-spring-boot) GraphQL Starter [ ![Download](https://api.bintray.com/packages/oembedler/maven/graphql-spring-boot-starter/images/download.svg) ](https://bintray.com/oembedler/maven/graphql-spring-boot-starter/_latestVersion) GraphiQL Starter [ ![Download](https://api.bintray.com/packages/oembedler/maven/graphiql-spring-boot-starter/images/download.svg) ](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 false bintray-oembedler-maven bintray http://dl.bintray.com/oembedler/maven ``` Dependency: ```xml com.embedler.moon.graphql.boot graphql-spring-boot-starter INSERT_LATEST_VERSION_HERE com.embedler.moon.graphql.boot graphiql-spring-boot-starter INSERT_LATEST_VERSION_HERE ``` # 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 ================================================
Loading...
================================================ 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 oEmbedler Inc. */ @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 oEmbedler Inc. */ public class SimpleListConnection { private static final String DUMMY_CURSOR_PREFIX = "simple-cursor"; private List data = new ArrayList(); public SimpleListConnection(List data) { this.data = data; } public T createEdgeObject() { return (T) new EdgeObjectType(); } public T createConnectionObject() { return (T) new ConnectionObjectType(); } private List buildEdges() { List 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 get(DataFetchingEnvironment environment) { List edges = buildEdges(); int afterOffset = getOffsetFromCursor(environment.getArgument("after"), -1); int begin = Math.max(afterOffset, -1) + 1; int beforeOffset = getOffsetFromCursor(environment.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.getArgument("first"); Integer last = environment.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 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 oEmbedler Inc. */ public class TodoSimpleListConnection extends SimpleListConnection { private static final String DUMMY_CURSOR_PREFIX = "simple-cursor"; private List data = new ArrayList(); public TodoSimpleListConnection(List data) { super(data); } public T createEdgeObject() { return (T) new TodoObjectType.TodoEdgeObjectType(); } public 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 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 removeCompletedTodos() { List 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 markAllTodos(boolean complete) { List 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 getTodos(List 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 oEmbedler Inc. */ 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 oEmbedler Inc. */ @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 oEmbedler Inc. */ @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 { } @GraphQLObject public static class TodoEdgeObjectType extends EdgeObjectType { } } ================================================ 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 oEmbedler Inc. */ @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 oEmbedler Inc. */ @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 httpEntity = new HttpEntity<>(qlQuery, headers); ResponseEntity 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 httpEntity = new HttpEntity<>(qlQuery, headers); ResponseEntity 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 httpEntity = new HttpEntity<>(qlQuery, headers); ResponseEntity 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 variables = new HashMap<>(); variables.put("test-key", "key-0.9.0"); ResponseEntity 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 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> requestEntity = new HttpEntity<>(map, headers); ResponseEntity 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 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> requestEntity = new HttpEntity<>(map, headers); ResponseEntity 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 oEmbedler Inc. */ @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 oEmbedler Inc. */ public class ErrorGraphQLQueryEvaluation implements GraphQLError { @Override public String getMessage() { return "Error evaluating GraphQL schema"; } @Override public List 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 oEmbedler Inc. */ public class ErrorGraphQLSchemaUndefined implements GraphQLError { @Override public String getMessage() { return "No GraphQL schema definition found"; } @Override public List 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 oEmbedler Inc. */ public class ErrorGraphQLServer implements GraphQLError { private String message; public ErrorGraphQLServer(String message) { this.message = message; } @Override public String getMessage() { return message; } @Override public List 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 oEmbedler Inc. */ @ControllerAdvice public class GlobalDefaultExceptionHandler { public static final String ERROR_MESSAGE = "message"; public static final String ERROR_TYPE = "type"; @ExceptionHandler(Exception.class) public ResponseEntity 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 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 oEmbedler Inc. */ @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 graphQLSchemaHolders = new HashMap<>(); GraphQLSchemaBuilder graphQLSchemaBuilder = graphQLSchemaBuilder(); Set> 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> initialSchemaClassesSet() { // scans the application context for classes annotated with {@link GraphQLSchema} Map 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 oEmbedler Inc. */ public class GraphQLContext extends HashMap { 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 oEmbedler Inc. */ @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 oEmbedler Inc. */ public class GraphQLSchemaLocator { private final Map graphQLSchemaHolders; private final int totalNumberOfSchemas; public GraphQLSchemaLocator(Map 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 oEmbedler Inc. */ @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> 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 result = evaluateAndBuildResponseMap(query, operationName, graphQLContext, decodeIntoMap(variables), graphQLSchemaName); return ResponseEntity.ok(result); } @RequestMapping(method = RequestMethod.POST, consumes = "application/graphql") public ResponseEntity> 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 result = evaluateAndBuildResponseMap(query, operationName, graphQLContext, new HashMap<>(), graphQLSchemaName); return ResponseEntity.ok(result); } @RequestMapping(method = RequestMethod.POST, consumes = "application/json") public ResponseEntity> postJson(@RequestBody Map 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 variables = null; Object variablesObject = body.get(getVariablesKey()); if (variablesObject != null && variablesObject instanceof Map) variables = (Map) variablesObject; final GraphQLContext graphQLContext = new GraphQLContext(); graphQLContext.setHttpRequest(httpServletRequest); final Map result = evaluateAndBuildResponseMap(query, operationName, graphQLContext, variables, graphQLSchemaName); return ResponseEntity.ok(result); } @RequestMapping(method = RequestMethod.POST, consumes = "multipart/form-data") public ResponseEntity> 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 result = evaluateAndBuildResponseMap(query, operationName, graphQLContext, decodeIntoMap(variables), graphQLSchemaName); return ResponseEntity.ok(result); } @RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urlencoded") public ResponseEntity> 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 result = evaluateAndBuildResponseMap(query, operationName, graphQLContext, decodeIntoMap(variables), graphQLSchemaName); return ResponseEntity.ok(result); } private Map decodeIntoMap(final String variablesParam) throws IOException { return objectMapper.readValue(variablesParam, Map.class); } private Map evaluateAndBuildResponseMap(final String query, final String operationName, final GraphQLContext graphQLContext, final Map variables, final String graphQLSchemaName) { final Map 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 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 oEmbedler Inc. */ public class GraphQLServerRequest { private String query; private Map variables = new HashMap<>(); public GraphQLServerRequest() { } public GraphQLServerRequest(String query) { this.query = query; } public GraphQLServerRequest(String query, Map variables) { this.query = query; this.variables = variables; } public String getQuery() { return query; } public Map 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 oEmbedler Inc. */ public class GraphQLServerResult { private List> errors; private Map data; public GraphQLServerResult() { } public GraphQLServerResult(Map data) { this(Collections.EMPTY_LIST, data); } public GraphQLServerResult(List> errors) { this(errors, Collections.EMPTY_MAP); } public GraphQLServerResult(List> errors, Map data) { this.errors = errors; this.data = data; } public List> getErrors() { return errors; } public void setErrors(List> errors) { this.errors = errors; } public Map getData() { return data; } public void setData(Map 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 oEmbedler Inc. */ @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 oEmbedler Inc. */ 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 oEmbedler Inc. */ @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"