我是graphql的新手。我想使用graphql在spring boot中实现后端。我仍然对 endpints 感到困惑。因此,如果我有 2 个实体用户和产品。所以我必须实现2个端点
@RequestMapping(value="/graphql/user", method=RequestMethod.POST, produces = "application/json")
public GraphQLResponse<Object> getService(@RequestHeader HttpHeaders headers, @RequestBody GraphQLRequest graphql) {
GraphQLResponse<Object> execute = graphQLService.execute(headers, graphql);
return execute;
}
像这样一个给用户,另一个给产品。或只有一个。