diff --git a/README.md b/README.md index 0b63dbce..cf53b7c7 100644 --- a/README.md +++ b/README.md @@ -142,26 +142,23 @@ Server can host multiple schemas (all are registered at the startup time). To run query against particular schema - HTTP header `graphql-schema` parameter passed along with the query should contain graphql schema name of interest. ```yaml -spring: - application: - name: graphql-todo-app - graphql: - server: - mapping: /graphql - corsEnabled: true - suppressSpringResponseCodes: true - query-key: query - variables-key: variables - uploadMaxFileSize: 128KB - uploadMaxRequestSize: 128KB - schema: - clientMutationIdName: clientMutationId - injectClientMutationId: true - allowEmptyClientMutationId: false - mutationInputArgumentName: input - outputObjectNamePrefix: Payload - inputObjectNamePrefix: Input - schemaMutationObjectName: Mutation +graphql: + server: + mapping: /graphql + corsEnabled: true + suppressSpringResponseCodes: true + query-key: query + variables-key: variables + uploadMaxFileSize: 128KB + uploadMaxRequestSize: 128KB + schema: + clientMutationIdName: clientMutationId + injectClientMutationId: true + allowEmptyClientMutationId: false + mutationInputArgumentName: input + outputObjectNamePrefix: Payload + inputObjectNamePrefix: Input + schemaMutationObjectName: Mutation ``` To facilitate access from Nodejs frontend to GraphQL backend by default system enables global CORS filter for `/graphql/**` context. diff --git a/graphql-sample-app/src/main/resources/application.yml b/graphql-sample-app/src/main/resources/application.yml index 464162ca..a4ce251c 100644 --- a/graphql-sample-app/src/main/resources/application.yml +++ b/graphql-sample-app/src/main/resources/application.yml @@ -1,22 +1,22 @@ spring: application: name: graphql-todo-app - graphql: - server: - mapping: /graphql - corsEnabled: true - suppressSpringResponseCodes: true - query-key: query - variables-key: variables - uploadMaxFileSize: 128KB - uploadMaxRequestSize: 128KB - schema: - clientMutationIdName: clientMutationId - injectClientMutationId: true - allowEmptyClientMutationId: false - mutationInputArgumentName: input - outputObjectNamePrefix: Payload - inputObjectNamePrefix: Input - schemaMutationObjectName: Mutation server: - port: 9000 \ No newline at end of file + port: 9000 +graphql: + server: + mapping: /graphql + corsEnabled: true + suppressSpringResponseCodes: true + query-key: query + variables-key: variables + uploadMaxFileSize: 128KB + uploadMaxRequestSize: 128KB + schema: + clientMutationIdName: clientMutationId + injectClientMutationId: true + allowEmptyClientMutationId: false + mutationInputArgumentName: input + outputObjectNamePrefix: Payload + inputObjectNamePrefix: Input + schemaMutationObjectName: Mutation diff --git a/graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLProperties.java b/graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLProperties.java index 4dcd55b4..11efce98 100644 --- a/graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLProperties.java +++ b/graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLProperties.java @@ -27,7 +27,7 @@ * @author oEmbedler Inc. */ @Configuration -@ConfigurationProperties(prefix = "spring.graphql") +@ConfigurationProperties(prefix = "graphql") public class GraphQLProperties { @NestedConfigurationProperty diff --git a/graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLServerController.java b/graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLServerController.java index 5f3ae45f..f00df3da 100644 --- a/graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLServerController.java +++ b/graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLServerController.java @@ -42,7 +42,7 @@ * @author oEmbedler Inc. */ @RestController -@RequestMapping("${spring.graphql.server.mapping:/graphql}") +@RequestMapping("${graphql.server.mapping:/graphql}") public class GraphQLServerController { private static final Logger LOGGER = LoggerFactory.getLogger(GraphQLServerController.class); diff --git a/graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLWebAutoConfiguration.java b/graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLWebAutoConfiguration.java index 2c170a02..39df2d3b 100644 --- a/graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLWebAutoConfiguration.java +++ b/graphql-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/graphql/boot/GraphQLWebAutoConfiguration.java @@ -49,11 +49,11 @@ public class GraphQLWebAutoConfiguration { private static final String DEFAULT_UPLOAD_MAX_FILE_SIZE = "128KB"; private static final String DEFAULT_UPLOAD_MAX_REQUEST_SIZE = "128KB"; - @Value("${spring.graphql.server.mapping:/graphql}") + @Value("${graphql.server.mapping:/graphql}") private String graphQLServerMapping; @Bean - @ConditionalOnProperty(value = "spring.graphql.server.corsEnabled", havingValue = "true", matchIfMissing = true) + @ConditionalOnProperty(value = "graphql.server.corsEnabled", havingValue = "true", matchIfMissing = true) public WebMvcConfigurer corsConfigurer() { return new WebMvcConfigurerAdapter() { @Override @@ -71,7 +71,7 @@ public GraphQLServerController basicGraphQLController() { @Bean @ConditionalOnMissingBean(GlobalDefaultExceptionHandler.class) - @ConditionalOnProperty(value = "spring.graphql.server.suppressSpringResponseCodes", havingValue = "true", matchIfMissing = true) + @ConditionalOnProperty(value = "graphql.server.suppressSpringResponseCodes", havingValue = "true", matchIfMissing = true) public GlobalDefaultExceptionHandler globalDefaultExceptionHandler() { return new GlobalDefaultExceptionHandler(); }