Skip to content

Commit 265fa29

Browse files
committed
Add section on file uploads
Backport of 142ca8 Closes gh-748
1 parent 4d62822 commit 265fa29

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

spring-graphql-docs/src/docs/asciidoc/index.adoc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,25 @@ The Spring for GraphQL repository contains a Spring MVC
7070
{github-main-branch}/samples/webmvc-http[HTTP sample] application.
7171

7272

73+
[[server.transports.http.fileupload]]
74+
==== File Upload
75+
76+
As a protocol GraphQL focuses on the exchange of textual data. This doesn't include binary
77+
data such as images, but there is a separate, informal
78+
https://github.com/jaydenseric/graphql-multipart-request-spec[graphql-multipart-request-spec]
79+
that allows file uploads with GraphQL over HTTP.
80+
81+
Spring for GraphQL does not support the `graphql-multipart-request-spec` directly.
82+
While the spec does provide the benefit of a unified GraphQL API, the actual experince has
83+
led to a number of issues, and best practice recommendations have evolved, see
84+
https://www.apollographql.com/blog/backend/file-uploads/file-upload-best-practices/[Apollo Server File Upload Best Practices]
85+
for a more detailed discussion.
86+
87+
If you would like to use `graphql-multipart-request-spec` in your application, you can
88+
do so through the library
89+
https://github.com/nkonev/multipart-spring-graphql[multipart-spring-graphql].
90+
91+
7392

7493
[[server-websocket]]
7594
=== WebSocket

0 commit comments

Comments
 (0)