stylesuxx/graphql-custom-types
关于
A collection of custom GraphQL types like Email, URL and password.
效率与自动化实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- -1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文GraphQL Custom Types
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
探索相关项目
加载中…
