Skip to content

Commit

Permalink
Add section on file uploads
Browse files Browse the repository at this point in the history
Backport of 142ca8

Closes gh-748
  • Loading branch information
rstoyanchev committed Sep 14, 2023
1 parent 4d62822 commit 265fa29
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spring-graphql-docs/src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,25 @@ The Spring for GraphQL repository contains a Spring MVC
{github-main-branch}/samples/webmvc-http[HTTP sample] application.


[[server.transports.http.fileupload]]
==== File Upload

As a protocol GraphQL focuses on the exchange of textual data. This doesn't include binary
data such as images, but there is a separate, informal
https://github.com/jaydenseric/graphql-multipart-request-spec[graphql-multipart-request-spec]
that allows file uploads with GraphQL over HTTP.

Spring for GraphQL does not support the `graphql-multipart-request-spec` directly.
While the spec does provide the benefit of a unified GraphQL API, the actual experince has
led to a number of issues, and best practice recommendations have evolved, see
https://www.apollographql.com/blog/backend/file-uploads/file-upload-best-practices/[Apollo Server File Upload Best Practices]
for a more detailed discussion.

If you would like to use `graphql-multipart-request-spec` in your application, you can
do so through the library
https://github.com/nkonev/multipart-spring-graphql[multipart-spring-graphql].



[[server-websocket]]
=== WebSocket
Expand Down

0 comments on commit 265fa29

Please sign in to comment.