How to use graphql-zeus - 10 common examples

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 / TreeToNodes / index.ts View on Github external
static createDirectivesHelper = (
    rootNode: Node,
    nodeDefinitions: EditorNodeDefinition[],
    links: Link[],
    nodes: Array>,
  ): Node => {
    return TreeToNodes.connectAndCreate(
      {
        name: Helpers.Directives,
        type: {
          name: Helpers.Directives,
        },
      },
      rootNode,
      links,
      nodeDefinitions,
      nodes,
    );
  };
  static createExtendHelper(f: ParserField): ParserField {
github graphql-editor / graphql-editor / src / NodesToTree / index.ts View on Github external
            .filter((i) => i.definition.type === Helpers.Directives)
            .map((i) => i.inputs || [])
github graphql-editor / graphql-editor / src / Graph / definitions / HelperDefintions.ts View on Github external
},
      type: Helpers.Implements,
      data: {
        type: Helpers.Implements,
        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),
github graphql-editor / graphql-editor / src / Graph / definitions / HelperDefintions.ts View on Github external
acceptsInputs: (d, defs) =>
        Utils.dataForTypes(defs, [Helpers.Directives]).map(Utils.nodeDefinitionToAcceptedEditorNodeDefinition),
      help: help.directives,
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))),
            );
          },
        },
      ],
    });
  /**
github graphql-editor / graphql-editor / src / TreeToNodes / index.ts View on Github external
static createDirectivesHelper = (
    rootNode: Node,
    nodeDefinitions: EditorNodeDefinition[],
    links: Link[],
    nodes: Array>,
  ): Node => {
    return TreeToNodes.connectAndCreate(
      {
        name: Helpers.Directives,
        type: {
          name: Helpers.Directives,
        },
      },
      rootNode,
      links,
      nodeDefinitions,
      nodes,
    );
  };
  static createExtendHelper(f: ParserField): ParserField {
github graphql-editor / graphql-editor / src / Graph / definitions / HelperDefintions.ts View on Github external
data: {
        type: Helpers.Implements,
        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,
    };
github graphql-editor / graphql-editor / src / NodesToTree / index.ts View on Github external
            .filter((i) => i.definition.type === Helpers.Implements)
            .map((i) => (i.inputs ? i.inputs.map((n) => n.definition.type) : []))
github graphql-editor / graphql-editor / src / TreeToNodes / index.ts View on Github external
static createInterfaces = (
    interfaces: string[],
    rootNode: Node,
    nodeDefinitions: EditorNodeDefinition[],
    links: Link[],
    nodes: Array>,
  ) => {
    const createdNode = TreeToNodes.connectAndCreate(
      {
        name: Helpers.Implements,
        type: {
          name: Helpers.Implements,
        },
      },
      rootNode,
      links,
      nodeDefinitions,
      nodes,
    );
    interfaces.forEach((i) => {
      TreeToNodes.connectAndCreate(
        {
          type: {
            name: i,
          },
          name: i,