1.0.4 • Published 10 months ago

artillery-apollo-link v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

artillery-apollo-link

This link for Apollo Client allows logging GraphQL requests in YAML format for Artillery. Before getting started, consult the documentation for Artillery and Apollo Client.

Read the artillery doc

Read the Apollo client link doc

How to install

npm install artillery-apollo-link

How to use

import {reateArtilleryApolloLink} from 'artillery-apollo-link';

const artilleryLink = createArtilleryApolloLink({
  name: 'My first scenario',
  url: '/',
  headers: {
    Authorization: 'Bearer XXXXXXX',
  },
});

Add the link in the apollo client constructor just before the httpLink

Config

PropertyRequiredDescription
nametrueThe scenario name
urltrueThe GQL endpoint
headersfalsekey / value object of headers
thinkMapperfalse(timeMs:number) => string. used to map time value
disabledfalsedefault false, disable logs

thinkMappercan be used with a processor like this :

thinkMapper:(timeMs:Number) => `addRandomTime( {{ timeMs }})`;
1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago