@gql-vis/exporter
TypeScript icon, indicating that this package has built-in type declarations

0.0.0-alpha.10 • Public • Published

@gql-vis/exporter

You should use the exporter if you want to extend the plugin ecosystem or you want to send custom API calls and responses to your collector.

Installation

npm install @gql-vis/exporter

Usage

import { Exporter } from "@gql-vis/exporter";

const exporter = new Exporter({
  apiKey: `YOUR-API-KEY`,
  url: `https://app.graphqlanalyzer.com/api/v1/collector`,
});

const payload = {
  body: {
    query: `query { hello }`,
    params: {},
  },
  headers: {},
  method: "POST",
  type: "GRAPHQL",
  url: "http://127.0.0.1:5000/graphql",
};

const { givenUUID } = exporter.apiCall(payload);

// Do the network call here

exporter.apiResponse({
  body: {
    data: {
      hello: "world",
    },
  },
  givenUUID,
  statusCode: 200,
});

License

MIT - https://graphqlvisualizer.com/

Readme

Keywords

none

Package Sidebar

Install

npm i @gql-vis/exporter

Weekly Downloads

4

Version

0.0.0-alpha.10

License

MIT

Unpacked Size

9.01 kB

Total Files

12

Last publish

Collaborators

  • kadir-gql