How to use the graphql-zeus.Instances.Argument 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 / Argument.ts View on Github external
import { Instances, Options } from 'graphql-zeus';
import { EditorNodeDefinition } from '../../Models';
import { help } from './help';

export const ArgumentInstance: Partial & Pick = {
  node: {
    notEditable: true,
    name: undefined,
  },
  data: {
    type: Instances.Argument,
  },
  options: [
    {
      name: Options.array,
      help: help.array,
    },
  ],
};
github graphql-editor / graphql-editor / src / Graph / definitions / BuiltIn.ts View on Github external
export const reason = (): EditorNodeDefinition => ({
  data: {
    type: Instances.Argument,
  },
  type: 'reason',
  acceptsInputs: (d, defs, _, nodes) => {
    return defs
      .filter((d) => d.data && d.data.type === Value.StringValue)
      .map(Utils.nodeDefinitionToAcceptedEditorNodeDefinition);
  },
  node: {
    name: undefined,
    notEditable: true,
  },
});
github graphql-editor / graphql-editor / src / NodesToTree / templates / TemplateUtils.ts View on Github external
}
      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 '';
  }
}