Socket
Socket
Sign inDemoInstall

@apollo-link-debug/handle-request

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-request

Debugs the operation name and variables used for a GraphQL request via apollo.


Version published
Maintainers
1
Created

Readme

Source

Debugs the operation name and variables used for a GraphQL request via apollo.

Installation

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

Usage

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

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

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

Example output:

MyOperationName {
  "variableName": "variableValue"
}

Options

onRequest: ({ operation }) => void

A callback which occurs on every GraphQL request as the request is made. The default is to log the operation name and the variables (as JSON) used for the query.

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