1

I use graphql-yoga for my graphql server and I want to extract a status code under formatResponse:

  Query: {
    get_foo: () => {
      return fetch(URL).then(res => res.json());
    },
const options = {
  ...
  // A function applied to each response after execution
  formatResponse,
};
const formatResponse = (res) => {
   console.log(res);
};

I tried to print both res, req but the response (res) doesn't store a status code field.

A. Karnaval
  • 727
  • 2
  • 8
  • 12

0 Answers0