@RestController public abstract class GraphQLController<R> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected GraphQLExecutor<R> |
executor |
protected graphql.GraphQL |
graphQL |
| Constructor and Description |
|---|
GraphQLController(graphql.GraphQL graphQL,
GraphQLExecutor<R> executor) |
| Modifier and Type | Method and Description |
|---|---|
Object |
executeFormPost(Map<String,String> queryParams,
GraphQLRequest graphQLRequest,
R request) |
Object |
executeGet(GraphQLRequest graphQLRequest,
R request) |
Object |
executeGetEventStream(GraphQLRequest graphQLRequest,
R request) |
Object |
executeGraphQLPost(String queryBody,
GraphQLRequest originalReq,
R request) |
Object |
executeJsonPost(GraphQLRequest requestBody,
GraphQLRequest requestParams,
R request) |
Object |
executeJsonPostEventStream(GraphQLRequest requestBody,
GraphQLRequest requestParams,
R request) |
Object |
jsonPost(GraphQLRequest requestBody,
GraphQLRequest requestParams,
R request,
TransportType transportType) |
protected final graphql.GraphQL graphQL
protected final GraphQLExecutor<R> executor
public GraphQLController(graphql.GraphQL graphQL,
GraphQLExecutor<R> executor)
@PostMapping(value="${graphql.spqr.http.endpoint:/graphql}",
consumes="application/json",
produces="application/json")
public Object executeJsonPost(@RequestBody
GraphQLRequest requestBody,
GraphQLRequest requestParams,
R request)
@PostMapping(value="${graphql.spqr.http.endpoint:/graphql}",
produces="text/event-stream")
public Object executeJsonPostEventStream(@RequestBody
GraphQLRequest requestBody,
GraphQLRequest requestParams,
R request)
public Object jsonPost(GraphQLRequest requestBody, GraphQLRequest requestParams, R request, TransportType transportType)
@PostMapping(value="${graphql.spqr.http.endpoint:/graphql}",
consumes={"application/graphql","application/graphql;charset=UTF-8"},
produces="application/json")
public Object executeGraphQLPost(@RequestBody
String queryBody,
GraphQLRequest originalReq,
R request)
@RequestMapping(method=POST,
value="${graphql.spqr.http.endpoint:/graphql}",
consumes={"application/x-www-form-urlencoded","application/x-www-form-urlencoded;charset=UTF-8"},
produces="application/json")
public Object executeFormPost(@RequestParam
Map<String,String> queryParams,
GraphQLRequest graphQLRequest,
R request)
@GetMapping(value="${graphql.spqr.http.endpoint:/graphql}",
produces="application/json",
headers={"Connection!=Upgrade","Connection!=keep-alive, Upgrade"})
public Object executeGet(GraphQLRequest graphQLRequest,
R request)
@GetMapping(value="${graphql.spqr.http.endpoint:/graphql}",
produces="text/event-stream",
headers={"Connection!=Upgrade","Connection!=keep-alive, Upgrade"})
public Object executeGetEventStream(GraphQLRequest graphQLRequest,
R request)
Copyright © 2018–2021. All rights reserved.