├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .travis.yml ├── graphql-sample-app ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── src │ ├── main │ │ ├── resources │ │ │ └── application.yml │ │ └── java │ │ │ └── com │ │ │ └── embedler │ │ │ └── moon │ │ │ └── graphql │ │ │ └── boot │ │ │ └── sample │ │ │ ├── TodoSimpleListConnection.java │ │ │ ├── ApplicationBootConfiguration.java │ │ │ ├── schema │ │ │ ├── objecttype │ │ │ │ ├── BaseObjectType.java │ │ │ │ ├── RootObjectType.java │ │ │ │ ├── TodoObjectType.java │ │ │ │ └── UserObjectType.java │ │ │ └── TodoSchema.java │ │ │ └── SimpleListConnection.java │ └── test │ │ └── java │ │ └── com │ │ └── embedler │ │ └── moon │ │ └── graphql │ │ └── boot │ │ └── sample │ │ └── test │ │ └── GenericTodoSchemaParserTest.java ├── LICENSE.md ├── settings.gradle ├── gradle.properties ├── build.gradle ├── gradlew.bat └── gradlew ├── graphiql-spring-boot-autoconfigure ├── src │ └── main │ │ └── resources │ │ └── META-INF │ │ └── resources │ │ ├── graphiql-config.js │ │ ├── index.html │ │ └── webjars │ │ ├── fetch │ │ └── 0.9.0 │ │ │ └── fetch.min.js │ │ └── graphiql │ │ └── 0.6.6 │ │ └── graphiql.min.css ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── LICENSE.md ├── settings.gradle ├── build.gradle ├── gradle.properties ├── gradlew.bat └── gradlew ├── graphiql-spring-boot-starter ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── LICENSE.md ├── settings.gradle ├── build.gradle ├── gradle.properties ├── gradlew.bat └── gradlew ├── graphql-spring-boot-starter ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── LICENSE.md ├── settings.gradle ├── build.gradle ├── gradle.properties ├── gradlew.bat └── gradlew ├── graphql-spring-boot-autoconfigure ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── src │ ├── main │ │ ├── resources │ │ │ └── META-INF │ │ │ │ └── spring.factories │ │ └── java │ │ │ └── com │ │ │ └── oembedler │ │ │ └── moon │ │ │ └── graphql │ │ │ └── boot │ │ │ ├── ErrorGraphQLQueryEvaluation.java │ │ │ ├── ErrorGraphQLSchemaUndefined.java │ │ │ ├── ErrorGraphQLServer.java │ │ │ ├── GraphQLServerRequest.java │ │ │ ├── GraphQLContext.java │ │ │ ├── GraphQLServerResult.java │ │ │ ├── GlobalDefaultExceptionHandler.java │ │ │ ├── EnableGraphQLServer.java │ │ │ ├── GraphQLSchemaLocator.java │ │ │ ├── GraphQLWebAutoConfiguration.java │ │ │ ├── GraphQLAutoConfiguration.java │ │ │ ├── GraphQLProperties.java │ │ │ └── GraphQLServerController.java │ └── test │ │ └── java │ │ └── com │ │ └── oembedler │ │ └── moon │ │ └── graphql │ │ └── boot │ │ └── test │ │ ├── schema │ │ └── EmptySchema.java │ │ └── GraphQLAutoConfigurationTest.java ├── LICENSE.md ├── settings.gradle ├── build.gradle ├── gradle.properties ├── gradlew.bat └── gradlew ├── LICENSE.md ├── .gitignore ├── settings.gradle ├── gradle.properties ├── gradlew.bat ├── gradlew └── README.md /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandooo/graphql-spring-boot/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - oraclejdk8 4 | before_install: 5 | - chmod +x gradlew 6 | after_success: 7 | - ./gradlew bintrayUpload -x check --info -------------------------------------------------------------------------------- /graphql-sample-app/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandooo/graphql-spring-boot/HEAD/graphql-sample-app/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /graphiql-spring-boot-autoconfigure/src/main/resources/META-INF/resources/graphiql-config.js: -------------------------------------------------------------------------------- 1 | (function(f){ 2 | var graphql_server_context = '{{graphql_server_context}}' 3 | }); -------------------------------------------------------------------------------- /graphiql-spring-boot-starter/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandooo/graphql-spring-boot/HEAD/graphiql-spring-boot-starter/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /graphql-spring-boot-starter/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandooo/graphql-spring-boot/HEAD/graphql-spring-boot-starter/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandooo/graphql-spring-boot/HEAD/graphql-spring-boot-autoconfigure/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /graphiql-spring-boot-autoconfigure/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandooo/graphql-spring-boot/HEAD/graphiql-spring-boot-autoconfigure/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 2 | com.oembedler.moon.graphql.boot.GraphQLAutoConfiguration -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Mar 27 20:34:11 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /graphql-sample-app/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Mar 27 20:34:11 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /graphiql-spring-boot-starter/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Mar 27 20:34:11 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /graphql-spring-boot-starter/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Mar 27 20:34:11 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Mar 27 20:34:11 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /graphiql-spring-boot-autoconfigure/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Mar 27 20:34:11 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip 7 | -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/src/test/java/com/oembedler/moon/graphql/boot/test/schema/EmptySchema.java: -------------------------------------------------------------------------------- 1 | package com.oembedler.moon.graphql.boot.test.schema; 2 | 3 | import com.oembedler.moon.graphql.engine.stereotype.GraphQLObject; 4 | import com.oembedler.moon.graphql.engine.stereotype.GraphQLSchema; 5 | import com.oembedler.moon.graphql.engine.stereotype.GraphQLSchemaQuery; 6 | 7 | /** 8 | * @author oEmbedler Inc. 9 | */ 10 | @GraphQLSchema("EmptySchema") 11 | public class EmptySchema { 12 | 13 | @GraphQLSchemaQuery 14 | private Root root; 15 | 16 | @GraphQLObject 17 | public static class Root { 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/ErrorGraphQLQueryEvaluation.java: -------------------------------------------------------------------------------- 1 | package com.oembedler.moon.graphql.boot; 2 | 3 | import graphql.ErrorType; 4 | import graphql.GraphQLError; 5 | import graphql.language.SourceLocation; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @author oEmbedler Inc. 11 | */ 12 | public class ErrorGraphQLQueryEvaluation implements GraphQLError { 13 | 14 | @Override 15 | public String getMessage() { 16 | return "Error evaluating GraphQL schema"; 17 | } 18 | 19 | @Override 20 | public List getLocations() { 21 | return null; 22 | } 23 | 24 | @Override 25 | public ErrorType getErrorType() { 26 | return ErrorType.ValidationError; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/ErrorGraphQLSchemaUndefined.java: -------------------------------------------------------------------------------- 1 | package com.oembedler.moon.graphql.boot; 2 | 3 | import graphql.ErrorType; 4 | import graphql.GraphQLError; 5 | import graphql.language.SourceLocation; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @author oEmbedler Inc. 11 | */ 12 | public class ErrorGraphQLSchemaUndefined implements GraphQLError { 13 | 14 | @Override 15 | public String getMessage() { 16 | return "No GraphQL schema definition found"; 17 | } 18 | 19 | @Override 20 | public List getLocations() { 21 | return null; 22 | } 23 | 24 | @Override 25 | public ErrorType getErrorType() { 26 | return ErrorType.ValidationError; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /graphql-sample-app/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: graphql-todo-app 4 | server: 5 | port: 9000 6 | graphql: 7 | server: 8 | mapping: /graphql 9 | corsEnabled: true 10 | suppressSpringResponseCodes: true 11 | query-key: query 12 | variables-key: variables 13 | uploadMaxFileSize: 128KB 14 | uploadMaxRequestSize: 128KB 15 | schema: 16 | clientMutationIdName: clientMutationId 17 | injectClientMutationId: true 18 | allowEmptyClientMutationId: false 19 | mutationInputArgumentName: input 20 | outputObjectNamePrefix: Payload 21 | inputObjectNamePrefix: Input 22 | schemaMutationObjectName: Mutation 23 | -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/ErrorGraphQLServer.java: -------------------------------------------------------------------------------- 1 | package com.oembedler.moon.graphql.boot; 2 | 3 | import graphql.ErrorType; 4 | import graphql.GraphQLError; 5 | import graphql.language.SourceLocation; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @author oEmbedler Inc. 11 | */ 12 | public class ErrorGraphQLServer implements GraphQLError { 13 | 14 | private String message; 15 | 16 | public ErrorGraphQLServer(String message) { 17 | this.message = message; 18 | } 19 | 20 | @Override 21 | public String getMessage() { 22 | return message; 23 | } 24 | 25 | @Override 26 | public List getLocations() { 27 | return null; 28 | } 29 | 30 | @Override 31 | public ErrorType getErrorType() { 32 | return ErrorType.ValidationError; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLServerRequest.java: -------------------------------------------------------------------------------- 1 | package com.oembedler.moon.graphql.boot; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * @author oEmbedler Inc. 8 | */ 9 | public class GraphQLServerRequest { 10 | private String query; 11 | private Map variables = new HashMap<>(); 12 | 13 | public GraphQLServerRequest() { 14 | } 15 | 16 | public GraphQLServerRequest(String query) { 17 | this.query = query; 18 | } 19 | 20 | public GraphQLServerRequest(String query, Map variables) { 21 | this.query = query; 22 | this.variables = variables; 23 | } 24 | 25 | public String getQuery() { 26 | return query; 27 | } 28 | 29 | public Map getVariables() { 30 | return variables; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Oembedler Inc. and Contributors 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 2 | 3 | *.iml 4 | 5 | ## Directory-based project format: 6 | .idea/ 7 | # if you remove the above rule, at least ignore the following: 8 | 9 | # User-specific stuff: 10 | # .idea/workspace.xml 11 | # .idea/tasks.xml 12 | # .idea/dictionaries 13 | # .idea/shelf 14 | 15 | # Sensitive or high-churn files: 16 | # .idea/dataSources.ids 17 | # .idea/dataSources.xml 18 | # .idea/sqlDataSources.xml 19 | # .idea/dynamic.xml 20 | # .idea/uiDesigner.xml 21 | 22 | # Gradle: 23 | # .idea/gradle.xml 24 | # .idea/libraries 25 | 26 | # Mongo Explorer plugin: 27 | # .idea/mongoSettings.xml 28 | 29 | ## File-based project format: 30 | *.ipr 31 | *.iws 32 | 33 | ## Plugin-specific files: 34 | 35 | # IntelliJ 36 | /out/ 37 | 38 | # mpeltonen/sbt-idea plugin 39 | .idea_modules/ 40 | 41 | # JIRA plugin 42 | atlassian-ide-plugin.xml 43 | 44 | # Crashlytics plugin (for Android Studio and IntelliJ) 45 | com_crashlytics_export_strings.xml 46 | crashlytics.properties 47 | crashlytics-build.properties 48 | fabric.properties 49 | -------------------------------------------------------------------------------- /graphql-sample-app/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Oembedler Inc. and Contributors 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. -------------------------------------------------------------------------------- /graphiql-spring-boot-starter/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Oembedler Inc. and Contributors 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. -------------------------------------------------------------------------------- /graphql-spring-boot-starter/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Oembedler Inc. and Contributors 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Oembedler Inc. and Contributors 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. -------------------------------------------------------------------------------- /graphiql-spring-boot-autoconfigure/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Oembedler Inc. and Contributors 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. -------------------------------------------------------------------------------- /graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/TodoSimpleListConnection.java: -------------------------------------------------------------------------------- 1 | package com.embedler.moon.graphql.boot.sample; 2 | 3 | import com.embedler.moon.graphql.boot.sample.schema.objecttype.TodoObjectType; 4 | import com.oembedler.moon.graphql.engine.relay.ConnectionObjectType; 5 | import com.oembedler.moon.graphql.engine.relay.EdgeObjectType; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | /** 11 | * @author oEmbedler Inc. 12 | */ 13 | public class TodoSimpleListConnection extends SimpleListConnection { 14 | 15 | private static final String DUMMY_CURSOR_PREFIX = "simple-cursor"; 16 | private List data = new ArrayList(); 17 | 18 | public TodoSimpleListConnection(List data) { 19 | super(data); 20 | } 21 | 22 | public T createEdgeObject() { 23 | return (T) new TodoObjectType.TodoEdgeObjectType(); 24 | } 25 | 26 | public T createConnectionObject() { 27 | return (T) new TodoObjectType.TodoConnectionObjectType(); 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLContext.java: -------------------------------------------------------------------------------- 1 | package com.oembedler.moon.graphql.boot; 2 | 3 | import org.springframework.web.multipart.MultipartFile; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import java.util.HashMap; 7 | 8 | /** 9 | * @author oEmbedler Inc. 10 | */ 11 | public class GraphQLContext extends HashMap { 12 | 13 | public static final String KEY_FILE_UPLOAD = "file"; 14 | public static final String KEY_HTTP_REQUEST = "http-request"; 15 | 16 | public HttpServletRequest setHttpRequest(final HttpServletRequest request) { 17 | this.put(KEY_HTTP_REQUEST, request); 18 | return getHttpRequest(); 19 | } 20 | 21 | public MultipartFile setUploadedFile(final MultipartFile file) { 22 | this.put(KEY_FILE_UPLOAD, file); 23 | return getUploadedFile(); 24 | } 25 | 26 | public MultipartFile getUploadedFile() { 27 | return (MultipartFile) this.get(KEY_FILE_UPLOAD); 28 | } 29 | 30 | public HttpServletRequest getHttpRequest() { 31 | return (HttpServletRequest) this.get(KEY_HTTP_REQUEST); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /graphql-sample-app/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | 20 | rootProject.name = PROJECT_NAME -------------------------------------------------------------------------------- /graphql-spring-boot-starter/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | 20 | rootProject.name = PROJECT_NAME -------------------------------------------------------------------------------- /graphiql-spring-boot-starter/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | 20 | rootProject.name = PROJECT_NAME -------------------------------------------------------------------------------- /graphiql-spring-boot-autoconfigure/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | 20 | rootProject.name = PROJECT_NAME -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | 20 | rootProject.name = PROJECT_NAME -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLServerResult.java: -------------------------------------------------------------------------------- 1 | package com.oembedler.moon.graphql.boot; 2 | 3 | import java.util.Collections; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | /** 8 | * @author oEmbedler Inc. 9 | */ 10 | public class GraphQLServerResult { 11 | private List> errors; 12 | private Map data; 13 | 14 | public GraphQLServerResult() { 15 | } 16 | 17 | public GraphQLServerResult(Map data) { 18 | this(Collections.EMPTY_LIST, data); 19 | } 20 | 21 | public GraphQLServerResult(List> errors) { 22 | this(errors, Collections.EMPTY_MAP); 23 | } 24 | 25 | public GraphQLServerResult(List> errors, Map data) { 26 | this.errors = errors; 27 | this.data = data; 28 | } 29 | 30 | public List> getErrors() { 31 | return errors; 32 | } 33 | 34 | public void setErrors(List> errors) { 35 | this.errors = errors; 36 | } 37 | 38 | public Map getData() { 39 | return data; 40 | } 41 | 42 | public void setData(Map data) { 43 | this.data = data; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | 20 | rootProject.name = PROJECT_NAME 21 | 22 | include ":graphql-spring-boot-autoconfigure", ":graphql-spring-boot-starter" 23 | include ":graphiql-spring-boot-autoconfigure", ":graphiql-spring-boot-starter" 24 | include ":graphql-sample-app" -------------------------------------------------------------------------------- /graphiql-spring-boot-starter/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | buildscript { 20 | repositories { 21 | maven { url "https://plugins.gradle.org/m2/" } 22 | } 23 | dependencies { 24 | classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6" 25 | } 26 | } 27 | 28 | dependencies { 29 | compile(project(':graphiql-spring-boot-autoconfigure')) 30 | } -------------------------------------------------------------------------------- /graphql-spring-boot-starter/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | buildscript { 20 | repositories { 21 | maven { url "https://plugins.gradle.org/m2/" } 22 | } 23 | dependencies { 24 | classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6" 25 | } 26 | } 27 | 28 | dependencies { 29 | compile(project(':graphql-spring-boot-autoconfigure')) 30 | } -------------------------------------------------------------------------------- /graphiql-spring-boot-autoconfigure/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | buildscript { 20 | repositories { 21 | maven { url "https://plugins.gradle.org/m2/" } 22 | } 23 | dependencies { 24 | classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6" 25 | } 26 | } 27 | 28 | dependencies{ 29 | compile "org.webjars:react:$LIB_WEBJARS_REACT_VER" 30 | } 31 | -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GlobalDefaultExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.oembedler.moon.graphql.boot; 2 | 3 | import com.google.common.collect.Maps; 4 | import graphql.ErrorType; 5 | import org.springframework.core.annotation.AnnotationUtils; 6 | import org.springframework.http.ResponseEntity; 7 | import org.springframework.web.bind.annotation.ControllerAdvice; 8 | import org.springframework.web.bind.annotation.ExceptionHandler; 9 | import org.springframework.web.bind.annotation.ResponseStatus; 10 | 11 | import javax.servlet.http.HttpServletRequest; 12 | import java.util.Arrays; 13 | import java.util.Map; 14 | 15 | /** 16 | * @author oEmbedler Inc. 17 | */ 18 | @ControllerAdvice 19 | public class GlobalDefaultExceptionHandler { 20 | 21 | public static final String ERROR_MESSAGE = "message"; 22 | public static final String ERROR_TYPE = "type"; 23 | 24 | @ExceptionHandler(Exception.class) 25 | public ResponseEntity defaultErrorHandler(HttpServletRequest req, Exception e) throws Exception { 26 | // if the exception is annotated with @ResponseStatus rethrow it and let the framework handle it 27 | if (AnnotationUtils.findAnnotation(e.getClass(), ResponseStatus.class) != null) { 28 | throw e; 29 | } 30 | 31 | Map map = Maps.newHashMap(); 32 | map.put(ERROR_MESSAGE, e.getMessage()); 33 | map.put(ERROR_TYPE, ErrorType.ValidationError.toString()); 34 | 35 | return ResponseEntity.ok(new GraphQLServerResult(Arrays.asList(map))); 36 | } 37 | } -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/EnableGraphQLServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | 20 | package com.oembedler.moon.graphql.boot; 21 | 22 | import org.springframework.context.annotation.Import; 23 | 24 | import java.lang.annotation.*; 25 | 26 | /** 27 | * @author oEmbedler Inc. 28 | */ 29 | @Retention(value = RetentionPolicy.RUNTIME) 30 | @Target(value = {ElementType.TYPE}) 31 | @Documented 32 | @Import(GraphQLWebAutoConfiguration.class) 33 | public @interface EnableGraphQLServer { 34 | } -------------------------------------------------------------------------------- /graphql-sample-app/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | # documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | # persons to whom the Software is furnished to do so, subject to the following conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | # BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | # 19 | 20 | PROJECT_VERSION = 2.1.0 21 | PROJECT_GROUP = com.embedler.moon.graphql.boot.sample 22 | PROJECT_NAME = graphql-sample-app 23 | PROJECT_DESC = GraphQL Spring Framework Boot Sample App 24 | PROJECT_GIT_REPO_URL = https://github.com/oembedler/graphql-spring-boot 25 | PROJECT_LICENSE = MIT 26 | PROJECT_LICENSE_URL = https://github.com/oembedler/spring-boot-graphql/blob/master/LICENSE.md 27 | PROJECT_DEV_ID = oembedler 28 | PROJECT_DEV_NAME = Embedler Inc. 29 | 30 | VCS=Git 31 | 32 | ### 33 | 34 | SOURCE_COMPATIBILITY = 1.8 35 | TARGET_COMPATIBILITY = 1.8 36 | 37 | ### 38 | 39 | GRADLE_WRAPPER_VER = 2.9 40 | 41 | ### 42 | 43 | org.gradle.daemon=true 44 | 45 | bintray.user=USER 46 | bintray.key=KEY -------------------------------------------------------------------------------- /graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/ApplicationBootConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | 20 | package com.embedler.moon.graphql.boot.sample; 21 | 22 | import com.oembedler.moon.graphql.boot.EnableGraphQLServer; 23 | import org.springframework.boot.SpringApplication; 24 | import org.springframework.boot.autoconfigure.SpringBootApplication; 25 | 26 | /** 27 | * @author oEmbedler Inc. 28 | */ 29 | @SpringBootApplication 30 | @EnableGraphQLServer 31 | public class ApplicationBootConfiguration { 32 | 33 | public static void main(String[] args) throws Exception { 34 | SpringApplication.run(ApplicationBootConfiguration.class, args); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /graphiql-spring-boot-starter/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | # documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | # persons to whom the Software is furnished to do so, subject to the following conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | # BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | # 19 | 20 | PROJECT_VERSION = 2.1.0 21 | PROJECT_GROUP = com.embedler.moon.graphql.boot.starter 22 | PROJECT_NAME = graphiql-spring-boot-starter 23 | PROJECT_DESC = GraphiQL Spring Framework Boot Starter 24 | PROJECT_GIT_REPO_URL = https://github.com/oembedler/graphql-spring-boot 25 | PROJECT_LICENSE = MIT 26 | PROJECT_LICENSE_URL = https://github.com/oembedler/spring-boot-graphql/blob/master/LICENSE.md 27 | PROJECT_DEV_ID = oembedler 28 | PROJECT_DEV_NAME = Embedler Inc. 29 | 30 | VCS=Git 31 | 32 | ### 33 | 34 | SOURCE_COMPATIBILITY = 1.8 35 | TARGET_COMPATIBILITY = 1.8 36 | 37 | ### 38 | 39 | GRADLE_WRAPPER_VER = 2.9 40 | 41 | ### 42 | 43 | org.gradle.daemon=true 44 | 45 | bintray.user=USER 46 | bintray.key=KEY -------------------------------------------------------------------------------- /graphiql-spring-boot-autoconfigure/src/main/resources/META-INF/resources/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
Loading...
13 | 14 | 15 | -------------------------------------------------------------------------------- /graphiql-spring-boot-autoconfigure/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | # documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | # persons to whom the Software is furnished to do so, subject to the following conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | # BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | # 19 | 20 | PROJECT_VERSION = 2.1.0 21 | PROJECT_GROUP = com.embedler.moon.graphql.boot.autoconfigure 22 | PROJECT_NAME = graphiql-spring-boot-autoconfigure 23 | PROJECT_DESC = GraphiQL Spring Framework Boot Autoconfigure 24 | PROJECT_GIT_REPO_URL = https://github.com/oembedler/graphql-spring-boot 25 | PROJECT_LICENSE = MIT 26 | PROJECT_LICENSE_URL = https://github.com/oembedler/spring-boot-graphql/blob/master/LICENSE.md 27 | PROJECT_DEV_ID = oembedler 28 | PROJECT_DEV_NAME = Embedler Inc. 29 | 30 | VCS=Git 31 | 32 | ### 33 | 34 | SOURCE_COMPATIBILITY = 1.8 35 | TARGET_COMPATIBILITY = 1.8 36 | 37 | ### 38 | 39 | LIB_WEBJARS_GRAPHIQL_VER = 0.3.1-1 40 | LIB_WEBJARS_REACT_VER = 0.14.7 41 | 42 | GRADLE_WRAPPER_VER = 2.9 43 | 44 | ### 45 | 46 | org.gradle.daemon=true 47 | 48 | bintray.user=USER 49 | bintray.key=KEY -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | 20 | buildscript { 21 | repositories { 22 | maven { url "https://plugins.gradle.org/m2/" } 23 | } 24 | dependencies { 25 | classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6" 26 | } 27 | } 28 | 29 | 30 | dependencies { 31 | compile "com.embedler.moon.graphql:spring-graphql-common:$LIB_SPRING_GRAPHQL_COMMON_VER" 32 | compile "org.springframework.boot:spring-boot-configuration-processor:$LIB_SPRING_BOOT_VER" 33 | compile "org.springframework.boot:spring-boot-autoconfigure:$LIB_SPRING_BOOT_VER" 34 | provided "org.springframework.boot:spring-boot-starter-web:$LIB_SPRING_BOOT_VER" 35 | provided "commons-fileupload:commons-fileupload:$LIB_COMMON_UPLOAD" 36 | 37 | testCompile "org.springframework.boot:spring-boot-starter-test:$LIB_SPRING_BOOT_VER" 38 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | # documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | # persons to whom the Software is furnished to do so, subject to the following conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | # BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | # 19 | 20 | PROJECT_VERSION = 2.1.0 21 | PROJECT_GROUP = com.embedler.moon.graphql.boot 22 | PROJECT_NAME = spring-boot-graphql 23 | PROJECT_DESC = GraphQL Spring Framework Boot 24 | PROJECT_GIT_REPO_URL = https://github.com/oembedler/graphql-spring-boot 25 | PROJECT_LICENSE = MIT 26 | PROJECT_LICENSE_URL = https://github.com/oembedler/spring-boot-graphql/blob/master/LICENSE.md 27 | PROJECT_DEV_ID = oembedler 28 | PROJECT_DEV_NAME = Embedler Inc. 29 | 30 | VCS=Git 31 | 32 | ### 33 | 34 | SOURCE_COMPATIBILITY = 1.8 35 | TARGET_COMPATIBILITY = 1.8 36 | 37 | ### 38 | 39 | LIB_SPRING_GRAPHQL_COMMON_VER = 2.1.+ 40 | LIB_JUNIT_VER = 4.12 41 | LIB_SPRING_CORE_VER = 4.2.4.RELEASE 42 | LIB_SPRING_BOOT_VER = 1.3.3.RELEASE 43 | LIB_COMMON_UPLOAD = 1.3.1 44 | 45 | GRADLE_WRAPPER_VER = 2.9 46 | 47 | ### 48 | 49 | org.gradle.daemon=true 50 | 51 | bintray.user=USER 52 | bintray.key=KEY 53 | -------------------------------------------------------------------------------- /graphql-spring-boot-starter/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | # documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | # persons to whom the Software is furnished to do so, subject to the following conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | # BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | # 19 | 20 | PROJECT_VERSION = 2.1.0 21 | PROJECT_GROUP = com.embedler.moon.graphql.boot.starter 22 | PROJECT_NAME = graphql-spring-boot-starter 23 | PROJECT_DESC = GraphQL Spring Framework Boot Starter 24 | PROJECT_GIT_REPO_URL = https://github.com/oembedler/graphql-spring-boot 25 | PROJECT_LICENSE = MIT 26 | PROJECT_LICENSE_URL = https://github.com/oembedler/spring-boot-graphql/blob/master/LICENSE.md 27 | PROJECT_DEV_ID = oembedler 28 | PROJECT_DEV_NAME = Embedler Inc. 29 | 30 | VCS=Git 31 | 32 | ### 33 | 34 | SOURCE_COMPATIBILITY = 1.8 35 | TARGET_COMPATIBILITY = 1.8 36 | 37 | ### 38 | 39 | LIB_SPRING_GRAPHQL_COMMON_VER = 2+ 40 | LIB_JUNIT_VER = 4.12 41 | LIB_SPRING_CORE_VER = 4.2.4.RELEASE 42 | LIB_SPRING_BOOT_VER = 1.3.2.RELEASE 43 | 44 | GRADLE_WRAPPER_VER = 2.9 45 | 46 | ### 47 | 48 | org.gradle.daemon=true 49 | 50 | bintray.user=USER 51 | bintray.key=KEY -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | # documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | # persons to whom the Software is furnished to do so, subject to the following conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | # BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | # 19 | 20 | PROJECT_VERSION = 2.1.0 21 | PROJECT_GROUP = com.embedler.moon.graphql.boot.autoconfigure 22 | PROJECT_NAME = graphql-spring-boot-autoconfigure 23 | PROJECT_DESC = GraphQL Spring Framework Boot Autoconfigure 24 | PROJECT_GIT_REPO_URL = https://github.com/oembedler/graphql-spring-boot 25 | PROJECT_LICENSE = MIT 26 | PROJECT_LICENSE_URL = https://github.com/oembedler/spring-boot-graphql/blob/master/LICENSE.md 27 | PROJECT_DEV_ID = oembedler 28 | PROJECT_DEV_NAME = Embedler Inc. 29 | 30 | VCS=Git 31 | 32 | ### 33 | 34 | SOURCE_COMPATIBILITY = 1.8 35 | TARGET_COMPATIBILITY = 1.8 36 | 37 | ### 38 | 39 | LIB_SPRING_GRAPHQL_COMMON_VER = 2+ 40 | LIB_JUNIT_VER = 4.12 41 | LIB_SPRING_CORE_VER = 4.2.4.RELEASE 42 | LIB_SPRING_BOOT_VER = 1.3.2.RELEASE 43 | 44 | GRADLE_WRAPPER_VER = 2.9 45 | 46 | ### 47 | 48 | org.gradle.daemon=true 49 | 50 | bintray.user=USER 51 | bintray.key=KEY -------------------------------------------------------------------------------- /graphql-sample-app/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | buildscript { 20 | repositories { 21 | maven { url "https://plugins.gradle.org/m2/" } 22 | maven { url 'http://repo.spring.io/plugins-release' } 23 | } 24 | dependencies { 25 | classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.3.RELEASE") 26 | classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6" 27 | } 28 | } 29 | 30 | apply plugin: 'java' 31 | apply plugin: 'war' 32 | apply plugin: 'spring-boot' 33 | 34 | repositories { 35 | jcenter() 36 | } 37 | 38 | dependencies{ 39 | compile(project(":graphql-spring-boot-starter")) 40 | compile(project(":graphiql-spring-boot-starter")) 41 | 42 | compile("org.springframework.boot:spring-boot-starter-web") 43 | compile("org.springframework.boot:spring-boot-starter-actuator") 44 | 45 | testCompile("org.springframework.boot:spring-boot-starter-test") 46 | } -------------------------------------------------------------------------------- /graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/objecttype/BaseObjectType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | 20 | package com.embedler.moon.graphql.boot.sample.schema.objecttype; 21 | 22 | import com.oembedler.moon.graphql.engine.relay.RelayNode; 23 | import com.oembedler.moon.graphql.engine.stereotype.GraphQLDescription; 24 | import com.oembedler.moon.graphql.engine.stereotype.GraphQLID; 25 | import com.oembedler.moon.graphql.engine.stereotype.GraphQLIgnore; 26 | import com.oembedler.moon.graphql.engine.stereotype.GraphQLNonNull; 27 | import graphql.relay.Relay; 28 | 29 | /** 30 | * @author oEmbedler Inc. 31 | */ 32 | public class BaseObjectType implements RelayNode { 33 | 34 | @GraphQLIgnore 35 | private String id; 36 | 37 | @GraphQLID("id") 38 | @GraphQLNonNull 39 | @GraphQLDescription("Global object unique identifier") 40 | public String getId(RelayNode relayNode) { 41 | BaseObjectType baseObjectType = (BaseObjectType) relayNode; 42 | return new Relay().toGlobalId(relayNode.getClass().getSimpleName(), baseObjectType.id); 43 | } 44 | 45 | public void setId(String id) { 46 | this.id = id; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/objecttype/RootObjectType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | 20 | package com.embedler.moon.graphql.boot.sample.schema.objecttype; 21 | 22 | import com.embedler.moon.graphql.boot.sample.schema.TodoSchema; 23 | import com.oembedler.moon.graphql.boot.GraphQLContext; 24 | import com.oembedler.moon.graphql.engine.relay.RelayNode; 25 | import com.oembedler.moon.graphql.engine.stereotype.*; 26 | import org.springframework.beans.factory.annotation.Autowired; 27 | 28 | /** 29 | * @author oEmbedler Inc. 30 | */ 31 | @GraphQLObject("Root") 32 | public class RootObjectType { 33 | 34 | @GraphQLNonNull 35 | @GraphQLField("version") 36 | @GraphQLDescription("Root query version number") 37 | public static final String VERSION = "0.9.0.2"; 38 | 39 | @Autowired 40 | @GraphQLIgnore 41 | private TodoSchema todoSchema; 42 | 43 | @GraphQLField 44 | public UserObjectType viewer() { 45 | return todoSchema.getTheOnlyUser(); 46 | } 47 | 48 | @GraphQLField 49 | public RelayNode node(@GraphQLID @GraphQLNonNull @GraphQLIn("id") final String id) { 50 | return new UserObjectType(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/objecttype/TodoObjectType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | 20 | package com.embedler.moon.graphql.boot.sample.schema.objecttype; 21 | 22 | import com.oembedler.moon.graphql.engine.relay.ConnectionObjectType; 23 | import com.oembedler.moon.graphql.engine.relay.EdgeObjectType; 24 | import com.oembedler.moon.graphql.engine.relay.PageInfoObjectType; 25 | import com.oembedler.moon.graphql.engine.stereotype.GraphQLObject; 26 | 27 | /** 28 | * @author oEmbedler Inc. 29 | */ 30 | @GraphQLObject("Todo") 31 | public class TodoObjectType extends BaseObjectType { 32 | private String text; 33 | private boolean complete; 34 | 35 | public String getText() { 36 | return text; 37 | } 38 | 39 | public void setText(String text) { 40 | this.text = text; 41 | } 42 | 43 | public boolean isComplete() { 44 | return complete; 45 | } 46 | 47 | public void setComplete(boolean complete) { 48 | this.complete = complete; 49 | } 50 | 51 | @GraphQLObject 52 | public static class TodoConnectionObjectType extends ConnectionObjectType { 53 | } 54 | 55 | @GraphQLObject 56 | public static class TodoEdgeObjectType extends EdgeObjectType { 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /graphql-sample-app/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /graphiql-spring-boot-starter/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /graphql-spring-boot-starter/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /graphiql-spring-boot-autoconfigure/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLSchemaLocator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | 20 | package com.oembedler.moon.graphql.boot; 21 | 22 | import com.google.common.collect.Maps; 23 | import com.oembedler.moon.graphql.engine.GraphQLSchemaHolder; 24 | import graphql.Assert; 25 | 26 | import java.util.Map; 27 | 28 | /** 29 | * @author oEmbedler Inc. 30 | */ 31 | public class GraphQLSchemaLocator { 32 | 33 | private final Map graphQLSchemaHolders; 34 | private final int totalNumberOfSchemas; 35 | 36 | public GraphQLSchemaLocator(Map graphQLSchemaHolders) { 37 | this.graphQLSchemaHolders = Maps.newHashMap(); 38 | this.graphQLSchemaHolders.putAll(graphQLSchemaHolders); 39 | this.totalNumberOfSchemas = this.graphQLSchemaHolders.size(); 40 | } 41 | 42 | public GraphQLSchemaHolder getGraphQLSchemaHolder(final String schemaName) { 43 | Assert.assertNotNull(schemaName, "Schema name can not be null"); 44 | return graphQLSchemaHolders.get(schemaName); 45 | } 46 | 47 | public GraphQLSchemaHolder getSingleSchema() { 48 | return getTotalNumberOfSchemas() == 1 ? 49 | graphQLSchemaHolders.get(graphQLSchemaHolders.keySet().iterator().next()) : 50 | null; 51 | } 52 | 53 | public int getTotalNumberOfSchemas() { 54 | return totalNumberOfSchemas; 55 | } 56 | 57 | public boolean containsSchema(final String schemaName) { 58 | Assert.assertNotNull(schemaName, "Schema name can not be null"); 59 | return graphQLSchemaHolders.containsKey(schemaName); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/objecttype/UserObjectType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | 20 | package com.embedler.moon.graphql.boot.sample.schema.objecttype; 21 | 22 | import com.embedler.moon.graphql.boot.sample.schema.TodoSchema; 23 | import com.oembedler.moon.graphql.engine.stereotype.GraphQLField; 24 | import com.oembedler.moon.graphql.engine.stereotype.GraphQLIgnore; 25 | import com.oembedler.moon.graphql.engine.stereotype.GraphQLIn; 26 | import com.oembedler.moon.graphql.engine.stereotype.GraphQLObject; 27 | import graphql.schema.DataFetchingEnvironment; 28 | import org.springframework.beans.factory.annotation.Autowired; 29 | 30 | /** 31 | * @author oEmbedler Inc. 32 | */ 33 | @GraphQLObject("User") 34 | public class UserObjectType extends BaseObjectType { 35 | 36 | @Autowired 37 | @GraphQLIgnore 38 | private TodoSchema todoSchema; 39 | 40 | private String name = "someId"; 41 | 42 | public String getName() { 43 | return name; 44 | } 45 | 46 | public void setName(String name) { 47 | this.name = name; 48 | } 49 | 50 | @GraphQLField 51 | public TodoObjectType.TodoConnectionObjectType todos(@GraphQLIn("before") String before, 52 | @GraphQLIn("after") String after, 53 | @GraphQLIn(value = "first", defaultSpel = "1") Integer first, 54 | @GraphQLIn(value = "last", defaultProvider = "1") Integer last, 55 | DataFetchingEnvironment environment) { 56 | return todoSchema.getSimpleConnectionTodo().get(environment); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/src/test/java/com/oembedler/moon/graphql/boot/test/GraphQLAutoConfigurationTest.java: -------------------------------------------------------------------------------- 1 | package com.oembedler.moon.graphql.boot.test; 2 | 3 | import com.oembedler.moon.graphql.GraphQLSchemaBeanFactory; 4 | import com.oembedler.moon.graphql.boot.GraphQLAutoConfiguration; 5 | import com.oembedler.moon.graphql.boot.GraphQLSchemaLocator; 6 | import com.oembedler.moon.graphql.engine.GraphQLSchemaBuilder; 7 | import com.oembedler.moon.graphql.engine.GraphQLSchemaConfig; 8 | import org.junit.After; 9 | import org.junit.Assert; 10 | import org.junit.Test; 11 | import org.springframework.boot.test.EnvironmentTestUtils; 12 | import org.springframework.context.annotation.AnnotationConfigApplicationContext; 13 | import org.springframework.context.annotation.ComponentScan; 14 | import org.springframework.context.annotation.Configuration; 15 | 16 | /** 17 | * @author oEmbedler Inc. 18 | */ 19 | public class GraphQLAutoConfigurationTest { 20 | 21 | private static final String BASE_PACKAGE = "com.oembedler.moon.graphql.boot.test"; 22 | private AnnotationConfigApplicationContext context; 23 | 24 | @After 25 | public void tearDown() { 26 | if (this.context != null) { 27 | this.context.close(); 28 | } 29 | } 30 | 31 | @Test 32 | public void defaultSettingsLoad() { 33 | load(EmptyConfiguration.class, ""); 34 | GraphQLSchemaBeanFactory graphQLSchemaBeanFactory = this.context.getBean(GraphQLSchemaBeanFactory.class); 35 | GraphQLSchemaConfig graphQLSchemaConfig = this.context.getBean(GraphQLSchemaConfig.class); 36 | GraphQLSchemaBuilder graphQLSchemaBuilder = this.context.getBean(GraphQLSchemaBuilder.class); 37 | GraphQLSchemaLocator graphQLSchemaLocator = this.context.getBean(GraphQLSchemaLocator.class); 38 | 39 | Assert.assertTrue(graphQLSchemaBeanFactory.containsBean(GraphQLSchemaBeanFactory.class)); 40 | Assert.assertEquals(graphQLSchemaBeanFactory, graphQLSchemaBeanFactory.getBeanByType(GraphQLSchemaBeanFactory.class)); 41 | Assert.assertEquals(graphQLSchemaBeanFactory, graphQLSchemaBuilder.getGraphQLSchemaBeanFactory()); 42 | Assert.assertEquals(graphQLSchemaConfig, graphQLSchemaBuilder.getGraphQLSchemaConfig()); 43 | Assert.assertEquals(1, graphQLSchemaLocator.getTotalNumberOfSchemas()); 44 | } 45 | 46 | private void load(Class config, String... environment) { 47 | AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(); 48 | EnvironmentTestUtils.addEnvironment(applicationContext, environment); 49 | applicationContext.register(config); 50 | applicationContext.register(GraphQLAutoConfiguration.class); 51 | applicationContext.refresh(); 52 | this.context = applicationContext; 53 | } 54 | 55 | @Configuration 56 | @ComponentScan(BASE_PACKAGE) 57 | static class EmptyConfiguration { 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /graphiql-spring-boot-autoconfigure/src/main/resources/META-INF/resources/webjars/fetch/0.9.0/fetch.min.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";function t(t){if("string"!=typeof t&&(t=t.toString()),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function e(t){return"string"!=typeof t&&(t=t.toString()),t}function r(t){this.map={},t instanceof r?t.forEach(function(t,e){this.append(e,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function o(t){return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function n(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function s(t){var e=new FileReader;return e.readAsArrayBuffer(t),n(e)}function i(t){var e=new FileReader;return e.readAsText(t),n(e)}function a(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,"string"==typeof t)this._bodyText=t;else if(p.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(p.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else{if(t)throw new Error("unsupported BodyInit type");this._bodyText=""}},p.blob?(this.blob=function(){var t=o(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(s)},this.text=function(){var t=o(this);if(t)return t;if(this._bodyBlob)return i(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var t=o(this);return t?t:Promise.resolve(this._bodyText)},p.formData&&(this.formData=function(){return this.text().then(h)}),this.json=function(){return this.text().then(JSON.parse)},this}function u(t){var e=t.toUpperCase();return c.indexOf(e)>-1?e:t}function f(t,e){if(e=e||{},this.url=t,this.credentials=e.credentials||"omit",this.headers=new r(e.headers),this.method=u(e.method||"GET"),this.mode=e.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&e.body)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(e.body)}function h(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),o=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(n))}}),e}function d(t){var e=new r,o=t.getAllResponseHeaders().trim().split("\n");return o.forEach(function(t){var r=t.trim().split(":"),o=r.shift().trim(),n=r.join(":").trim();e.append(o,n)}),e}function l(t,e){e||(e={}),this._initBody(t),this.type="default",this.url=null,this.status=e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText,this.headers=e.headers instanceof r?e.headers:new r(e.headers),this.url=e.url||""}if(!self.fetch){r.prototype.append=function(r,o){r=t(r),o=e(o);var n=this.map[r];n||(n=[],this.map[r]=n),n.push(o)},r.prototype["delete"]=function(e){delete this.map[t(e)]},r.prototype.get=function(e){var r=this.map[t(e)];return r?r[0]:null},r.prototype.getAll=function(e){return this.map[t(e)]||[]},r.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},r.prototype.set=function(r,o){this.map[t(r)]=[e(o)]},r.prototype.forEach=function(t,e){Object.getOwnPropertyNames(this.map).forEach(function(r){this.map[r].forEach(function(o){t.call(e,o,r,this)},this)},this)};var p={blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in self},c=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];a.call(f.prototype),a.call(l.prototype),self.Headers=r,self.Request=f,self.Response=l,self.fetch=function(t,e){var r;return r=f.prototype.isPrototypeOf(t)&&!e?t:new f(t,e),new Promise(function(t,e){function o(){return"responseURL"in n?n.responseURL:/^X-Request-URL:/m.test(n.getAllResponseHeaders())?n.getResponseHeader("X-Request-URL"):void 0}var n=new XMLHttpRequest;n.onload=function(){var r=1223===n.status?204:n.status;if(100>r||r>599)return void e(new TypeError("Network request failed"));var s={status:r,statusText:n.statusText,headers:d(n),url:o()},i="response"in n?n.response:n.responseText;t(new l(i,s))},n.onerror=function(){e(new TypeError("Network request failed"))},n.open(r.method,r.url,!0),"include"===r.credentials&&(n.withCredentials=!0),"responseType"in n&&p.blob&&(n.responseType="blob"),r.headers.forEach(function(t,e){n.setRequestHeader(e,t)}),n.send("undefined"==typeof r._bodyInit?null:r._bodyInit)})},self.fetch.polyfill=!0}}(); -------------------------------------------------------------------------------- /graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/SimpleListConnection.java: -------------------------------------------------------------------------------- 1 | package com.embedler.moon.graphql.boot.sample; 2 | 3 | import com.oembedler.moon.graphql.engine.relay.ConnectionObjectType; 4 | import com.oembedler.moon.graphql.engine.relay.EdgeObjectType; 5 | import com.oembedler.moon.graphql.engine.relay.PageInfoObjectType; 6 | import graphql.relay.Base64; 7 | import graphql.relay.ConnectionCursor; 8 | import graphql.schema.DataFetchingEnvironment; 9 | 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | /** 14 | * @author oEmbedler Inc. 15 | */ 16 | public class SimpleListConnection { 17 | 18 | private static final String DUMMY_CURSOR_PREFIX = "simple-cursor"; 19 | private List data = new ArrayList(); 20 | 21 | public SimpleListConnection(List data) { 22 | this.data = data; 23 | } 24 | 25 | public T createEdgeObject() { 26 | return (T) new EdgeObjectType(); 27 | } 28 | 29 | public T createConnectionObject() { 30 | return (T) new ConnectionObjectType(); 31 | } 32 | 33 | private List buildEdges() { 34 | List edges = new ArrayList<>(); 35 | int ix = 0; 36 | for (Object object : data) { 37 | EdgeObjectType edge = createEdgeObject(); 38 | edge.setNode(object); 39 | edge.setCursor(createCursor(ix++)); 40 | edges.add(edge); 41 | } 42 | return edges; 43 | } 44 | 45 | public T get(DataFetchingEnvironment environment) { 46 | 47 | List edges = buildEdges(); 48 | 49 | int afterOffset = getOffsetFromCursor(environment.getArgument("after"), -1); 50 | int begin = Math.max(afterOffset, -1) + 1; 51 | int beforeOffset = getOffsetFromCursor(environment.getArgument("before"), edges.size()); 52 | int end = Math.min(beforeOffset, edges.size()); 53 | 54 | edges = edges.subList(begin, end); 55 | if (edges.size() == 0) { 56 | return emptyConnection(); 57 | } 58 | 59 | Integer first = environment.getArgument("first"); 60 | Integer last = environment.getArgument("last"); 61 | 62 | String firstPresliceCursor = edges.get(0).getCursor(); 63 | String lastPresliceCursor = edges.get(edges.size() - 1).getCursor(); 64 | 65 | if (first != null) { 66 | edges = edges.subList(0, first <= edges.size() ? first : edges.size()); 67 | } 68 | if (last != null) { 69 | edges = edges.subList(edges.size() - last, edges.size()); 70 | } 71 | 72 | if (edges.size() == 0) { 73 | return emptyConnection(); 74 | } 75 | 76 | EdgeObjectType firstEdge = edges.get(0); 77 | EdgeObjectType lastEdge = edges.get(edges.size() - 1); 78 | 79 | PageInfoObjectType pageInfo = new PageInfoObjectType(); 80 | pageInfo.setStartCursor(firstEdge.getCursor()); 81 | pageInfo.setEndCursor(lastEdge.getCursor()); 82 | pageInfo.setHasPreviousPage(!firstEdge.getCursor().equals(firstPresliceCursor)); 83 | pageInfo.setHasNextPage(!lastEdge.getCursor().equals(lastPresliceCursor)); 84 | 85 | ConnectionObjectType connection = createConnectionObject(); 86 | connection.setEdges(edges); 87 | connection.setPageInfo(pageInfo); 88 | 89 | return (T) connection; 90 | } 91 | 92 | private T emptyConnection() { 93 | ConnectionObjectType connection = createConnectionObject(); 94 | connection.setPageInfo(new PageInfoObjectType()); 95 | return (T) connection; 96 | } 97 | 98 | public ConnectionCursor cursorForObjectInConnection(Object object) { 99 | int index = data.indexOf(object); 100 | String cursor = createCursor(index); 101 | return new ConnectionCursor(cursor); 102 | } 103 | 104 | private int getOffsetFromCursor(String cursor, int defaultValue) { 105 | if (cursor == null) return defaultValue; 106 | String string = Base64.fromBase64(cursor); 107 | return Integer.parseInt(string.substring(DUMMY_CURSOR_PREFIX.length())); 108 | } 109 | 110 | private String createCursor(int offset) { 111 | String string = Base64.toBase64(DUMMY_CURSOR_PREFIX + Integer.toString(offset)); 112 | return string; 113 | } 114 | 115 | } -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLWebAutoConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | 20 | package com.oembedler.moon.graphql.boot; 21 | 22 | import org.springframework.beans.factory.annotation.Value; 23 | import org.springframework.boot.autoconfigure.AutoConfigureAfter; 24 | import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; 25 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; 26 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 27 | import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; 28 | import org.springframework.boot.context.embedded.MultipartConfigFactory; 29 | import org.springframework.context.annotation.Bean; 30 | import org.springframework.context.annotation.Configuration; 31 | import org.springframework.util.StringUtils; 32 | import org.springframework.web.servlet.DispatcherServlet; 33 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 34 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 35 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 36 | 37 | import javax.servlet.MultipartConfigElement; 38 | import javax.servlet.Servlet; 39 | 40 | /** 41 | * @author oEmbedler Inc. 42 | */ 43 | @Configuration 44 | @ConditionalOnWebApplication 45 | @ConditionalOnClass({Servlet.class, DispatcherServlet.class, WebMvcConfigurerAdapter.class}) 46 | @AutoConfigureAfter({GraphQLAutoConfiguration.class, WebMvcConfigurerAdapter.class}) 47 | public class GraphQLWebAutoConfiguration { 48 | 49 | private static final String DEFAULT_UPLOAD_MAX_FILE_SIZE = "128KB"; 50 | private static final String DEFAULT_UPLOAD_MAX_REQUEST_SIZE = "128KB"; 51 | 52 | @Value("${graphql.server.mapping:/graphql}") 53 | private String graphQLServerMapping; 54 | 55 | @Bean 56 | @ConditionalOnProperty(value = "graphql.server.corsEnabled", havingValue = "true", matchIfMissing = true) 57 | public WebMvcConfigurer corsConfigurer() { 58 | return new WebMvcConfigurerAdapter() { 59 | @Override 60 | public void addCorsMappings(CorsRegistry registry) { 61 | registry.addMapping(graphQLServerMapping); 62 | } 63 | }; 64 | } 65 | 66 | @Bean 67 | @ConditionalOnMissingBean(GraphQLServerController.class) 68 | public GraphQLServerController basicGraphQLController() { 69 | return new GraphQLServerController(); 70 | } 71 | 72 | @Bean 73 | @ConditionalOnMissingBean(GlobalDefaultExceptionHandler.class) 74 | @ConditionalOnProperty(value = "graphql.server.suppressSpringResponseCodes", havingValue = "true", matchIfMissing = true) 75 | public GlobalDefaultExceptionHandler globalDefaultExceptionHandler() { 76 | return new GlobalDefaultExceptionHandler(); 77 | } 78 | 79 | @Bean 80 | @ConditionalOnMissingBean(MultipartConfigElement.class) 81 | public MultipartConfigElement multipartConfigElement(GraphQLProperties graphQLProperties) { 82 | MultipartConfigFactory factory = new MultipartConfigFactory(); 83 | factory.setMaxFileSize(DEFAULT_UPLOAD_MAX_FILE_SIZE); 84 | factory.setMaxRequestSize(DEFAULT_UPLOAD_MAX_REQUEST_SIZE); 85 | 86 | String temp = graphQLProperties.getServer().getUploadMaxFileSize(); 87 | if (StringUtils.hasText(temp)) 88 | factory.setMaxFileSize(temp); 89 | 90 | temp = graphQLProperties.getServer().getUploadMaxRequestSize(); 91 | if (StringUtils.hasText(temp)) 92 | factory.setMaxRequestSize(temp); 93 | 94 | return factory.createMultipartConfig(); 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /graphql-sample-app/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /graphql-spring-boot-starter/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /graphiql-spring-boot-starter/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /graphiql-spring-boot-autoconfigure/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLAutoConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | 20 | package com.oembedler.moon.graphql.boot; 21 | 22 | import com.oembedler.moon.graphql.GraphQLSchemaBeanFactory; 23 | import com.oembedler.moon.graphql.SpringGraphQLSchemaBeanFactory; 24 | import com.oembedler.moon.graphql.engine.GraphQLSchemaBuilder; 25 | import com.oembedler.moon.graphql.engine.GraphQLSchemaConfig; 26 | import com.oembedler.moon.graphql.engine.GraphQLSchemaHolder; 27 | import com.oembedler.moon.graphql.engine.stereotype.GraphQLSchema; 28 | import org.springframework.beans.factory.annotation.Autowired; 29 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; 30 | import org.springframework.boot.context.properties.EnableConfigurationProperties; 31 | import org.springframework.context.ApplicationContext; 32 | import org.springframework.context.annotation.Bean; 33 | import org.springframework.context.annotation.Configuration; 34 | import org.springframework.util.StringUtils; 35 | 36 | import java.util.HashMap; 37 | import java.util.Map; 38 | import java.util.Set; 39 | import java.util.stream.Collectors; 40 | 41 | /** 42 | * @author oEmbedler Inc. 43 | */ 44 | @Configuration 45 | @EnableConfigurationProperties(GraphQLProperties.class) 46 | public class GraphQLAutoConfiguration { 47 | 48 | @Autowired 49 | private GraphQLProperties graphQLProperties; 50 | 51 | @Autowired 52 | private ApplicationContext applicationContext; 53 | 54 | @Bean 55 | @ConditionalOnMissingBean 56 | public GraphQLSchemaBeanFactory graphQLSchemaBeanFactory() { 57 | return new SpringGraphQLSchemaBeanFactory(); 58 | } 59 | 60 | @Bean 61 | @ConditionalOnMissingBean 62 | public GraphQLSchemaConfig graphQLSchemaConfig() { 63 | GraphQLSchemaConfig graphQLSchemaConfig = new GraphQLSchemaConfig(); 64 | 65 | // --- populate schema config based on boot GraphQL properties 66 | GraphQLProperties.Schema schema = graphQLProperties.getSchema(); 67 | if (schema != null) { 68 | if (schema.getAllowEmptyClientMutationId() != null) 69 | graphQLSchemaConfig.setAllowEmptyClientMutationId(schema.getAllowEmptyClientMutationId()); 70 | if (schema.getInjectClientMutationId() != null) 71 | graphQLSchemaConfig.setInjectClientMutationId(schema.getInjectClientMutationId()); 72 | if (StringUtils.hasText(schema.getClientMutationIdName())) 73 | graphQLSchemaConfig.setClientMutationIdName(schema.getClientMutationIdName()); 74 | if (StringUtils.hasText(schema.getInputObjectNamePrefix())) 75 | graphQLSchemaConfig.setInputObjectNamePrefix(schema.getInputObjectNamePrefix()); 76 | if (StringUtils.hasText(schema.getMutationInputArgumentName())) 77 | graphQLSchemaConfig.setMutationInputArgumentName(schema.getMutationInputArgumentName()); 78 | if (StringUtils.hasText(schema.getOutputObjectNamePrefix())) 79 | graphQLSchemaConfig.setOutputObjectNamePrefix(schema.getOutputObjectNamePrefix()); 80 | if (StringUtils.hasText(schema.getSchemaMutationObjectName())) 81 | graphQLSchemaConfig.setSchemaMutationObjectName(schema.getSchemaMutationObjectName()); 82 | } 83 | 84 | return graphQLSchemaConfig; 85 | } 86 | 87 | @Bean 88 | @ConditionalOnMissingBean 89 | public GraphQLSchemaBuilder graphQLSchemaBuilder() { 90 | return new GraphQLSchemaBuilder(graphQLSchemaConfig(), graphQLSchemaBeanFactory()); 91 | } 92 | 93 | @Bean 94 | @ConditionalOnMissingBean 95 | public GraphQLSchemaLocator graphQLSchemaLocator() throws ClassNotFoundException { 96 | Map graphQLSchemaHolders = new HashMap<>(); 97 | GraphQLSchemaBuilder graphQLSchemaBuilder = graphQLSchemaBuilder(); 98 | Set> schemaClasses = initialSchemaClassesSet(); 99 | if (schemaClasses.size() > 0) { 100 | for (Class schema : schemaClasses) { 101 | GraphQLSchemaHolder schemaHolder = graphQLSchemaBuilder.buildSchema(schema); 102 | graphQLSchemaHolders.put(schemaHolder.getSchemaName(), schemaHolder); 103 | } 104 | } 105 | return new GraphQLSchemaLocator(graphQLSchemaHolders); 106 | } 107 | 108 | protected Set> initialSchemaClassesSet() { 109 | // scans the application context for classes annotated with {@link GraphQLSchema} 110 | Map potentialCandidates = applicationContext.getBeansWithAnnotation(GraphQLSchema.class); 111 | return potentialCandidates.values().stream().map(x -> x.getClass()).collect(Collectors.toSet()); 112 | } 113 | 114 | } 115 | -------------------------------------------------------------------------------- /graphql-sample-app/src/main/java/com/embedler/moon/graphql/boot/sample/schema/TodoSchema.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | 20 | package com.embedler.moon.graphql.boot.sample.schema; 21 | 22 | import com.embedler.moon.graphql.boot.sample.TodoSimpleListConnection; 23 | import com.embedler.moon.graphql.boot.sample.schema.objecttype.RootObjectType; 24 | import com.embedler.moon.graphql.boot.sample.schema.objecttype.TodoObjectType; 25 | import com.embedler.moon.graphql.boot.sample.schema.objecttype.UserObjectType; 26 | import com.oembedler.moon.graphql.boot.GraphQLContext; 27 | import com.oembedler.moon.graphql.engine.stereotype.*; 28 | 29 | import java.util.ArrayList; 30 | import java.util.List; 31 | import java.util.stream.Collectors; 32 | 33 | @GraphQLSchema 34 | public class TodoSchema { 35 | 36 | @GraphQLSchemaQuery 37 | private RootObjectType root; 38 | 39 | private UserObjectType theOnlyUser = new UserObjectType(); 40 | private List todos = new ArrayList<>(); 41 | 42 | private TodoSimpleListConnection simpleConnectionTodo; 43 | private int nextTodoId = 0; 44 | 45 | 46 | public TodoSchema() { 47 | addTodo("Do Something"); 48 | addTodo("Other todo"); 49 | 50 | simpleConnectionTodo = new TodoSimpleListConnection(todos); 51 | } 52 | 53 | public String addTodo(String text) { 54 | TodoObjectType newTodo = new TodoObjectType(); 55 | newTodo.setId(Integer.toString(nextTodoId++)); 56 | newTodo.setText(text); 57 | todos.add(newTodo); 58 | return newTodo.getId(newTodo); 59 | } 60 | 61 | public void removeTodo(String id) { 62 | TodoObjectType del = todos.stream().filter(todo -> todo.getId(todo).equals(id)).findFirst().get(); 63 | todos.remove(del); 64 | } 65 | 66 | public void renameTodo(String id, String text) { 67 | TodoObjectType matchedTodo = todos.stream().filter(todo -> todo.getId(todo).equals(id)).findFirst().get(); 68 | matchedTodo.setText(text); 69 | } 70 | 71 | public List removeCompletedTodos() { 72 | List toDelete = todos.stream() 73 | .filter(TodoObjectType::isComplete) 74 | .map(todoObjectType -> todoObjectType.getId(todoObjectType)) 75 | .collect(Collectors.toList()); 76 | todos.removeIf(todo -> toDelete.contains(todo.getId(todo))); 77 | return toDelete; 78 | } 79 | 80 | public List markAllTodos(boolean complete) { 81 | List changed = new ArrayList<>(); 82 | todos.stream().filter(todo -> complete != todo.isComplete()).forEach(todo -> { 83 | changed.add(todo.getId(todo)); 84 | todo.setComplete(complete); 85 | }); 86 | 87 | return changed; 88 | } 89 | 90 | public void changeTodoStatus(String id, boolean complete) { 91 | TodoObjectType todo = getTodo(id); 92 | todo.setComplete(complete); 93 | } 94 | 95 | public TodoObjectType getTodo(String id) { 96 | return todos.stream().filter(todo -> todo.getId(todo).equals(id)).findFirst().get(); 97 | } 98 | 99 | public List getTodos(List ids) { 100 | return todos.stream().filter(todo -> ids.contains(todo.getId(todo))).collect(Collectors.toList()); 101 | } 102 | 103 | public UserObjectType getTheOnlyUser() { 104 | return theOnlyUser; 105 | } 106 | 107 | 108 | public TodoSimpleListConnection getSimpleConnectionTodo() { 109 | return simpleConnectionTodo; 110 | } 111 | 112 | public static class AddTodoIn { 113 | private String text; 114 | 115 | public String getText() { 116 | return text; 117 | } 118 | 119 | public void setText(String text) { 120 | this.text = text; 121 | } 122 | } 123 | 124 | // --- mutations 125 | 126 | @GraphQLMutation 127 | @GraphQLDescription("Mutation to add new todo item") 128 | public 129 | @GraphQLOut("todoEdge") 130 | TodoObjectType.TodoEdgeObjectType addTodoMutation(@GraphQLIn("addTodoInput") AddTodoIn addTodoInput) { 131 | 132 | TodoObjectType.TodoEdgeObjectType todoEdgeObjectType = new TodoObjectType.TodoEdgeObjectType(); 133 | todoEdgeObjectType.setCursor("test-cursor"); 134 | todoEdgeObjectType.setNode(new TodoObjectType()); 135 | todoEdgeObjectType.getNode().setId("id-12345"); 136 | todoEdgeObjectType.getNode().setText("simple text"); 137 | todoEdgeObjectType.getNode().setComplete(false); 138 | 139 | return todoEdgeObjectType; 140 | } 141 | 142 | @GraphQLMutation 143 | public 144 | @GraphQLOut("filename") 145 | String uploadFile(GraphQLContext graphQLContext) { 146 | return graphQLContext.getUploadedFile().getName(); 147 | } 148 | 149 | @GraphQLMutation 150 | public String updateTodoMutation(@GraphQLIn("updateTodoInput") String newText) { 151 | return "Simple output string"; 152 | } 153 | 154 | } 155 | -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | 20 | package com.oembedler.moon.graphql.boot; 21 | 22 | import org.springframework.boot.context.properties.ConfigurationProperties; 23 | import org.springframework.boot.context.properties.NestedConfigurationProperty; 24 | import org.springframework.context.annotation.Configuration; 25 | 26 | /** 27 | * @author oEmbedler Inc. 28 | */ 29 | @Configuration 30 | @ConfigurationProperties(prefix = "graphql") 31 | public class GraphQLProperties { 32 | 33 | @NestedConfigurationProperty 34 | private Server server; 35 | 36 | @NestedConfigurationProperty 37 | private Schema schema; 38 | 39 | public static class Server { 40 | private String mapping; 41 | private String queryKey; 42 | private String variablesKey; 43 | private String uploadMaxFileSize; 44 | private String uploadMaxRequestSize; 45 | private Boolean suppressSpringResponseCodes; 46 | 47 | public String getMapping() { 48 | return mapping; 49 | } 50 | 51 | public void setMapping(String mapping) { 52 | this.mapping = mapping; 53 | } 54 | 55 | public String getQueryKey() { 56 | return queryKey; 57 | } 58 | 59 | public void setQueryKey(String queryKey) { 60 | this.queryKey = queryKey; 61 | } 62 | 63 | public String getVariablesKey() { 64 | return variablesKey; 65 | } 66 | 67 | public void setVariablesKey(String variablesKey) { 68 | this.variablesKey = variablesKey; 69 | } 70 | 71 | public String getUploadMaxFileSize() { 72 | return uploadMaxFileSize; 73 | } 74 | 75 | public void setUploadMaxFileSize(String uploadMaxFileSize) { 76 | this.uploadMaxFileSize = uploadMaxFileSize; 77 | } 78 | 79 | public String getUploadMaxRequestSize() { 80 | return uploadMaxRequestSize; 81 | } 82 | 83 | public void setUploadMaxRequestSize(String uploadMaxRequestSize) { 84 | this.uploadMaxRequestSize = uploadMaxRequestSize; 85 | } 86 | 87 | public Boolean getSuppressSpringResponseCodes() { 88 | return suppressSpringResponseCodes; 89 | } 90 | 91 | public void setSuppressSpringResponseCodes(Boolean suppressSpringResponseCodes) { 92 | this.suppressSpringResponseCodes = suppressSpringResponseCodes; 93 | } 94 | } 95 | 96 | public static class Schema { 97 | private String clientMutationIdName; 98 | private Boolean injectClientMutationId; 99 | private Boolean allowEmptyClientMutationId; 100 | private String mutationInputArgumentName; 101 | private String outputObjectNamePrefix; 102 | private String inputObjectNamePrefix; 103 | private String schemaMutationObjectName; 104 | 105 | public String getClientMutationIdName() { 106 | return clientMutationIdName; 107 | } 108 | 109 | public void setClientMutationIdName(String clientMutationIdName) { 110 | this.clientMutationIdName = clientMutationIdName; 111 | } 112 | 113 | public Boolean getInjectClientMutationId() { 114 | return injectClientMutationId; 115 | } 116 | 117 | public void setInjectClientMutationId(Boolean injectClientMutationId) { 118 | this.injectClientMutationId = injectClientMutationId; 119 | } 120 | 121 | public Boolean getAllowEmptyClientMutationId() { 122 | return allowEmptyClientMutationId; 123 | } 124 | 125 | public void setAllowEmptyClientMutationId(Boolean allowEmptyClientMutationId) { 126 | this.allowEmptyClientMutationId = allowEmptyClientMutationId; 127 | } 128 | 129 | public String getMutationInputArgumentName() { 130 | return mutationInputArgumentName; 131 | } 132 | 133 | public void setMutationInputArgumentName(String mutationInputArgumentName) { 134 | this.mutationInputArgumentName = mutationInputArgumentName; 135 | } 136 | 137 | public String getOutputObjectNamePrefix() { 138 | return outputObjectNamePrefix; 139 | } 140 | 141 | public void setOutputObjectNamePrefix(String outputObjectNamePrefix) { 142 | this.outputObjectNamePrefix = outputObjectNamePrefix; 143 | } 144 | 145 | public String getInputObjectNamePrefix() { 146 | return inputObjectNamePrefix; 147 | } 148 | 149 | public void setInputObjectNamePrefix(String inputObjectNamePrefix) { 150 | this.inputObjectNamePrefix = inputObjectNamePrefix; 151 | } 152 | 153 | public String getSchemaMutationObjectName() { 154 | return schemaMutationObjectName; 155 | } 156 | 157 | public void setSchemaMutationObjectName(String schemaMutationObjectName) { 158 | this.schemaMutationObjectName = schemaMutationObjectName; 159 | } 160 | } 161 | 162 | public Server getServer() { 163 | return server; 164 | } 165 | 166 | public void setServer(Server server) { 167 | this.server = server; 168 | } 169 | 170 | public Schema getSchema() { 171 | return schema; 172 | } 173 | 174 | public void setSchema(Schema schema) { 175 | this.schema = schema; 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | **Table of Contents** 4 | 5 | - [GraphQL Spring Framework Boot Starter](#graphql-spring-framework-boot-starter) 6 | - [Intro](#intro) 7 | - [Requires](#requires) 8 | - [Enable GraphQL Server](#enable-graphql-server) 9 | - [Enable GraphiQL Tool](#enable-graphiql-tool) 10 | - [Contributions](#contributions) 11 | - [License](#license) 12 | 13 | 14 | 15 | # GraphQL and GraphiQL Spring Framework Boot Starters 16 | [![Build Status](https://travis-ci.org/oembedler/graphql-spring-boot.svg?branch=master)](https://travis-ci.org/oembedler/graphql-spring-boot) 17 | 18 | GraphQL Starter 19 | 20 | [ ![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) 21 | 22 | GraphiQL Starter 23 | 24 | [ ![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) 25 | 26 | # Intro 27 | 28 | Repository contains: 29 | 30 | * `graphql-spring-boot-starter` to turn your boot application into GraphQL server (see [express-graphql](https://github.com/graphql/express-graphql)) 31 | * `graphiql-spring-boot-starter`to embed `GraphiQL` tool for schema introspection and query debugging (see [graphiql](https://github.com/graphql/graphiql)) 32 | 33 | # Requires 34 | 35 | * Java 1.8 36 | * [Spring Framework GraphQL Common Library](https://github.com/oembedler/spring-graphql-common) 37 | * Spring Framework Boot 1.3.x (web) 38 | 39 | Add repository: 40 | 41 | ```gradle 42 | repositories { 43 | // stable build 44 | jcenter() 45 | // development build 46 | maven { url "http://dl.bintray.com/oembedler/maven" } 47 | } 48 | ``` 49 | 50 | Dependency: 51 | 52 | ```gradle 53 | dependencies { 54 | compile 'com.embedler.moon.graphql.boot:graphql-spring-boot-starter:INSERT_LATEST_VERSION_HERE' 55 | 56 | // to embed GraphiQL tool 57 | compile 'com.embedler.moon.graphql.boot:graphiql-spring-boot-starter:INSERT_LATEST_VERSION_HERE' 58 | } 59 | ``` 60 | 61 | How to use the latest build with Maven: 62 | 63 | ```xml 64 | 65 | 66 | false 67 | 68 | bintray-oembedler-maven 69 | bintray 70 | http://dl.bintray.com/oembedler/maven 71 | 72 | ``` 73 | 74 | Dependency: 75 | 76 | ```xml 77 | 78 | com.embedler.moon.graphql.boot 79 | graphql-spring-boot-starter 80 | INSERT_LATEST_VERSION_HERE 81 | 82 | 83 | 84 | 85 | com.embedler.moon.graphql.boot 86 | graphiql-spring-boot-starter 87 | INSERT_LATEST_VERSION_HERE 88 | 89 | ``` 90 | 91 | 92 | # Enable GraphQL Server 93 | 94 | Server becomes accessible at `/graphql` if `graphql-spring-boot-starter` added as a dependency to a boot application 95 | and `@EnableGraphQLServer` annotation is set at the main java configuration class. 96 | GraphQL schemas are automatically discovered extracting all classes from Spring context marked as `@GraphQLSchema`. 97 | 98 | Request parameters: 99 | 100 | * **`query`**: A string GraphQL document to be executed. 101 | 102 | * **`variables`**: The runtime values to use for any GraphQL query variables 103 | as a JSON object. 104 | 105 | * **`operationName`**: If the provided `query` contains multiple named 106 | operations, this specifies which operation should be executed. If not 107 | provided, an error will be returned if the `query` contains multiple 108 | named operations. 109 | 110 | GraphQL will first look for each parameter in the URL's query-string: 111 | 112 | ``` 113 | /graphql?query=query+getUser($id:ID){user(id:$id){name}}&variables={"id":"4"} 114 | ``` 115 | 116 | If not found in the query-string, it will look in the POST request body. 117 | 118 | Server uses [`commons-fileupload`][] middleware to add support 119 | for `multipart/form-data` content, which may be useful for GraphQL mutations 120 | involving uploading files (see test application for more details). 121 | `GraphQLContext` is a map of objects (context) for the current query execution. 122 | In order to get access to uploaded file 123 | `com.oembedler.moon.graphql.boot.GraphQLContext` should be passed as input parameter to datafetcher or mutation (don't need to be annotated). 124 | Calling method `GraphQLContext.getUploadedFile()` returns instance of [MultipartFile](https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/multipart/MultipartFile.html). 125 | 126 | If the POST body has not yet been parsed, graphql-express will interpret it 127 | depending on the provided *Content-Type* header. 128 | 129 | * **`application/json`**: the POST body will be parsed as a JSON 130 | object of parameters. 131 | 132 | * **`application/x-www-form-urlencoded`**: this POST body will be 133 | parsed as a url-encoded string of key-value pairs. 134 | 135 | * **`multipart/form-data`**: this POST body will be 136 | parsed as a string of key-value pairs and it supports file upload (see above). 137 | 138 | * **`application/graphql`**: The POST body will be parsed as GraphQL 139 | query string, which provides the `query` parameter. 140 | 141 | Available Spring Boot configuration parameters (either `application.yml` or `application.properties`): 142 | 143 | Server can host multiple schemas (all are registered at the startup time). 144 | 145 | To run query against particular schema - HTTP header `graphql-schema` parameter passed along with the query should contain graphql schema name of interest. 146 | 147 | ```yaml 148 | graphql: 149 | server: 150 | mapping: /graphql 151 | corsEnabled: true 152 | suppressSpringResponseCodes: true 153 | query-key: query 154 | variables-key: variables 155 | uploadMaxFileSize: 128KB 156 | uploadMaxRequestSize: 128KB 157 | schema: 158 | clientMutationIdName: clientMutationId 159 | injectClientMutationId: true 160 | allowEmptyClientMutationId: false 161 | mutationInputArgumentName: input 162 | outputObjectNamePrefix: Payload 163 | inputObjectNamePrefix: Input 164 | schemaMutationObjectName: Mutation 165 | ``` 166 | 167 | To facilitate access from Nodejs frontend to GraphQL backend by default system enables global CORS filter for `/graphql/**` context. 168 | The `corsEnabled` can be set to `false` to disable it. 169 | 170 | By default system register `GlobalDefaultExceptionHandler` which suppresses Spring framework error responses and responds with standard GraphQL server error. 171 | Application configuration `suppressSpringResponseCodes` property can be set to `false` to disable that handler. 172 | 173 | # Enable GraphiQL Tool 174 | 175 | Tool becomes accessible at the root `/` if `graphiql-spring-boot-starter` added as a dependency to a boot application. 176 | 177 | Note that GraphQL server must be available at `/graphql` context to be discovered by GraphiQL. 178 | 179 | # Contributions 180 | 181 | Contributions are welcome. 182 | 183 | Tips: 184 | 185 | - Respect the [Code of Conduct](http://contributor-covenant.org/version/1/3/0/). 186 | - Before opening an Issue to report a bug, please try the latest development version. 187 | It might happen that the problem is already solved. 188 | - Please use Markdown to format your comments properly. 189 | 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/) 190 | - For Pull Requests: 191 | - Here are some [general tips](https://github.com/blog/1943-how-to-write-the-perfect-pull-request) 192 | - Please be a as focused and clear as possible and don't mix concerns. 193 | This includes refactorings mixed with bug-fixes/features, see [Open Source Contribution Etiquette](http://tirania.org/blog/archive/2010/Dec-31.html) 194 | - It would be good to add an automatic test(s). 195 | 196 | 197 | # License 198 | 199 | `graphql-spring-boot-starter` and `graphiql-spring-boot-starter` are licensed under the MIT License. See [LICENSE](LICENSE.md) for details. 200 | 201 | [spring-graphql-common License](https://github.com/oembedler/spring-graphql-common/blob/master/LICENSE.md) 202 | 203 | [graphql-java License](https://github.com/andimarek/graphql-java/blob/master/LICENSE.md) 204 | 205 | [graphiql License](https://github.com/graphql/graphiql/blob/master/LICENSE) 206 | 207 | [graphql-js License](https://github.com/graphql/graphql-js/blob/master/LICENSE) 208 | -------------------------------------------------------------------------------- /graphql-sample-app/src/test/java/com/embedler/moon/graphql/boot/sample/test/GenericTodoSchemaParserTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | 20 | package com.embedler.moon.graphql.boot.sample.test; 21 | 22 | import com.embedler.moon.graphql.boot.sample.ApplicationBootConfiguration; 23 | import com.fasterxml.jackson.databind.ObjectMapper; 24 | import com.oembedler.moon.graphql.boot.GraphQLServerRequest; 25 | import com.oembedler.moon.graphql.boot.GraphQLServerResult; 26 | import org.junit.Assert; 27 | import org.junit.Test; 28 | import org.junit.runner.RunWith; 29 | import org.slf4j.Logger; 30 | import org.slf4j.LoggerFactory; 31 | import org.springframework.beans.factory.annotation.Value; 32 | import org.springframework.boot.test.IntegrationTest; 33 | import org.springframework.boot.test.SpringApplicationConfiguration; 34 | import org.springframework.boot.test.TestRestTemplate; 35 | import org.springframework.boot.test.WebIntegrationTest; 36 | import org.springframework.core.io.ClassPathResource; 37 | import org.springframework.http.*; 38 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 39 | import org.springframework.test.context.web.WebAppConfiguration; 40 | import org.springframework.util.CollectionUtils; 41 | import org.springframework.util.LinkedMultiValueMap; 42 | import org.springframework.web.client.RestTemplate; 43 | 44 | import java.io.IOException; 45 | import java.util.HashMap; 46 | import java.util.Map; 47 | 48 | /** 49 | * @author oEmbedler Inc. 50 | */ 51 | @RunWith(SpringJUnit4ClassRunner.class) 52 | @SpringApplicationConfiguration(ApplicationBootConfiguration.class) 53 | @WebIntegrationTest("server.port=0") 54 | public class GenericTodoSchemaParserTest { 55 | 56 | private static final Logger LOGGER = LoggerFactory.getLogger(GenericTodoSchemaParserTest.class); 57 | 58 | @Value("${local.server.port}") 59 | private int port; 60 | 61 | private RestTemplate restTemplate = new TestRestTemplate(); 62 | private ObjectMapper objectMapper = new ObjectMapper(); 63 | 64 | @Test 65 | public void restViewerByIdTest() throws IOException { 66 | HttpHeaders headers = new HttpHeaders(); 67 | headers.setContentType(MediaType.APPLICATION_JSON_UTF8); 68 | 69 | GraphQLServerRequest qlQuery = new GraphQLServerRequest("{viewer{ id }}"); 70 | 71 | HttpEntity httpEntity = new HttpEntity<>(qlQuery, headers); 72 | ResponseEntity responseEntity = restTemplate.exchange("http://localhost:" + port + "/graphql", HttpMethod.POST, httpEntity, GraphQLServerResult.class); 73 | 74 | GraphQLServerResult result = responseEntity.getBody(); 75 | Assert.assertTrue(CollectionUtils.isEmpty(result.getErrors())); 76 | Assert.assertFalse(CollectionUtils.isEmpty(result.getData())); 77 | LOGGER.info(objectMapper.writeValueAsString(result.getData())); 78 | } 79 | 80 | @Test 81 | public void restSchemaDoesNotExistsTest() throws IOException { 82 | HttpHeaders headers = new HttpHeaders(); 83 | headers.setContentType(MediaType.APPLICATION_JSON_UTF8); 84 | headers.add("graphql-schema", "no-such-schema"); 85 | 86 | GraphQLServerRequest qlQuery = new GraphQLServerRequest("{viewer{ id }}"); 87 | 88 | HttpEntity httpEntity = new HttpEntity<>(qlQuery, headers); 89 | ResponseEntity responseEntity = restTemplate.exchange("http://localhost:" + port + "/graphql", HttpMethod.POST, httpEntity, GraphQLServerResult.class); 90 | 91 | GraphQLServerResult result = responseEntity.getBody(); 92 | Assert.assertFalse(CollectionUtils.isEmpty(result.getErrors())); 93 | LOGGER.info(objectMapper.writeValueAsString(result)); 94 | } 95 | 96 | @Test 97 | public void restUnsupportedOperationErrorTest() throws IOException { 98 | HttpHeaders headers = new HttpHeaders(); 99 | headers.setContentType(MediaType.APPLICATION_JSON_UTF8); 100 | GraphQLServerRequest qlQuery = new GraphQLServerRequest("{viewer{ id }}"); 101 | HttpEntity httpEntity = new HttpEntity<>(qlQuery, headers); 102 | 103 | ResponseEntity responseEntity = restTemplate.exchange("http://localhost:" + port + "/graphql", HttpMethod.PUT, httpEntity, GraphQLServerResult.class); 104 | 105 | GraphQLServerResult result = responseEntity.getBody(); 106 | Assert.assertFalse(CollectionUtils.isEmpty(result.getErrors())); 107 | LOGGER.info(objectMapper.writeValueAsString(result)); 108 | } 109 | 110 | @Test 111 | public void restViewerJsonTest() throws IOException { 112 | HttpHeaders headers = new HttpHeaders(); 113 | headers.setContentType(MediaType.APPLICATION_JSON_UTF8); 114 | 115 | String qlQuery = "{viewer{ id }}"; 116 | Map variables = new HashMap<>(); 117 | variables.put("test-key", "key-0.9.0"); 118 | ResponseEntity responseEntity = 119 | restTemplate.getForEntity("http://localhost:" + port + "/graphql?query={0}&variables={1}", 120 | GraphQLServerResult.class, qlQuery, objectMapper.writeValueAsString(variables)); 121 | 122 | GraphQLServerResult result = responseEntity.getBody(); 123 | Assert.assertTrue(CollectionUtils.isEmpty(result.getErrors())); 124 | Assert.assertFalse(CollectionUtils.isEmpty(result.getData())); 125 | LOGGER.info(objectMapper.writeValueAsString(result.getData())); 126 | } 127 | 128 | @Test 129 | public void restUploadFileTest() throws IOException { 130 | 131 | LinkedMultiValueMap map = new LinkedMultiValueMap<>(); 132 | map.add("file", new ClassPathResource("application.yml")); 133 | String qlQuery = "mutation UploadFileMutation{uploadFile(input: {clientMutationId:\"m-123\"}){ filename }}"; 134 | map.add("query", qlQuery); 135 | map.add("variables", "{}"); 136 | 137 | HttpHeaders headers = new HttpHeaders(); 138 | headers.setContentType(MediaType.MULTIPART_FORM_DATA); 139 | HttpEntity> requestEntity = new HttpEntity<>(map, headers); 140 | 141 | ResponseEntity responseEntity = 142 | restTemplate.exchange("http://localhost:" + port + "/graphql", HttpMethod.POST, requestEntity, GraphQLServerResult.class); 143 | 144 | GraphQLServerResult result = responseEntity.getBody(); 145 | Assert.assertTrue(CollectionUtils.isEmpty(result.getErrors())); 146 | Assert.assertFalse(CollectionUtils.isEmpty(result.getData())); 147 | LOGGER.info(objectMapper.writeValueAsString(result.getData())); 148 | } 149 | 150 | @Test 151 | public void restUploadFileUrlEncodedTest() throws IOException { 152 | 153 | LinkedMultiValueMap map = new LinkedMultiValueMap<>(); 154 | map.add("query", "mutation AddTodoMutationMutation{addTodoMutation(input: {clientMutationId:\"m-123\", addTodoInput:{text: \"text\"}}){ clientMutationId, todoEdge {cursor, node {text, complete}} }}"); 155 | map.add("variables", "{}"); 156 | HttpHeaders headers = new HttpHeaders(); 157 | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); 158 | HttpEntity> requestEntity = new HttpEntity<>(map, headers); 159 | 160 | ResponseEntity responseEntity = 161 | restTemplate.exchange("http://localhost:" + port + "/graphql", HttpMethod.POST, requestEntity, GraphQLServerResult.class); 162 | 163 | GraphQLServerResult result = responseEntity.getBody(); 164 | Assert.assertTrue(CollectionUtils.isEmpty(result.getErrors())); 165 | Assert.assertFalse(CollectionUtils.isEmpty(result.getData())); 166 | LOGGER.info(objectMapper.writeValueAsString(result.getData())); 167 | } 168 | 169 | } 170 | -------------------------------------------------------------------------------- /graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLServerController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 oEmbedler Inc. and Contributors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 8 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 9 | * persons to whom the Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | */ 19 | package com.oembedler.moon.graphql.boot; 20 | 21 | import com.fasterxml.jackson.databind.ObjectMapper; 22 | import com.google.common.collect.Lists; 23 | import com.oembedler.moon.graphql.engine.GraphQLSchemaHolder; 24 | import com.oembedler.moon.graphql.engine.execute.GraphQLQueryExecutor; 25 | import graphql.ExecutionResult; 26 | import graphql.ExecutionResultImpl; 27 | import org.slf4j.Logger; 28 | import org.slf4j.LoggerFactory; 29 | import org.springframework.beans.factory.annotation.Autowired; 30 | import org.springframework.http.ResponseEntity; 31 | import org.springframework.util.StringUtils; 32 | import org.springframework.web.bind.annotation.*; 33 | import org.springframework.web.multipart.MultipartFile; 34 | 35 | import javax.servlet.http.HttpServletRequest; 36 | import java.io.IOException; 37 | import java.util.HashMap; 38 | import java.util.LinkedHashMap; 39 | import java.util.Map; 40 | 41 | /** 42 | * @author oEmbedler Inc. 43 | */ 44 | @RestController 45 | @RequestMapping("${graphql.server.mapping:/graphql}") 46 | public class GraphQLServerController { 47 | 48 | private static final Logger LOGGER = LoggerFactory.getLogger(GraphQLServerController.class); 49 | 50 | public static final String DEFAULT_QUERY_KEY = "query"; 51 | public static final String DEFAULT_VARIABLES_KEY = "variables"; 52 | public static final String DEFAULT_OPERATION_NAME_KEY = "operationName"; 53 | public static final String DEFAULT_DATA_KEY = "data"; 54 | public static final String DEFAULT_FILENAME_UPLOAD_KEY = "file"; 55 | public static final String DEFAULT_ERRORS_KEY = "errors"; 56 | public static final String HEADER_SCHEMA_NAME = "graphql-schema"; 57 | 58 | // --- 59 | 60 | @Autowired 61 | private GraphQLProperties graphQLProperties; 62 | @Autowired 63 | private GraphQLSchemaLocator graphQLSchemaLocator; 64 | 65 | private ObjectMapper objectMapper = new ObjectMapper(); 66 | 67 | // --- 68 | 69 | @RequestMapping(method = RequestMethod.GET) 70 | public ResponseEntity> getJson(@RequestParam(DEFAULT_QUERY_KEY) String query, 71 | @RequestParam(value = DEFAULT_VARIABLES_KEY, required = false) String variables, 72 | @RequestParam(value = DEFAULT_OPERATION_NAME_KEY, required = false) String operationName, 73 | @RequestHeader(value = HEADER_SCHEMA_NAME, required = false) String graphQLSchemaName, 74 | HttpServletRequest httpServletRequest) throws IOException { 75 | 76 | final GraphQLContext graphQLContext = new GraphQLContext(); 77 | graphQLContext.setHttpRequest(httpServletRequest); 78 | 79 | final Map result = evaluateAndBuildResponseMap(query, operationName, graphQLContext, decodeIntoMap(variables), graphQLSchemaName); 80 | return ResponseEntity.ok(result); 81 | } 82 | 83 | @RequestMapping(method = RequestMethod.POST, consumes = "application/graphql") 84 | public ResponseEntity> postGraphQL(@RequestBody String query, 85 | @RequestParam(value = DEFAULT_OPERATION_NAME_KEY, required = false) String operationName, 86 | @RequestHeader(value = HEADER_SCHEMA_NAME, required = false) String graphQLSchemaName, 87 | HttpServletRequest httpServletRequest) { 88 | 89 | final GraphQLContext graphQLContext = new GraphQLContext(); 90 | graphQLContext.setHttpRequest(httpServletRequest); 91 | 92 | final Map result = evaluateAndBuildResponseMap(query, operationName, graphQLContext, new HashMap<>(), graphQLSchemaName); 93 | return ResponseEntity.ok(result); 94 | } 95 | 96 | @RequestMapping(method = RequestMethod.POST, consumes = "application/json") 97 | public ResponseEntity> postJson(@RequestBody Map body, 98 | @RequestHeader(value = HEADER_SCHEMA_NAME, required = false) String graphQLSchemaName, 99 | HttpServletRequest httpServletRequest) { 100 | 101 | final String query = (String) body.get(getQueryKey()); 102 | final String operationName = (String) body.get(DEFAULT_OPERATION_NAME_KEY); 103 | 104 | Map variables = null; 105 | Object variablesObject = body.get(getVariablesKey()); 106 | if (variablesObject != null && variablesObject instanceof Map) 107 | variables = (Map) variablesObject; 108 | 109 | final GraphQLContext graphQLContext = new GraphQLContext(); 110 | graphQLContext.setHttpRequest(httpServletRequest); 111 | 112 | final Map result = evaluateAndBuildResponseMap(query, operationName, graphQLContext, variables, graphQLSchemaName); 113 | 114 | return ResponseEntity.ok(result); 115 | } 116 | 117 | @RequestMapping(method = RequestMethod.POST, consumes = "multipart/form-data") 118 | public ResponseEntity> uploadFile(@RequestParam(DEFAULT_FILENAME_UPLOAD_KEY) MultipartFile file, 119 | @RequestParam(DEFAULT_QUERY_KEY) String query, 120 | @RequestParam(value = DEFAULT_VARIABLES_KEY, required = false) String variables, 121 | @RequestParam(value = DEFAULT_OPERATION_NAME_KEY, required = false) String operationName, 122 | @RequestHeader(value = HEADER_SCHEMA_NAME, required = false) String graphQLSchemaName, 123 | HttpServletRequest httpServletRequest) throws IOException { 124 | 125 | final GraphQLContext graphQLContext = new GraphQLContext(); 126 | graphQLContext.setUploadedFile(file); 127 | graphQLContext.setHttpRequest(httpServletRequest); 128 | 129 | final Map result = evaluateAndBuildResponseMap(query, operationName, graphQLContext, decodeIntoMap(variables), graphQLSchemaName); 130 | return ResponseEntity.ok(result); 131 | } 132 | 133 | @RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urlencoded") 134 | public ResponseEntity> uploadSmallFile(@RequestParam(DEFAULT_QUERY_KEY) String query, 135 | @RequestParam(value = DEFAULT_VARIABLES_KEY, required = false) String variables, 136 | @RequestParam(value = DEFAULT_OPERATION_NAME_KEY, required = false) String operationName, 137 | @RequestHeader(value = HEADER_SCHEMA_NAME, required = false) String graphQLSchemaName, 138 | HttpServletRequest httpServletRequest) throws IOException { 139 | 140 | final GraphQLContext graphQLContext = new GraphQLContext(); 141 | graphQLContext.setHttpRequest(httpServletRequest); 142 | 143 | final Map result = evaluateAndBuildResponseMap(query, operationName, graphQLContext, decodeIntoMap(variables), graphQLSchemaName); 144 | return ResponseEntity.ok(result); 145 | } 146 | 147 | private Map decodeIntoMap(final String variablesParam) throws IOException { 148 | return objectMapper.readValue(variablesParam, Map.class); 149 | } 150 | 151 | private Map evaluateAndBuildResponseMap(final String query, 152 | final String operationName, 153 | final GraphQLContext graphQLContext, 154 | final Map variables, 155 | final String graphQLSchemaName) { 156 | final Map result = new LinkedHashMap<>(); 157 | final GraphQLSchemaHolder graphQLSchemaHolder = getGraphQLSchemaContainer(graphQLSchemaName); 158 | final ExecutionResult executionResult = evaluate(query, operationName, graphQLContext, variables, graphQLSchemaHolder); 159 | 160 | if (executionResult.getErrors().size() > 0) { 161 | result.put(DEFAULT_ERRORS_KEY, executionResult.getErrors()); 162 | LOGGER.error("Errors: {}", executionResult.getErrors()); 163 | } 164 | 165 | result.put(DEFAULT_DATA_KEY, executionResult.getData()); 166 | return result; 167 | } 168 | 169 | private ExecutionResult evaluate(final String query, 170 | final String operationName, 171 | final GraphQLContext graphQLContext, 172 | final Map variables, 173 | final GraphQLSchemaHolder graphQLSchemaHolder) { 174 | ExecutionResult executionResult; 175 | 176 | if (graphQLSchemaHolder == null) { 177 | executionResult = new ExecutionResultImpl(Lists.newArrayList(new ErrorGraphQLSchemaUndefined())); 178 | } else { 179 | try { 180 | GraphQLQueryExecutor graphQLQueryExecutor = GraphQLQueryExecutor.create(graphQLSchemaHolder) 181 | .query(query).context(graphQLContext); 182 | 183 | if (variables != null) 184 | graphQLQueryExecutor.arguments(variables); 185 | 186 | if (StringUtils.hasText(operationName)) 187 | graphQLQueryExecutor.operation(operationName); 188 | 189 | executionResult = graphQLQueryExecutor.execute(); 190 | 191 | } catch (Exception e) { 192 | LOGGER.error("Error occurred evaluating query: {}", query); 193 | executionResult = new ExecutionResultImpl(Lists.newArrayList(new ErrorGraphQLQueryEvaluation())); 194 | } 195 | } 196 | 197 | return executionResult; 198 | } 199 | 200 | private String getQueryKey() { 201 | return StringUtils.hasText(graphQLProperties.getServer().getQueryKey()) ? 202 | graphQLProperties.getServer().getQueryKey() : DEFAULT_QUERY_KEY; 203 | } 204 | 205 | private String getVariablesKey() { 206 | return StringUtils.hasText(graphQLProperties.getServer().getVariablesKey()) ? 207 | graphQLProperties.getServer().getVariablesKey() : DEFAULT_VARIABLES_KEY; 208 | } 209 | 210 | public GraphQLSchemaHolder getGraphQLSchemaContainer(String graphQLSchema) { 211 | if (StringUtils.hasText(graphQLSchema)) 212 | return graphQLSchemaLocator.getGraphQLSchemaHolder(graphQLSchema); 213 | else if (graphQLSchemaLocator.getTotalNumberOfSchemas() == 1) 214 | return graphQLSchemaLocator.getSingleSchema(); 215 | 216 | return null; 217 | } 218 | } 219 | -------------------------------------------------------------------------------- /graphiql-spring-boot-autoconfigure/src/main/resources/META-INF/resources/webjars/graphiql/0.6.6/graphiql.min.css: -------------------------------------------------------------------------------- 1 | #graphiql-container{color:#141823;display:flex;display:-webkit-flex;flex-direction:row;-webkit-flex-direction:row;font-family:system,-apple-system,'San Francisco','.SFNSDisplay-Regular','Segoe UI',Segoe,'Segoe WP','Helvetica Neue',helvetica,'Lucida Grande',arial,sans-serif;font-size:14px;height:100%;margin:0;overflow:hidden;width:100%}#graphiql-container .editorWrap{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-flex:1;flex:1}#graphiql-container .title{font-size:18px}#graphiql-container .title em{font-family:georgia;font-size:19px}#graphiql-container .topBarWrap{display:-webkit-flex;display:flex;-webkit-flex-direction:row;flex-direction:row}#graphiql-container .topBar{-webkit-align-items:center;align-items:center;background:-webkit-linear-gradient(#f7f7f7,#e2e2e2);background:linear-gradient(#f7f7f7,#e2e2e2);border-bottom:1px solid #d0d0d0;cursor:default;display:-webkit-flex;display:flex;height:34px;padding:7px 14px 6px;-webkit-flex:1;flex:1;-webkit-flex-direction:row;flex-direction:row;-webkit-user-select:none;user-select:none}#graphiql-container .toolbar{overflow-x:auto}#graphiql-container .docExplorerShow{background:-webkit-linear-gradient(#f7f7f7,#e2e2e2);background:linear-gradient(#f7f7f7,#e2e2e2);border-bottom:1px solid #d0d0d0;border-left:1px solid rgba(0,0,0,.2);border-right:none;border-top:none;color:#3B5998;cursor:pointer;font-size:14px;outline:0;margin:0;padding:2px 20px 0 18px}#graphiql-container .docExplorerShow:before{border-left:2px solid #3B5998;border-top:2px solid #3B5998;content:'';display:inline-block;height:9px;margin:0 3px -1px 0;position:relative;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);width:9px}#graphiql-container .editorBar{display:-webkit-flex;display:flex;-webkit-flex:1;flex:1;-webkit-flex-direction:row;flex-direction:row}#graphiql-container .queryWrap{display:-webkit-flex;display:flex;-webkit-flex:1;flex:1;-webkit-flex-direction:column;flex-direction:column}#graphiql-container .resultWrap{border-left:solid 1px #e0e0e0;display:-webkit-flex;display:flex;position:relative;-webkit-flex:1;flex:1;-webkit-flex-direction:column;flex-direction:column}#graphiql-container .docExplorerWrap{background:#fff;box-shadow:0 0 8px rgba(0,0,0,.15);position:relative;z-index:3}#graphiql-container .docExplorerResizer{cursor:col-resize;height:100%;left:-5px;position:absolute;top:0;width:10px;z-index:10}#graphiql-container .docExplorerHide{cursor:pointer;font-size:18px;margin:-7px -8px -6px 0;padding:18px 16px 15px 12px}#graphiql-container .query-editor{-webkit-flex:1;flex:1;position:relative}#graphiql-container .variable-editor{display:-webkit-flex;display:flex;height:29px;-webkit-flex-direction:column;flex-direction:column;position:relative}#graphiql-container .variable-editor-title{background:#eee;border-bottom:1px solid #d6d6d6;border-top:1px solid #e0e0e0;color:#777;font-variant:small-caps;font-weight:700;letter-spacing:1px;line-height:14px;padding:6px 0 8px 43px;text-transform:lowercase;-webkit-user-select:none;user-select:none}#graphiql-container .codemirrorWrap,#graphiql-container .result-window{-webkit-flex:1;flex:1;position:relative}#graphiql-container .footer{background:#f6f7f8;border-left:1px solid #e0e0e0;border-top:1px solid #e0e0e0;margin-left:12px;position:relative}#graphiql-container .footer:before{background:#eee;bottom:0;content:" ";left:-13px;position:absolute;top:-1px;width:12px}#graphiql-container .doc-explorer-back:before,.cm-tab-wrap-hack:after{content:''}#graphiql-container .result-window .CodeMirror{background:#f6f7f8}#graphiql-container .result-window .CodeMirror-gutters{background-color:#eee;border-color:#e0e0e0;cursor:col-resize}#graphiql-container .result-window .CodeMirror-foldgutter,#graphiql-container .result-window .CodeMirror-foldgutter-folded:after,#graphiql-container .result-window .CodeMirror-foldgutter-open:after{padding-left:3px}#graphiql-container .toolbar-button{background:#fdfdfd;background:-webkit-linear-gradient(#fbfbfb,#f8f8f8);background:linear-gradient(#fbfbfb,#f8f8f8);border-width:.5px;border-style:solid;border-color:#d3d3d3 #d0d0d0 #bababa;border-radius:4px;box-shadow:0 1px 1px -1px rgba(0,0,0,.13),inset 0 1px #fff;color:#444;cursor:pointer;display:inline-block;margin:0 5px;padding:2px 8px 4px;text-decoration:none}#graphiql-container .toolbar-button:active{background:-webkit-linear-gradient(#ececec,#d8d8d8);background:linear-gradient(#ececec,#d8d8d8);border-color:#cacaca #c9c9c9 #b0b0b0;box-shadow:0 1px 0 #fff,inset 0 1px rgba(255,255,255,.2),inset 0 1px 1px rgba(0,0,0,.08)}#graphiql-container .toolbar-button.error{background:-webkit-linear-gradient(#fdf3f3,#e6d6d7);background:linear-gradient(#fdf3f3,#e6d6d7);color:#b00}#graphiql-container .execute-button-wrap{position:relative;margin:0 14px 0 28px;height:34px}#graphiql-container .execute-button{background:-webkit-linear-gradient(#fdfdfd,#d2d3d6);background:linear-gradient(#fdfdfd,#d2d3d6);border:1px solid rgba(0,0,0,.25);border-radius:17px;box-shadow:0 1px 0 #fff;cursor:pointer;fill:#444;height:34px;margin:0;padding:0;width:34px}#graphiql-container .execute-button svg{pointer-events:none}#graphiql-container .execute-button:active{background:-webkit-linear-gradient(#e6e6e6,silver);background:linear-gradient(#e6e6e6,silver);box-shadow:0 1px 0 #fff,inset 0 0 2px rgba(0,0,0,.3),inset 0 0 6px rgba(0,0,0,.2)}#graphiql-container .execute-button:focus{outline:0}#graphiql-container .execute-options{background:#fff;box-shadow:0 0 0 1px rgba(0,0,0,.1),0 2px 4px rgba(0,0,0,.25);left:-1px;margin:0;padding:8px 0;position:absolute;top:37px;z-index:100}#graphiql-container .execute-options li{padding:2px 30px 4px 10px;list-style:none;min-width:100px;cursor:pointer}#graphiql-container .execute-options li.selected{background:#e10098;color:#fff}#graphiql-container .CodeMirror-scroll{-webkit-overflow-scrolling:touch}#graphiql-container .CodeMirror{color:#141823;font-family:Consolas,Inconsolata,'Droid Sans Mono',Monaco,monospace;font-size:13px;height:100%;left:0;position:absolute;top:0;width:100%}.CodeMirror-hint-information .content,div.CodeMirror-lint-tooltip{font-family:system,-apple-system,'San Francisco','.SFNSDisplay-Regular','Segoe UI',Segoe,'Segoe WP','Helvetica Neue',helvetica,'Lucida Grande',arial,sans-serif;font-size:13px;line-height:16px}#graphiql-container .CodeMirror-lines{padding:20px 0}.CodeMirror-hint-information .content{-webkit-box-orient:vertical;box-orient:vertical;color:#141823;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;max-height:48px;overflow:hidden;text-overflow:-o-ellipsis-lastline}.CodeMirror-hint-information .content p:first-child{margin-top:0}.CodeMirror-hint-information .content p:last-child{margin-bottom:0}.CodeMirror-hint-information .infoType{color:#30a;cursor:pointer;display:inline;margin-right:.5em}.autoInsertedLeaf.cm-property{-webkit-animation-duration:6s;-moz-animation-duration:6s;animation-duration:6s;-webkit-animation-name:insertionFade;-moz-animation-name:insertionFade;animation-name:insertionFade;border-bottom:2px solid rgba(255,255,255,0);border-radius:2px;margin:-2px -4px -1px;padding:2px 4px 1px}@-moz-keyframes insertionFade{from,to{background:rgba(255,255,255,0);border-color:rgba(255,255,255,0)}15%,85%{background:#fbffc9;border-color:#f0f3c0}}@-webkit-keyframes insertionFade{from,to{background:rgba(255,255,255,0);border-color:rgba(255,255,255,0)}15%,85%{background:#fbffc9;border-color:#f0f3c0}}@keyframes insertionFade{from,to{background:rgba(255,255,255,0);border-color:rgba(255,255,255,0)}15%,85%{background:#fbffc9;border-color:#f0f3c0}}div.CodeMirror-lint-tooltip{background-color:#fff;border:0;border-radius:2px;color:#141823;box-shadow:0 1px 3px rgba(0,0,0,.45);opacity:0;padding:6px 10px;-webkit-transition:opacity .15s;-moz-transition:opacity .15s;-ms-transition:opacity .15s;-o-transition:opacity .15s;transition:opacity .15s}div.CodeMirror-lint-message-error,div.CodeMirror-lint-message-warning{padding-left:23px}#graphiql-container .CodeMirror-foldmarker{border-radius:4px;background:#08f;background:-webkit-linear-gradient(#43A8FF,#0F83E8);background:linear-gradient(#43A8FF,#0F83E8);box-shadow:0 1px 1px rgba(0,0,0,.2),inset 0 0 0 1px rgba(0,0,0,.1);color:#fff;font-family:arial;font-size:12px;line-height:0;margin:0 3px;padding:0 4px 1px;text-shadow:0 -1px rgba(0,0,0,.1)}#graphiql-container div.CodeMirror span.CodeMirror-matchingbracket{color:#555;text-decoration:underline}#graphiql-container div.CodeMirror span.CodeMirror-nonmatchingbracket{color:red}.cm-comment{color:#999}.cm-punctuation{color:#555}.cm-keyword{color:#B11A04}.cm-def{color:#D2054E}.cm-property{color:#1F61A0}.cm-qualifier{color:#1C92A9}.cm-attribute{color:#8B2BB9}.cm-number{color:#2882F9}.cm-string{color:#D64292}.cm-builtin{color:#D47509}.cm-string-2{color:#0B7FC7}.cm-variable{color:#397D13}.cm-meta{color:#B33086}.cm-atom{color:#CA9800}.CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror div.CodeMirror-cursor{border-left:1px solid #000}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.CodeMirror.cm-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7}.CodeMirror.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}@-moz-keyframes blink{0%,100%{background:#7e7}50%{background:0 0}}@-webkit-keyframes blink{0%,100%{background:#7e7}50%{background:0 0}}@keyframes blink{0%,100%{background:#7e7}50%{background:0 0}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:none;font-variant-ligatures:none}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected,.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}span.CodeMirror-selectedtext{background:0 0}#graphiql-container .doc-explorer{background:#fff}#graphiql-container .doc-explorer-title-bar{cursor:default;display:-webkit-flex;display:flex;height:34px;line-height:14px;padding:8px 8px 5px;position:relative;-webkit-user-select:none;user-select:none}#graphiql-container .doc-explorer-title{padding:10px 0 10px 10px;font-weight:700;text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow-x:hidden;-webkit-flex:1;flex:1}#graphiql-container .doc-explorer-back{color:#3B5998;cursor:pointer;margin:-7px 0 -6px -8px;overflow-x:hidden;padding:17px 12px 16px 16px;text-overflow:ellipsis;white-space:nowrap}#graphiql-container .doc-explorer-back:before{border-left:2px solid #3B5998;border-top:2px solid #3B5998;display:inline-block;height:9px;margin:0 3px -1px 0;position:relative;width:9px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}#graphiql-container .doc-explorer-rhs{position:relative}#graphiql-container .doc-explorer-contents{background-color:#fff;border-top:1px solid #d6d6d6;bottom:0;left:0;min-width:300px;overflow-y:auto;padding:20px 15px;position:absolute;right:0;top:47px}#graphiql-container .doc-type-description blockquote:first-child,#graphiql-container .doc-type-description p:first-child{margin-top:0}#graphiql-container .doc-explorer-contents a{cursor:pointer;text-decoration:none}#graphiql-container .doc-explorer-contents a:hover{text-decoration:underline}#graphiql-container .doc-value-description{padding:4px 0 8px 12px}#graphiql-container .doc-category{margin:20px 0}#graphiql-container .doc-category-title{border-bottom:1px solid #e0e0e0;color:#777;cursor:default;font-size:14px;font-variant:small-caps;font-weight:700;letter-spacing:1px;margin:0 -15px 10px 0;padding:10px 0;-webkit-user-select:none;user-select:none}#graphiql-container .doc-category-item{margin:12px 0;color:#555}#graphiql-container .keyword{color:#B11A04}#graphiql-container .type-name{color:#CA9800}#graphiql-container .field-name{color:#1F61A0}#graphiql-container .value-name{color:#0B7FC7}#graphiql-container .arg-name{color:#8B2BB9}#graphiql-container .arg:after{content:', '}#graphiql-container .arg:last-child:after{content:''}#graphiql-container .doc-alert-text{color:#F00F00;font-family:Consolas,Inconsolata,'Droid Sans Mono',Monaco,monospace;font-size:13px}#graphiql-container .search-box-outer{border:1px solid #d3d6db;box-sizing:border-box;display:inline-block;font-size:12px;height:24px;margin-bottom:12px;padding:3px 8px 5px;vertical-align:middle;width:100%}#graphiql-container .search-box-input{border:0;font-size:12px;margin:0;outline:0;padding:0;width:100%}.CodeMirror-foldmarker{color:#00f;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-folded,.CodeMirror-foldgutter-open{cursor:pointer}.CodeMirror-foldgutter-open:after{content:"\25BE"}.CodeMirror-foldgutter-folded:after{content:"\25B8"}.CodeMirror-lint-markers{width:16px}.CodeMirror-lint-tooltip{background-color:infobackground;border:1px solid #000;border-radius:4px;color:infotext;font-family:monospace;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;white-space:pre;white-space:pre-wrap;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-lint-mark-error,.CodeMirror-lint-mark-warning{background-position:left bottom;background-repeat:repeat-x}.CodeMirror-lint-mark-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==)}.CodeMirror-lint-mark-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=)}.CodeMirror-lint-marker-error,.CodeMirror-lint-marker-warning{background-position:center center;background-repeat:no-repeat;cursor:pointer;display:inline-block;height:16px;width:16px;vertical-align:middle;position:relative}.CodeMirror-lint-message-error,.CodeMirror-lint-message-warning{padding-left:18px;background-position:top left;background-repeat:no-repeat}.CodeMirror-lint-marker-error,.CodeMirror-lint-message-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=)}.CodeMirror-lint-marker-warning,.CodeMirror-lint-message-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=)}.CodeMirror-lint-marker-multiple{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC);background-repeat:no-repeat;background-position:right bottom;width:100%;height:100%}.CodeMirror-hints,.CodeMirror-hints-wrapper{background:#fff;position:absolute;z-index:10}#graphiql-container .spinner-container{position:absolute;top:50%;height:36px;width:36px;left:50%;transform:translate(-50%,-50%);z-index:10}#graphiql-container .spinner{vertical-align:middle;display:inline-block;height:24px;width:24px;position:absolute;-webkit-animation:rotation .6s infinite linear;-moz-animation:rotation .6s infinite linear;-o-animation:rotation .6s infinite linear;animation:rotation .6s infinite linear;border-left:6px solid rgba(150,150,150,.15);border-right:6px solid rgba(150,150,150,.15);border-bottom:6px solid rgba(150,150,150,.15);border-top:6px solid rgba(150,150,150,.8);border-radius:100%}@-webkit-keyframes rotation{from{-webkit-transform:rotate(0)}to{-webkit-transform:rotate(359deg)}}@-moz-keyframes rotation{from{-moz-transform:rotate(0)}to{-moz-transform:rotate(359deg)}}@-o-keyframes rotation{from{-o-transform:rotate(0)}to{-o-transform:rotate(359deg)}}@keyframes rotation{from{transform:rotate(0)}to{transform:rotate(359deg)}}.CodeMirror-hints{-webkit-box-shadow:0 1px 3px rgba(0,0,0,.45);-moz-box-shadow:0 1px 3px rgba(0,0,0,.45);box-shadow:0 1px 3px rgba(0,0,0,.45);font-family:Consolas,Inconsolata,'Droid Sans Mono',Monaco,monospace;font-size:13px;list-style:none;margin:0 0 0 -6px;max-height:14.5em;overflow-y:auto;overflow:hidden;padding:0}.CodeMirror-hints-wrapper{-webkit-box-shadow:0 1px 3px rgba(0,0,0,.45);-moz-box-shadow:0 1px 3px rgba(0,0,0,.45);box-shadow:0 1px 3px rgba(0,0,0,.45);margin-left:-6px}.CodeMirror-hints-wrapper .CodeMirror-hints{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;position:relative;margin-left:0;z-index:0}.CodeMirror-hint{border-top:solid 1px #f7f7f7;color:#141823;cursor:pointer;margin:0;max-width:300px;overflow:hidden;padding:2px 6px;white-space:pre}li.CodeMirror-hint-active{background-color:#08f;border-top-color:#fff;color:#fff}.CodeMirror-hint-information{border-top:solid 1px silver;max-width:300px;padding:4px 6px;position:relative;z-index:1}.CodeMirror-hint-information:first-child{border-bottom:solid 1px silver;border-top:none;margin-bottom:-1px}/*# sourceMappingURL=graphiql.min.css.map */ --------------------------------------------------------------------------------