How to use the graphql-zeus.TypeDefinition.ScalarTypeDefinition 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 / HelperDefintions.ts View on Github external
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 / TreeToFaker / index.ts View on Github external
a = {
        ...a,
        ...arrayToDict(nodes.filter((n) => n.type.name === b).map(generateFakerResolverType))
      };
      return a;
    }, {});

    const fakeEnumResolvers = [TypeDefinition.EnumTypeDefinition].reduce((a, b) => {
      a = {
        ...a,
        ...arrayToDict(nodes.filter((n) => n.type.name === b).map(generateFakerResolverEnum))
      };
      return a;
    }, {});

    const fakeScalarResolvers = [TypeDefinition.ScalarTypeDefinition].reduce((a, b) => {
      a = {
        ...a,
        ...arrayToDict(nodes.filter((n) => n.type.name === b).map(generateFakerResolverScalar))
      };
      return a;
    }, {});

    const fakeUnionResolvers = [TypeDefinition.UnionTypeDefinition].reduce((a, b) => {
      a = {
        ...a,
        ...arrayToDict(nodes.filter((n) => n.type.name === b).map(generateFakerResolverUnion))
      };
      return a;
    }, {});
    const fakeSchema = {
      ...fakeResolvers,
github graphql-editor / graphql-editor / src / Graph / definitions / TypeDefintions.ts View on Github external
static ScalarTypeDefintion = () =>
    generateTypeDefinition({
      help: help.scalar,
      type: TypeDefinitionDisplayMap[TypeDefinition.ScalarTypeDefinition],
      dataType: TypeDefinition.ScalarTypeDefinition,
      acceptsInputs: (d, defs, _) => {
        return Utils.dataForTypes(defs, [TypeDefinition.ScalarTypeDefinition]).map(
          Utils.nodeDefinitionToAcceptedEditorNodeDefinition,
        );
      },
      instances: [
        {
          ...FieldInstance,
        },
        {
          ...InputValueInstance,
          help: help.scalar,
          instances: [
            {
              ...ArgumentInstance,
github graphql-editor / graphql-editor / src / Graph / definitions / TypeDefintions.ts View on Github external
acceptsInputs: (d, defs, _) => {
        return Utils.dataForTypes(defs, [TypeDefinition.ScalarTypeDefinition]).map(
          Utils.nodeDefinitionToAcceptedEditorNodeDefinition,
        );
      },
      instances: [
github graphql-editor / graphql-editor / src / Graph / definitions / TypeDefintions.ts View on Github external
static ScalarTypeDefintion = () =>
    generateTypeDefinition({
      help: help.scalar,
      type: TypeDefinitionDisplayMap[TypeDefinition.ScalarTypeDefinition],
      dataType: TypeDefinition.ScalarTypeDefinition,
      acceptsInputs: (d, defs, _) => {
        return Utils.dataForTypes(defs, [TypeDefinition.ScalarTypeDefinition]).map(
          Utils.nodeDefinitionToAcceptedEditorNodeDefinition,
        );
      },
      instances: [
        {
          ...FieldInstance,
        },
        {
          ...InputValueInstance,
          help: help.scalar,
          instances: [
            {
              ...ArgumentInstance,
              node: {