v0PluginsHTTP Details in extensions
⚠️
This is the documentation for the old GraphQL Mesh version v0. We recommend upgrading to the latest GraphQL Mesh version v1.

Migrate to GraphQL Mesh v1

HTTP Details Extensions

You can expose the details of outgoing HTTP requests done by GraphQL Mesh source handlers within extensions property of the GraphQL execution.

Getting Started

npm i @graphql-mesh/plugin-http-details-extensions
.meshrc.yaml
plugins:
  - httpDetailsExtensions:
      if: "env.NODE_ENV === 'development'"

Then you get the results like below;

{
  "data": {
    "someData": "someResult"
  },
  "extensions": {
    "httpDetails": [
      {
        "sourceName": "MySource",
        "path": {
          "key": "sourceFieldName"
        },
        "request": {
          "timestamp": "2020-01-01T00:00:00.000Z",
          "url": "http://localhost:8080/some-external-service/some-path",
          "method": "GET",
          "headers": {
            "Accept": "application/json",
            "Content-Type": "application/json"
          }
        },
        "response": {
          "timestamp": "2020-01-01T00:00:00.000Z",
          "status": 200,
          "statusText": "OK",
          "headers": {
            "Content-Type": "application/json"
          }
        },
        "responseTime": 9999
      }
    ]
  }
}