apollo-deprecated-highlight
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -1,2 +0,2 @@ | ||
export declare const deprecatedPlugin: () => { | ||
export declare const apolloDeprecatedHighlight: () => { | ||
requestDidStart: (initialRequestContext: any) => Promise<{ | ||
@@ -3,0 +3,0 @@ executionDidStart(executionRequestContext: any): Promise<{ |
@@ -39,5 +39,6 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.deprecatedPlugin = void 0; | ||
exports.apolloDeprecatedHighlight = void 0; | ||
var graphql_1 = require("graphql"); | ||
var deprecatedPlugin = function () { | ||
var utils_1 = require("./utils"); | ||
var apolloDeprecatedHighlight = function () { | ||
return { | ||
@@ -55,4 +56,4 @@ requestDidStart: function (initialRequestContext) { return __awaiter(void 0, void 0, void 0, function () { | ||
var source = _a.source, args = _a.args, contextValue = _a.contextValue, info = _a.info; | ||
var fieldDef = getFieldDef(info); | ||
var directive = info.schema.getDirective('deprecated'); | ||
var fieldDef = (0, utils_1.getFieldDef)(info); | ||
var directive = (0, utils_1.getSchemaDirective)(info, 'deprecated'); | ||
var fieldAstNode = fieldDef.astNode; | ||
@@ -98,6 +99,2 @@ if (!directive || !fieldAstNode) { | ||
}; | ||
exports.deprecatedPlugin = deprecatedPlugin; | ||
function getFieldDef(info) { | ||
var parentTypeFields = info.parentType.getFields(); | ||
return parentTypeFields[info.fieldName]; | ||
} | ||
exports.apolloDeprecatedHighlight = apolloDeprecatedHighlight; |
{ | ||
"name": "apollo-deprecated-highlight", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"author": "Alex <alexxiyang@gmail.com>", | ||
@@ -9,3 +9,4 @@ "description": "Highlight the apollo graphql deprecated fields", | ||
"test": "jest", | ||
"build": "tsc" | ||
"build": "tsc", | ||
"publish": "npx jest && npx tsc && npm publish --access public" | ||
}, | ||
@@ -12,0 +13,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
48209
8
119