Socket
Socket
Sign inDemoInstall

@apollo-link-debug/handle-timer

Package Overview
Dependencies
37
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @apollo-link-debug/handle-timer

Describes the amount of time taken to process a GraphQL response via apollo.


Version published
Weekly downloads
23
increased by187.5%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Describes the amount of time taken to process a GraphQL response via apollo.

Installation

npm i @apollo-link-debug/handle-timer
# - or -
yarn add @apollo-link-debug/handle-timer

Usage

import { ApolloClient, ApolloLink, InMemoryCache } from '@apollo/client';
import { createTimerLink } from '@apollo-link-debug/handle-timer';

const client = new ApolloClient({
  uri: 'https://localhost:3000/',
  cache: new InMemoryCache(),
  link: ApolloLink.from([createTimerLink()]),
});

const query = client.query({
  query: gql`query MyOperationName { ... }`,
  variables: {
    variableName: 'variableValue',
  },
});

Example output:

MyOperationName took 0.3 sec

Options

onResponse: ({ operation, timerStart, timerEnd, difference }) => void

A callback which occurs on every GraphQL response from the server. The default is to log the operation name and value of difference which describes the number of seconds between the start and end time.

FAQs

Last updated on 14 Jun 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc