Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static createDirectivesHelper = (
rootNode: Node,
nodeDefinitions: EditorNodeDefinition[],
links: Link[],
nodes: Array>,
): Node => {
return TreeToNodes.connectAndCreate(
{
name: Helpers.Directives,
type: {
name: Helpers.Directives,
},
},
rootNode,
links,
nodeDefinitions,
nodes,
);
};
static createExtendHelper(f: ParserField): ParserField {
.filter((i) => i.definition.type === Helpers.Directives)
.map((i) => i.inputs || [])
},
type: Helpers.Implements,
data: {
type: Helpers.Implements,
for: [TypeDefinition.ObjectTypeDefinition],
},
acceptsInputs: (d, defs) =>
Utils.dataForTypes(defs, [Helpers.Implements]).map(Utils.nodeDefinitionToAcceptedEditorNodeDefinition),
help: help.implements,
};
const directivesObject: EditorNodeDefinition = {
node: {
notEditable: true,
name: undefined,
},
type: Helpers.Directives,
data: {
type: Helpers.Directives,
for: [
TypeSystemDefinition.FieldDefinition,
TypeDefinition.ObjectTypeDefinition,
TypeDefinition.EnumTypeDefinition,
TypeDefinition.InputObjectTypeDefinition,
TypeDefinition.InterfaceTypeDefinition,
TypeDefinition.UnionTypeDefinition,
TypeDefinition.ScalarTypeDefinition,
ValueDefinition.EnumValueDefinition,
ValueDefinition.InputValueDefinition,
],
},
acceptsInputs: (d, defs) =>
Utils.dataForTypes(defs, [Helpers.Directives]).map(Utils.nodeDefinitionToAcceptedEditorNodeDefinition),
acceptsInputs: (d, defs) =>
Utils.dataForTypes(defs, [Helpers.Directives]).map(Utils.nodeDefinitionToAcceptedEditorNodeDefinition),
help: help.directives,
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))),
);
},
},
],
});
/**
static createDirectivesHelper = (
rootNode: Node,
nodeDefinitions: EditorNodeDefinition[],
links: Link[],
nodes: Array>,
): Node => {
return TreeToNodes.connectAndCreate(
{
name: Helpers.Directives,
type: {
name: Helpers.Directives,
},
},
rootNode,
links,
nodeDefinitions,
nodes,
);
};
static createExtendHelper(f: ParserField): ParserField {
data: {
type: Helpers.Implements,
for: [TypeDefinition.ObjectTypeDefinition],
},
acceptsInputs: (d, defs) =>
Utils.dataForTypes(defs, [Helpers.Implements]).map(Utils.nodeDefinitionToAcceptedEditorNodeDefinition),
help: help.implements,
};
const directivesObject: EditorNodeDefinition = {
node: {
notEditable: true,
name: undefined,
},
type: Helpers.Directives,
data: {
type: Helpers.Directives,
for: [
TypeSystemDefinition.FieldDefinition,
TypeDefinition.ObjectTypeDefinition,
TypeDefinition.EnumTypeDefinition,
TypeDefinition.InputObjectTypeDefinition,
TypeDefinition.InterfaceTypeDefinition,
TypeDefinition.UnionTypeDefinition,
TypeDefinition.ScalarTypeDefinition,
ValueDefinition.EnumValueDefinition,
ValueDefinition.InputValueDefinition,
],
},
acceptsInputs: (d, defs) =>
Utils.dataForTypes(defs, [Helpers.Directives]).map(Utils.nodeDefinitionToAcceptedEditorNodeDefinition),
help: help.directives,
};