How to use the graphql-zeus.Options.array 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
    f.type.options && f.type.options.find((o) => o === Options.array) ? `[${type}]` : type
  /**
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 / NodesToTree / templates / InputValueTemplate.ts View on Github external
static resolve(f: ParserField) {
    let argsString = '';
    if (f.args && f.args.length) {
      if (f.type.options && f.type.options.includes(Options.array)) {
        argsString = ` = [${f.args.map(TemplateUtils.resolverForConnection).join(',\n')}]`;
      } else {
        argsString = ` = ${f.args.map(TemplateUtils.resolverForConnection).join('\n')}`;
      }
    }
    return `${TemplateUtils.descriptionResolver(f.description, `\t`)}\t${
      f.name
    } : ${TemplateUtils.resolveType(f)}${argsString}${TemplateUtils.resolveDirectives(
      f.directives
    )}`;
  }
}
github graphql-editor / graphql-editor / src / NodesToTree / templates / ArgumentTemplate.ts View on Github external
static resolve(f: ParserField) {
    let argsString = '';
    if (f.args && f.args.length) {
      if (f.type.options && f.type.options!.includes(Options.array)) {
        argsString = `[${f.args.map(TemplateUtils.resolverForConnection).join(',\n')}]`;
      } else {
        argsString = `${f.args.map(TemplateUtils.resolverForConnection).join('\n')}`;
      }
    }
    return `${f.type.name} : ${argsString}`;
  }
}
github graphql-editor / graphql-editor / src / TreeToFaker / index.ts View on Github external
      array: f.type.options && !!f.type.options.find((o) => o === Options.array),
      required: f.type.options && !!f.type.options.find((o) => o === Options.required),