Refine use of "query" in type and method names
Following revisions in the spec https://github.com/graphql/graphql-spec/pull/777, this commit applies similar changes to type and method names where feasible. The chief exception for now is the use of "query" for request input since that is what it is called in the JSON for GraphQL over HTTP.
This commit is contained in:
@@ -23,7 +23,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
public class GraphQLProperties {
|
||||
|
||||
/**
|
||||
* Path of the GraphQL HTTP query endpoint.
|
||||
* Path at which to expose a GraphQL request HTTP endpoint.
|
||||
*/
|
||||
private String path = "/graphql";
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ public class WebFluxGraphQLAutoConfiguration {
|
||||
}
|
||||
RouterFunctions.Builder builder = RouterFunctions.route()
|
||||
.GET(path, req -> ServerResponse.ok().bodyValue(resource))
|
||||
.POST(path, accept(MediaType.APPLICATION_JSON).and(contentType(MediaType.APPLICATION_JSON)), handler::handleQuery);
|
||||
.POST(path, accept(MediaType.APPLICATION_JSON).and(contentType(MediaType.APPLICATION_JSON)), handler::handleRequest);
|
||||
if (properties.getSchema().getPrinter().isEnabled()) {
|
||||
SchemaPrinter schemaPrinter = new SchemaPrinter();
|
||||
builder = builder.GET(path + properties.getSchema().getPrinter().getPath(),
|
||||
|
||||
@@ -83,7 +83,7 @@ public class WebMvcGraphQLAutoConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RouterFunction<ServerResponse> graphQLQueryEndpoint(GraphQLHttpHandler handler, GraphQLSource graphQLSource,
|
||||
public RouterFunction<ServerResponse> graphQLRouterFunction(GraphQLHttpHandler handler, GraphQLSource graphQLSource,
|
||||
GraphQLProperties properties, ResourceLoader resourceLoader) {
|
||||
|
||||
String path = properties.getPath();
|
||||
@@ -93,7 +93,7 @@ public class WebMvcGraphQLAutoConfiguration {
|
||||
}
|
||||
RouterFunctions.Builder builder = RouterFunctions.route()
|
||||
.GET(path, req -> ServerResponse.ok().body(resource))
|
||||
.POST(path, contentType(MediaType.APPLICATION_JSON).and(accept(MediaType.APPLICATION_JSON)), handler::handle);
|
||||
.POST(path, contentType(MediaType.APPLICATION_JSON).and(accept(MediaType.APPLICATION_JSON)), handler::handleRequest);
|
||||
if (properties.getSchema().getPrinter().isEnabled()) {
|
||||
SchemaPrinter schemaPrinter = new SchemaPrinter();
|
||||
builder = builder.GET(path + properties.getSchema().getPrinter().getPath(),
|
||||
@@ -122,7 +122,7 @@ public class WebMvcGraphQLAutoConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public HandlerMapping graphQLWebSocketEndpoint(GraphQLWebSocketHandler handler, GraphQLProperties properties) {
|
||||
public HandlerMapping graphQLWebSocketMapping(GraphQLWebSocketHandler handler, GraphQLProperties properties) {
|
||||
String path = properties.getWebsocket().getPath();
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("GraphQL endpoint WebSocket " + path);
|
||||
|
||||
Reference in New Issue
Block a user