New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

apollo-deprecated-highlight

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-deprecated-highlight

Highlight the apollo graphql deprecated fields

  • 1.1.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
decreased by-54.17%
Maintainers
1
Weekly downloads
 
Created
Source

apollo-deprecated-highlight

Highlight the apollo graphql deprecated fields.

We know that even you mark a field in apollo-server as @deprecated the client-side won't be able to know it until execute introspection queries. This package is for showing the deprecations in the response so that the engineers can know which fields are deprecated when they are developing.

How to use

import { ApolloDeprecatedHighlight } from 'apollo-deprecated-highlight';

// add ApolloDeprecatedHighlight() as plugin
const server = new ApolloServer({
    typeDefs,
    resolvers,
    plugins: [ApolloDeprecatedHighlight()],
    ...
});

Then it will add deprecations to extensions of graphql respons. The response format will be

{
    "data": {...},
    "extensions": {
        "deprecations": [
            <deprecation1>,
            <deprecation2>,
            ...
        ]
    }
}

Example

"data": {...},
"extensions":
    {
        "deprecations":
        [
            {
                "field": "timerange",
                "reason": "timerange is retired. Please use timerangeInSecond"
            },
            {
                "field": "height",
                "reason": "height is retired. Please use heightInCM"
            },
        ]
    }

FAQs

Package last updated on 01 Jan 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc