# graphql-custom-types

> Collection of custom GraphQL types like Email, URL, password and many more

Latest version **1.7.0** (published 2022-09-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install graphql-custom-types
pnpm add graphql-custom-types
yarn add graphql-custom-types
bun add graphql-custom-types
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.7.0 |
| Published | 2022-09-14 |
| First published | 2015-12-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 6.9 |
| Dependencies | 0 |
| Unpacked size | 23.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 213 |
| Author | Chris Landa |
| Maintainers | stylesuxx |
| Keywords | GraphQL, express-graphql, GraphQL types |

## Links

- npm: https://www.npmjs.com/package/graphql-custom-types
- Repository: https://github.com/stylesuxx/graphql-custom-types
- Homepage: https://github.com/stylesuxx/graphql-custom-types#readme
- Issues: https://github.com/stylesuxx/graphql-custom-types/issues
- npm.io page: https://npm.io/package/graphql-custom-types

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 1.7.0 (latest) — 2022-09-14
- 1.6.0 — 2020-07-03
- 1.5.1 — 2019-07-10
- 1.5.0 — 2018-10-22
- 1.4.0 — 2018-05-20
- 1.3.0 — 2018-01-31
- 1.2.0 — 2017-10-02
- 1.1.0 — 2017-06-28
- 1.0.0 — 2017-06-19
- 0.7.3 — 2017-05-05
- 0.7.1 — 2016-11-14
- 0.7.0 — 2016-09-19
- 0.6.0 — 2016-06-09
- 0.5.1 — 2016-06-08
- 0.5.0 — 2016-06-08
- … 6 more at https://npm.io/package/graphql-custom-types/versions

## README

# GraphQL Custom Types
[![npm version](https://badge.fury.io/js/graphql-custom-types.svg)](https://badge.fury.io/js/graphql-custom-types) [![Build Status](https://secure.travis-ci.org/stylesuxx/graphql-custom-types.png?branch=master)](https://travis-ci.org/stylesuxx/graphql-custom-types) [![Dependency Status](https://david-dm.org/stylesuxx/graphql-custom-types.svg)](https://david-dm.org/stylesuxx/graphql-custom-types) [![devDependencies Status](https://david-dm.org/stylesuxx/graphql-custom-types/dev-status.svg)](https://david-dm.org/stylesuxx/graphql-custom-types?type=dev) [![peerDependencies Status](https://david-dm.org/stylesuxx/graphql-custom-types/peer-status.svg)](https://david-dm.org/stylesuxx/graphql-custom-types?type=peer)

> This is a collection of custom GraphQL types that I tend to reuse quite often so I packed them into a module.

## Available Types
Let me give you an overview of the available types. If you need more detail about how to use them, check *schema.js* in the tests folder.

### Scalar
The primitive types, aka everything that may be represented as a string. The ones with parameters you need to instantiate with *new* and pass according parameters, the others may be used as are.

* GraphQLEmail
* GraphQLURL
* GraphQLDateTime
* GraphQLLimitedString(min, max, alphabet)
* GraphQLPassword(min, max, alphabet, complexity)
* GraphQLUUID

*complexity* default options:
```JavaScript
{
  alphaNumeric: false,
  mixedCase: false,
  specialChars: false
}
```

## Installation
Most likely you already will have it, but do not forget to also install *graphql*, since it is required as peer dependency:
```Bash
npm install graphql graphql-custom-types --save
```

## Usage
```JavaScript
import {
  GraphQLEmail,
  GraphQLURL,
  GraphQLDateTime,
  GraphQLLimitedString,
  GraphQLPassword,
  GraphQLUUID
} from 'graphql-custom-types';
```

And use it in your Schema as you would use any other type.

## Development
Contributions are very welcome, please feel free to submit a type. If you do so make sure there are test cases in place.

### Testing
The test suite may be invoked by running:
```Bash
npm run test
```

---
_Source: https://npm.io/package/graphql-custom-types · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
