How to use the graphql-zeus.Instances.Directive 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 / NodesToTree / templates / TemplateUtils.ts View on Github external
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 '';
  }
}
github graphql-editor / graphql-editor / src / Graph / definitions / BuiltIn.ts View on Github external
export const deprecated = (stitchNodes: Array>): EditorNodeDefinition => ({
  data: {
    for: [Helpers.Directives],
    type: Instances.Directive,
  },
  instances: undefined,
  main: undefined,
  root: undefined,
  node: {
    name: undefined,
    notEditable: true,
    description: '',
  },
  type: 'deprecated',
  options: [
    {
      name: Directive.FIELD_DEFINITION,
      help: 'fff',
    },
  ],
github graphql-editor / graphql-editor / src / Graph / definitions / TypeDefintions.ts View on Github external
static DirectiveDefinition = (stitchNodes: Array>) =>
    generateTypeDefinition({
      help: help.directive,
      type: TypeSystemDefinitionDisplayMap[TypeSystemDefinition.DirectiveDefinition],
      dataType: TypeSystemDefinition.DirectiveDefinition,
      options: Object.keys(Directive).map((d) => ({ name: d, help: d })),
      acceptsInputs: (d, defs, _) =>
        Utils.displayAsCategories(
          Utils.sortByParentType(Utils.dataForTypes(defs, [TypeSystemDefinition.DirectiveDefinition])),
        ),
      instances: [
        {
          data: {
            type: Instances.Directive,
            for: [Helpers.Directives],
          },
          node: {
            notEditable: true,
            name: undefined,
          },
          options: undefined,
          instances: undefined,
          acceptsInputs: (d, defs, _, nodes) => {
            return Utils.displayAsCategories(
              Utils.sortByParentType(Utils.getDefinitionsFromParent(d, nodes!.concat(stitchNodes))),
            );
          },
        },
      ],
    });