Skip to content

Commit cd35c83

Browse files
committed
Add section on file uploads
Backport of 142ca8 Closes gh-749
1 parent 372feab commit cd35c83

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
@@ -60,6 +60,25 @@ The 1.0.x branch of this repository contains a Spring MVC
6060
{github-10x-branch}/samples/webmvc-http[HTTP sample] application.
6161

6262

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

6483
[[server.transports.websocket]]
6584
=== WebSocket

0 commit comments

Comments
 (0)