machinebox / graphql

Simple low-level GraphQL HTTP client for Go
https://blog.machinebox.io/a-graphql-client-library-for-go-5bffd0455878
Apache License 2.0
933 stars 218 forks source link

Getting Error :"Must Provide Query String" #7

Open opiuman opened 6 years ago

opiuman commented 6 years ago

A simple query request is working via the "GraphQL Playground" against our GraphQL server. However, it's getting error "Must Provide Query String" while using your package to make the request.

Not sure if that's because of the ContentType (multipart/form-data vs application/json). That's definitely a blocker.

matryer commented 6 years ago

Can you shed some light on to what your server expects?

ghost commented 6 years ago

Header content type for sure, try example like this:

echo '{ hello }' | http POST localhost:4000/graphql 'Content-Type:application/graphql'

matryer commented 6 years ago

Please update and try again following https://github.com/machinebox/graphql/pull/15.