You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.
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?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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.
Beta Was this translation helpful? Give feedback.
All reactions