Skip to content

Commit 142ca8c

Browse files
committed
Add section on file uploads
Closes gh-747
1 parent db525f1 commit 142ca8c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

spring-graphql-docs/src/docs/asciidoc/includes/transports.adoc

+17
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,23 @@ it contains, for the actual config.
3232
The 1.0.x branch of this repository contains a Spring MVC
3333
{github-10x-branch}/samples/webmvc-http[HTTP sample] application.
3434

35+
[[server.transports.http.fileupload]]
36+
=== File Upload
37+
38+
As a protocol GraphQL focuses on the exchange of textual data. This doesn't include binary
39+
data such as images, but there is a separate, informal
40+
https://github.com/jaydenseric/graphql-multipart-request-spec[graphql-multipart-request-spec]
41+
that allows file uploads with GraphQL over HTTP.
42+
43+
Spring for GraphQL does not support the `graphql-multipart-request-spec` directly.
44+
While the spec does provide the benefit of a unified GraphQL API, the actual experince has
45+
led to a number of issues, and best practice recommendations have evolved, see
46+
https://www.apollographql.com/blog/backend/file-uploads/file-upload-best-practices/[Apollo Server File Upload Best Practices]
47+
for a more detailed discussion.
48+
49+
If you would like to use `graphql-multipart-request-spec` in your application, you can
50+
do so through the library
51+
https://github.com/nkonev/multipart-spring-graphql[multipart-spring-graphql].
3552

3653

3754
[[server.transports.websocket]]

0 commit comments

Comments
 (0)