webtau
webtau copied to clipboard
GraphQL DSL - override request and response command line rendering
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.
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?
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
closing as not active