Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return TypeDefinitionsTemplates.resolve(f);
}
switch (type) {
case TypeSystemDefinition.FieldDefinition:
return FieldTemplate.resolve(f);
case TypeSystemDefinition.DirectiveDefinition:
return TypeDefinitionsTemplates.resolveDirective(f);
case TypeSystemDefinition.UnionMemberDefinition:
return UnionMemberTemplate.resolve(f);
case ValueDefinition.EnumValueDefinition:
return EnumValueDefinitionTemplate.resolve(f);
case ValueDefinition.InputValueDefinition:
return InputValueTemplate.resolve(f);
case Instances.Argument:
return ArgumentTemplate.resolve(f);
case Instances.Directive:
return DirectiveTemplate.resolve(f);
default:
return '';
}
}
return '';
}
}
export const deprecated = (stitchNodes: Array>): EditorNodeDefinition => ({
data: {
for: [Helpers.Directives],
type: Instances.Directive,
},
instances: undefined,
main: undefined,
root: undefined,
node: {
name: undefined,
notEditable: true,
description: '',
},
type: 'deprecated',
options: [
{
name: Directive.FIELD_DEFINITION,
help: 'fff',
},
],
static DirectiveDefinition = (stitchNodes: Array>) =>
generateTypeDefinition({
help: help.directive,
type: TypeSystemDefinitionDisplayMap[TypeSystemDefinition.DirectiveDefinition],
dataType: TypeSystemDefinition.DirectiveDefinition,
options: Object.keys(Directive).map((d) => ({ name: d, help: d })),
acceptsInputs: (d, defs, _) =>
Utils.displayAsCategories(
Utils.sortByParentType(Utils.dataForTypes(defs, [TypeSystemDefinition.DirectiveDefinition])),
),
instances: [
{
data: {
type: Instances.Directive,
for: [Helpers.Directives],
},
node: {
notEditable: true,
name: undefined,
},
options: undefined,
instances: undefined,
acceptsInputs: (d, defs, _, nodes) => {
return Utils.displayAsCategories(
Utils.sortByParentType(Utils.getDefinitionsFromParent(d, nodes!.concat(stitchNodes))),
);
},
},
],
});