Answer the question
In order to leave comments, you need to log in
How to formulate the request body to Graphql using npm request?
There is a fetch post request in which the body is:
"{\"operationName\":\"add\",\"variables\":{\"id\":\"AAAAAAAAAA\",\"lang\":\"en\"},\"query\ ":\"GRAPHQL QUERY\"}"
Answer the question
In order to leave comments, you need to log in
Let's leave the question why are you torturing yourself in the presence of the coolest and most convenient libraries for working with graphql behind the scenes.
How to do it - create a valid HTTP request according to the specification. Too lazy to dig, but in my opinion there is just a post-request with a query in the form of json in the request body.
How to convert this body to request-npm?
but nothing worked
Tried formData, form, qs,
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question