This repository was archived by the owner on Dec 19, 2023. It is now read-only.
Repository navigation
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Is it possible to transfer a picture from the back to the front as a Upload file?
If you save on the back, then everything works out. But is it realistic to send a photo file back to the front via GraphQl?
What I did to transfer the image from front to back:




Adding a new data type for a file:
Look, I get javax.servlet.http.Part when I upload a photo. At the front we get the data through the Apollo hook useQuery/useMutation:
Next, you will need to define scalar Upload in the sсhema.graphqls file:
The most important thing is not to forget to write the method in Mutations in the sсhema.graphqls file:
But how do I send the photo back to the front?
How to write a method signature in the sсhema.graphqls file in Query section and in the implementation of this method in GraphQLMutationResolver?
Please write more documentation on this topic.
All reactions