On this page

HTTP Details Extensions

GraphQL Mesh v0 documentation (superseded by v1): Expose outgoing HTTP requests details from GraphQL Mesh source handlers in extensions for better monitoring with @graphql-mesh/plugin-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
      }
    ]
  }
}