Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{
data: {
type: Value.EnumValue,
},
node: {
inputs: null,
outputs: [],
notEditable: true,
name: undefined,
},
},
],
};
const objectValue: EditorNodeDefinition = {
node: {
...Utils.createOND(Value.ObjectValue, true),
inputs: [],
outputs: [],
},
type: Value.ObjectValue,
data: {
type: Value.ObjectValue,
for: [ValueDefinition.InputValueDefinition],
},
help: help.EnumValue,
acceptsInputs: (d, defs, _, nodes, node) => {
const [createdFromNode] = node!.outputs!;
return Utils.getDefinitionsFromParentInput(createdFromNode.definition, nodes!.concat(stitchNodes)).map(
Utils.nodeDefinitionToAcceptedEditorNodeDefinition,
);
},
instances: undefined,
(d) => d.data && d.data.type !== Value.ObjectValue,
),
import { TypeDefinition, TypeSystemDefinition, Value, ValueDefinition } from 'graphql-zeus';
import { EditorNodeDefinition } from '../../Models';
import { Utils } from './Utils';
export const InputValueInstance: Partial & Pick = {
options: Utils.ArrayNonNullOptions,
data: {
type: ValueDefinition.InputValueDefinition,
for: [
TypeDefinition.InputObjectTypeDefinition,
TypeSystemDefinition.FieldDefinition,
TypeSystemDefinition.DirectiveDefinition,
Value.ObjectValue,
],
},
node: {
...Utils.createOND(),
outputs: [],
},
};
static resolve(f: ParserField) {
let returnedValue = `${f.name}`;
if (f.data && f.data.type) {
if (f.data.type === Value.EnumValue) {
returnedValue = `${f.type.name}`;
}
if (f.data.type === Value.StringValue) {
returnedValue = `"${f.name}"`;
}
if (f.data.type === Value.ObjectValue) {
returnedValue = `{${(f.args || []).map(TemplateUtils.resolverForConnection)}}`;
}
}
return returnedValue;
}
}
outputs: [],
notEditable: true,
name: undefined,
},
},
],
};
const objectValue: EditorNodeDefinition = {
node: {
...Utils.createOND(Value.ObjectValue, true),
inputs: [],
outputs: [],
},
type: Value.ObjectValue,
data: {
type: Value.ObjectValue,
for: [ValueDefinition.InputValueDefinition],
},
help: help.EnumValue,
acceptsInputs: (d, defs, _, nodes, node) => {
const [createdFromNode] = node!.outputs!;
return Utils.getDefinitionsFromParentInput(createdFromNode.definition, nodes!.concat(stitchNodes)).map(
Utils.nodeDefinitionToAcceptedEditorNodeDefinition,
);
},
instances: undefined,
};
const nullValue: EditorNodeDefinition = {
node: { ...Utils.createOND('null', true), outputs: [], inputs: null },
type: Value.NullValue,
data: {
type: Value.NullValue,