How to use the graphql-zeus.Value.EnumValue 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 / TypeDefintions.ts View on Github external
              .filter((d) => d.data && d.data.type === Value.EnumValue)
              .map(Utils.nodeDefinitionToAcceptedEditorNodeDefinition),
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 / TypeDefintions.ts View on Github external
                  .filter((d) => d.data && d.data.type === Value.EnumValue)
                  .map(Utils.nodeDefinitionToAcceptedEditorNodeDefinition),
github graphql-editor / graphql-editor / src / Graph / definitions / ValueDefinitions.ts View on Github external
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,
            name: undefined,
          },
        },
      ],
    };
    const objectValue: EditorNodeDefinition = {
      node: {
        ...Utils.createOND(Value.ObjectValue, true),
        inputs: [],
        outputs: [],
      },