GraphQL Upload
In gqless
you can add File Upload
support easily, following the GraphQL multipart request specification.
#
PreparationNormally, in the API servers, they implement graphql-upload, inbuilt in Apollo Server, or via mercurius-upload for Fastify.
Meanwhile in the client, to follow the GraphQL multipart spec, you can easily use extract-files.
- pnpm
- npm
- yarn
And then, use it in your QueryFetcher
, like the following example:
Compatible with browser's File and Blob, and React Native using ReactNativeFile
#
Usage#
CoreSince the images are not serializable, gqless
might be confused while
using them, that's why you have to specify a special option nonSerializableVariables
in your resolved
s
#
ReactSince the images are not serializable, gqless
might be confused while
using them, that's why you have to specify a special option nonSerializableVariables
in your useMutation
s