MCPcopy Create free account
hub / github.com/github/docs / getDeprecationReason

Function getDeprecationReason

src/graphql/scripts/utils/schema-helpers.js:41–52  ·  view source on GitHub ↗
(directives, schemaMember)

Source from the content-addressed store, hash-verified

39}
40
41async function getDeprecationReason(directives, schemaMember) {
42 if (!schemaMember.isDeprecated) return
43
44 // it's possible for a schema member to be deprecated and under preview
45 const deprecationDirective = directives.filter((dir) => dir.name.value === 'deprecated')
46
47 // catch any schema members that have more than one deprecation (none currently)
48 if (deprecationDirective.length > 1)
49 console.log(`more than one deprecation found for ${schemaMember.name}`)
50
51 return renderContent(deprecationDirective[0].arguments[0].value.value)
52}
53
54function getDeprecationStatus(directives) {
55 if (!directives.length) return

Callers

nothing calls this directly

Calls 1

renderContentFunction · 0.85

Tested by

no test coverage detected