Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graphql-custom-types

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-custom-types

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

  • 1.7.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.1K
decreased by-0.4%
Maintainers
1
Weekly downloads
 
Created
Source

GraphQL Custom Types

npm version Build Status Dependency Status devDependencies Status peerDependencies Status

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:

{
  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:

npm install graphql graphql-custom-types --save

Usage

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:

npm run test

Keywords

FAQs

Package last updated on 14 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc