apollo-deprecated-highlight-client

1.0.4 • Public • Published

apollo deprecated highlight client

circleci codecov Known Vulnerabilities

This is the client of apollo-deprecated-highlight and apollo3-deprecated-highlight. The apollo-deprecated-highlight will generate the extensions.deprecations fields of the response. This client reads the extensions of the response and generate console warn to let the engineer can see the warning message in the console.

How to use it

Make sure you've installed apollo-deprecated-highlight and the response has extensions.deprecations attribute.

Then add ApolloDeprecatedHighlightClient as a middleware of ApolloLink

const link = new ApolloLink((operation, forward) => {
        ...
        return forward(operation).map(ApolloDeprecatedHighlightClient(operation));
    });

The console will print out the warning message if there are deprecations in the response:

🚨 <deprecated field> in <operation> is deprecated. Because <deprecated reason>

Example

Here is the example project

Here are the console outputs example

Readme

Keywords

Package Sidebar

Install

npm i apollo-deprecated-highlight-client

Weekly Downloads

5

Version

1.0.4

License

ISC

Unpacked Size

176 kB

Total Files

17

Last publish

Collaborators

  • alexxiyang