kowainik / github-graphql

🕸️ GraphQL bindings to GitHub API
https://kowainik.github.io/projects/github-graphql
Mozilla Public License 2.0
7 stars 0 forks source link

Implement endpoint that will take Query and call the real API #13

Closed chshersh closed 3 years ago

chshersh commented 3 years ago

For now, it can return ByteString if we want to avoid dependencies on aeson and let users decide what library to use aeson or microaeson or something else.

The function should take token and a query. An example curl command looks like this:

$ curl -H "Authorization: bearer token" -X POST -d " \
 { \
   \"query\": \"query { viewer { login }}\" \
 } \
" https://api.github.com/graphql

I think, we can use the httpLbs function to call server and http-client-tls library for creating TLS manager:

It's a bit heavy on the dependencies side but that's the only Haskell-only solution... Maybe we can just use curl? 🤔