I've been playing around with "graphql-request" and I like it because of it's simplicity. Is there any way of returning the http status code from my request also? Currently the following doesn't work (response.status):
const {request} = require('graphql-request');
const query = `{
Post(id: 1) {
id
title
views
User {
name
}
Comments {
date
body
}
}
}`;
request('http://localhost:3000', query)
.then(response => console.log(response.status))
.catch(err => { throw new Error(err); });
The Documentation doesn't cover returning status codes. Hopefully it's possible. Thanks.