How to use the graphql-zeus.TypeSystemDefinition.FieldDefinition 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 / 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 / Graph / definitions / Field.ts View on Github external
acceptsInputs: (d, defs) =>
    Utils.displayAsCategories(Utils.sortByParentType(Utils.dataForTypes(defs, [TypeSystemDefinition.FieldDefinition]))),
  node: {
github graphql-editor / graphql-editor / src / NodesToTree / templates / TemplateUtils.ts View on Github external
static resolverForConnection = (f: ParserField): string => {
    if (f.data) {
      const { type = '' } = f.data;
      if (type === TypeDefinition.UnionTypeDefinition) {
        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 '';
      }
github graphql-editor / graphql-editor / src / Graph / definitions / HelperDefintions.ts View on Github external
for: [TypeDefinition.ObjectTypeDefinition],
      },
      acceptsInputs: (d, defs) =>
        Utils.dataForTypes(defs, [Helpers.Implements]).map(Utils.nodeDefinitionToAcceptedEditorNodeDefinition),
      help: help.implements,
    };
    const directivesObject: EditorNodeDefinition = {
      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];
  }
github graphql-editor / graphql-editor / src / Graph / definitions / Field.ts View on Github external
import { TypeDefinition, TypeSystemDefinition } from 'graphql-zeus';
import { EditorNodeDefinition } from '../../Models';
import { Utils } from './Utils';

export const FieldInstance: Partial & Pick = {
  options: Utils.ArrayNonNullOptions,
  data: {
    type: TypeSystemDefinition.FieldDefinition,
    for: [TypeDefinition.InterfaceTypeDefinition, TypeDefinition.ObjectTypeDefinition],
  },
  acceptsInputs: (d, defs) =>
    Utils.displayAsCategories(Utils.sortByParentType(Utils.dataForTypes(defs, [TypeSystemDefinition.FieldDefinition]))),
  node: {
    ...Utils.createOND(),
    outputs: [],
  },
  instances: undefined,
};