I want to integrate GraphQL into an application that already provides a rest api.
The application contains a RequestMapping that is used as fallback, if no Controller method exists for handling the request:
@Controller
@RequestMapping
public class FallbackController {
@RequestMapping("/**")
public void unmappedRequest(HttpServletRequest request) {
final String uri = request.getRequestURI();
throw new ResourceNotFoundException("There is no resource for path " + uri);
}
}
A corresponding ExceptionHandler exists, that converts the ResourceNotFoundException into a 404 JSON ResponseEntity.
Now having this RequestMapping in place, I get a 404 if I call any of the GraphQL Endpoints.
I want to integrate GraphQL into an application that already provides a rest api.
The application contains a
RequestMappingthat is used as fallback, if noControllermethod exists for handling the request:A corresponding
ExceptionHandlerexists, that converts the ResourceNotFoundException into a 404 JSON ResponseEntity.Now having this
RequestMappingin place, I get a 404 if I call any of the GraphQL Endpoints.