How to use the graphql-zeus.Value.ObjectValue function in graphql-zeus

To help you get started, we’ve selected a few graphql-zeus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github graphql-editor / graphql-editor / src / Graph / definitions / ValueDefinitions.ts View on Github external
{
          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,
github graphql-editor / graphql-editor / src / Graph / definitions / InputValue.ts View on Github external
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: [],
  },
};
github graphql-editor / graphql-editor / src / NodesToTree / templates / ValueTemplate.ts View on Github external
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;
  }
}
github graphql-editor / graphql-editor / src / Graph / definitions / ValueDefinitions.ts View on Github external
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,