1.0.0 • Published 2 years ago

kensats v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

KensaTS

A lightweight package to gather metrics from your GraphQL Apollo Server queries.

Getting Started

To be able to test your GraphQL application install our package following these instructions.

Note: Currently supporting GraphQL Apollo Server only.

Prerequisites

You need to have a backend server built using GraphQL Apollo Server. Go to the GraphQL to learn more about using GraphQL with Apollo Server.

Have an account with Kensa. Visit Kensa and sign up for an account to get full access to the Kensa web app.

Installing

Install the KensaTS Package into your project

npm install kensats

In your server file, import the following plugins from kensats:

import { kensaPlugin, getContext} from 'kensats';
  const apolloServer = new ApolloServer({
    typeDefs,
    resolvers,
    plugins: [kensaPlugin]
  }); 

Get the API key from the project you are going to be testing by clicking on the info button.

And paste it on your server file

 const api = '65b00bbe-3b3b-4fea-8d3f-de3a84338914';
  app.use('/graphql', cors(), bodyParser.json(), expressMiddleware(apolloServer, {
    // when referencing the database in resolvers, use 'db' when deconstructing context object
    context: async ({req, res}: any) => (await getContext({req, res}, api, testDb))
  }));

Authors

  • Brian Peinado
  • Tommy Li
  • Brian Pham
  • Raymond Kim

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details