Class GraphQLFilesUploadController

java.lang.Object
io.leangen.graphql.spqr.spring.web.GraphQLController<org.springframework.web.context.request.NativeWebRequest>
io.jmix.graphql.controller.GraphQLFilesUploadController

@RestController("graphql_FilesController") @CrossOrigin public class GraphQLFilesUploadController extends io.leangen.graphql.spqr.spring.web.GraphQLController<org.springframework.web.context.request.NativeWebRequest>
  • Field Details

  • Constructor Details

    • GraphQLFilesUploadController

      @Autowired public GraphQLFilesUploadController(graphql.GraphQL graphQL, io.leangen.graphql.spqr.spring.web.mvc.GraphQLMvcExecutor executor)
  • Method Details

    • executeMultipartPost

      @PostMapping(value="${graphql.spqr.http.endpoint:/graphql}", consumes="multipart/form-data") @ResponseBody public Object executeMultipartPost(@RequestParam("operations") String operations, @RequestParam("map") String map, @RequestParam(value="storageName",required=false) String storageName, org.springframework.web.multipart.MultipartHttpServletRequest multiPartRequest, org.springframework.web.context.request.NativeWebRequest webRequest) throws Exception
      For Requests that follow the GraphQL Multipart Request Spec from: https://github.com/jaydenseric/graphql-multipart-request-spec

      The Request contains the following parts: operations: JSON String with the GQL Query map: Maps the multipart files to the variables of the GQL Query

      Throws:
      Exception
    • checkFileUploadPermission

      public void checkFileUploadPermission()
    • uploadFile

      @PostMapping(path="${graphql.spqr.http.endpoint:/graphql/files}", consumes="!multipart/form-data") public org.springframework.http.ResponseEntity<FileInfoResponse> uploadFile(javax.servlet.http.HttpServletRequest request, @RequestParam(required=false) String name, @RequestParam(required=false) String storageName)
      Method for simple file upload. File contents are placed in the request body. Optional file name parameter is passed as a query param.
    • uploadFile

      @PostMapping(path="${graphql.spqr.http.endpoint:/graphql/files}", consumes="multipart/form-data") public org.springframework.http.ResponseEntity<FileInfoResponse> uploadFile(@RequestParam("file") org.springframework.web.multipart.MultipartFile file, @RequestParam(required=false) String name, @RequestParam(required=false) String storageName, javax.servlet.http.HttpServletRequest request)
      Method for multipart file upload. It expects the file contents to be passed in the part called 'file'.