File uploads
GraphQL Mesh v0 documentation (superseded by v1): GraphQL Mesh enables easy file uploads with its built-in support for GraphQL Yoga server. Forward file uploads to sources with minimal configuration changes. Check out the example in the documentation for more details.
Thanks to its server based on GraphQL Yoga, GraphQL Mesh provides file upload support out of the box.
Similarly, just a few configuration changes will be necessary to forward file uploads to Sources.
Sources file uploads
The following Gateway integrates a “UploadFiles” Source that has file upload capabilities:
You will find the complete example in
examples/graphql-file-upload-example/.meshrc.yml.
Custom resolvers file uploads
Custom resolvers, programmatically provided by additionalResolvers, can also support File uploads
(ex: upload to S3).
For this, the only configuration step would be to define the File scalar to enable file uploads
and our file upload Mutation:
Then the resolvers would look as follows: