webtau icon indicating copy to clipboard operation
webtau copied to clipboard

GraphQL DSL - override request and response command line rendering

Open tsiq-karold opened this issue 5 years ago • 2 comments

Currently a response looks like this:

> executing HTTP POST http://127.0.0.1:52641/graphql
request (application/json):
{
  "query": "
query {
    allTasks(uncompletedOnly: false) {
        id
        description
    }
}
"
}

We should render this in a GraphQL specific manner, i.e. show query pretty printed, show variables (this could be json), etc.

tsiq-karold avatar Aug 05 '20 16:08 tsiq-karold

since it is going to be performed inside http module (at least for now), what could be an indicator to use a different render? content-type seems like is not enough due to it actually being (application/json). Do we have some other meta that we could use to pick a different render?

MykolaGolubyev avatar Aug 05 '20 16:08 MykolaGolubyev

Nothing 100% robust but a combination of the following may be enough:

  • POST to /graphql (or whatever other combination we end up supporting)
  • application/json
  • presence of query field in request

tsiq-karold avatar Aug 05 '20 16:08 tsiq-karold

closing as not active

MykolaGolubyev avatar Jan 06 '23 17:01 MykolaGolubyev