Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
acceptsInputs: (d, defs) =>
Utils.dataForTypes(defs, [ValueDefinition.EnumValueDefinition]).map(
Utils.nodeDefinitionToAcceptedEditorNodeDefinition,
),
instances: [
static generate(stitchNodes: Array>) {
const enumValue: EditorNodeDefinition = {
node: { ...Utils.createOND(), inputs: [], outputs: [] },
type: ValueDefinition.EnumValueDefinition,
data: {
type: ValueDefinition.EnumValueDefinition,
for: [TypeDefinition.EnumTypeDefinition],
},
help: help.EnumValue,
acceptsInputs: (d, defs) =>
Utils.dataForTypes(defs, [ValueDefinition.EnumValueDefinition]).map(
Utils.nodeDefinitionToAcceptedEditorNodeDefinition,
),
instances: [
{
data: {
type: Value.EnumValue,
},
node: {
inputs: null,
outputs: [],
notEditable: true,
static generate(stitchNodes: Array>) {
const enumValue: EditorNodeDefinition = {
node: { ...Utils.createOND(), inputs: [], outputs: [] },
type: ValueDefinition.EnumValueDefinition,
data: {
type: ValueDefinition.EnumValueDefinition,
for: [TypeDefinition.EnumTypeDefinition],
},
help: help.EnumValue,
acceptsInputs: (d, defs) =>
Utils.dataForTypes(defs, [ValueDefinition.EnumValueDefinition]).map(
Utils.nodeDefinitionToAcceptedEditorNodeDefinition,
),
instances: [
{
data: {
type: Value.EnumValue,
},
node: {
inputs: null,
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,
};
return [implementsObject, directivesObject, commentObject];
}
}
return TypeDefinitionsTemplates.resolveUnion(f);
}
if (type in Value) {
return ValueTemplate.resolve(f);
}
if (type in TypeDefinition) {
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 '';
}
}