Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
sdl-schema-analyzer
Advanced tools
An analyzer to extract info about your schema
npm install --save sdl-schema-analyzer
const SchemaAnalyzer = require('sdl-schema-analyzer')
const schema = `
type Query {
test1: Test1
test2: Test2 @deprecated(reason: "Field deprecated")
test3: Test2
}
type Test1 {
field1: String
field2: Test2 @deprecated(reason: "Use test3 root query")
}
type Test2 {
field3: Int
field4: Boolean @deprecated(reason: "Any")
}
enum DeprecatedEnum @deprecated(reason: "Deprecated Enum") {
ONE,
TWO
}
enum NotDeprecateEnum {
THREE,
FOR
}
`
// create the analyzer instance
const analyzer = new SchemaAnalyzer(schema)
// get the list of deprecated pieces in the schema
analyzer.getDeprecations()
/*
[
{
definitionType: 'FieldDefinition',
label: 'Query.test2',
reason: 'Field deprecated'
},
{
definitionType: 'FieldDefinition',
label: 'Test1.field2',
reason: 'Use test3 root query'
},
{
definitionType: 'FieldDefinition',
label: 'Test2.field4',
reason: 'Any'
},
{
definitionType: 'EnumTypeDefinition',
label: 'DeprecatedEnum',
reason: 'Deprecated Enum'
}
]
*/
FAQs
An analyzer to extract info about your schema
The npm package sdl-schema-analyzer receives a total of 1 weekly downloads. As such, sdl-schema-analyzer popularity was classified as not popular.
We found that sdl-schema-analyzer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.