From c2b2091819d2566521620763ae44627f93ece589 Mon Sep 17 00:00:00 2001 From: Mike Fix Date: Thu, 19 Jul 2018 20:56:33 -0700 Subject: [PATCH] Update READMEs --- packages/credit-card/README.md | 9 +++++ packages/drivers-license/README.md | 9 +++++ packages/enum/README.md | 9 +++++ packages/gnt/README.md | 57 +++++++++++++++++++++++++++++ packages/non-empty-string/README.md | 9 +++++ packages/phone/README.md | 9 +++++ packages/unix-date/README.md | 9 +++++ packages/us-state/README.md | 9 +++++ packages/zipcode/README.md | 9 +++++ 9 files changed, 129 insertions(+) create mode 100644 packages/credit-card/README.md create mode 100644 packages/drivers-license/README.md create mode 100644 packages/enum/README.md create mode 100644 packages/gnt/README.md create mode 100644 packages/non-empty-string/README.md create mode 100644 packages/phone/README.md create mode 100644 packages/unix-date/README.md create mode 100644 packages/us-state/README.md create mode 100644 packages/zipcode/README.md diff --git a/packages/credit-card/README.md b/packages/credit-card/README.md new file mode 100644 index 0000000..dc9d50b --- /dev/null +++ b/packages/credit-card/README.md @@ -0,0 +1,9 @@ +# `graphql-types-credit-card` + +### Install +```bash +$ npm install --save graphql-types-credit-card +``` + +### Usage +Check out examples [here](https://github.com/mfix22/gnt/tree/master/packages/gnt) diff --git a/packages/drivers-license/README.md b/packages/drivers-license/README.md new file mode 100644 index 0000000..0b49a0d --- /dev/null +++ b/packages/drivers-license/README.md @@ -0,0 +1,9 @@ +# `graphql-types-drivers-license` + +### Install +```bash +$ npm install --save graphql-types-drivers-license +``` + +### Usage +Check out examples [here](https://github.com/mfix22/gnt/tree/master/packages/gnt) diff --git a/packages/enum/README.md b/packages/enum/README.md new file mode 100644 index 0000000..46efd3d --- /dev/null +++ b/packages/enum/README.md @@ -0,0 +1,9 @@ +# `graphql-types-enum` + +### Install +```bash +$ npm install --save graphql-types-enum +``` + +### Usage +Check out examples [here](https://github.com/mfix22/gnt/tree/master/packages/gnt) diff --git a/packages/gnt/README.md b/packages/gnt/README.md new file mode 100644 index 0000000..5007ce7 --- /dev/null +++ b/packages/gnt/README.md @@ -0,0 +1,57 @@ +# *G*raphQL *N*ormalized *T*ypes :cocktail: +The **g**in-**n**-**t**onic of GraphQL types: simple, final, clean. Normalize your common data with GraphQL Scalar types. + +[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest) +[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lernajs.io/) +[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#contributing) +## Usage +```bash +$ npm install --save gnt +``` + +and then add to your schema: + +```javascript +const { Phone, UnixDate, CreditCard, State, ZipCode, DriversLicense } = require('gnt') + +{ + name: 'Query', + fields: { + phone: { type: Phone }, + date: { type: UnixDate }, + card: { type: CreditCard }, + state: { type: State } + zipcode: { type: ZipCode }, + license: { type: DriversLicense } + } +} +``` + +## Examples +Each of these types can be installed individually using there 'Package Name' shown below + +| Type | Package Name | Input Example | Output Example | +| :------------- | :------------- | :------------- | :------------- | +| Phone | `graphql-types-phone` | `'(817) 569-8900'` | `'+18175698900'` | +| Zipcode | `graphql-types-zipcode` | `'55902'`, `00000` | `'55902'`, `null` | +| UnixDate | `graphql-types-unix-timestamp` | `2017-05-07T14:47:59.438`, `Date` | `1494186489` | +| CreditCard | `graphql-types-credit-card` | `'4111111111111111'` | ```{ number: '4111111111111111', cardType: 'VISA', validCVV: false, validExpiryMonth: false, validExpiryYear: false, isExpired: true }``` | +| NonEmptyString | `graphql-types-non-empty-string` | `''` | `null` | +| Drivers License| `graphql-types-drivers-license` | `{ state: 'CA', license: 'B2347354' }`| `{ state: 'CA', license: 'B2347354' }` OR `null` | +#### Enum Types +| Type | Package Name | Input Example | +| :------------- | :------------- | :------------- | +| USState | `graphql-types-us-state` | `US`, `CA`, `DE` `...` | + +## Contributing +Contributions are more than welcome! This repo is not meant to be owned by me (and if there is a more suitable owner please [let me know](https://github.com/mfix22/gnt/issues)), but rather by the commuity. + +### Creating a new type +First run: +```shell +$ npm run generate -- '' +``` +to get started. A folder with `index.js`, `index.spec.js` (your test), and a `package.json` will be created for you! +Then run `npm run link` and you should be on your way. + +If you have any idea for new types, please submit an issue or PR! diff --git a/packages/non-empty-string/README.md b/packages/non-empty-string/README.md new file mode 100644 index 0000000..8d6a72f --- /dev/null +++ b/packages/non-empty-string/README.md @@ -0,0 +1,9 @@ +# `graphql-types-non-empty-string` + +### Install +```bash +$ npm install --save graphql-types-non-empty-string +``` + +### Usage +Check out examples [here](https://github.com/mfix22/gnt/tree/master/packages/gnt) diff --git a/packages/phone/README.md b/packages/phone/README.md new file mode 100644 index 0000000..9d585cb --- /dev/null +++ b/packages/phone/README.md @@ -0,0 +1,9 @@ +# `graphql-types-phone` + +### Install +```bash +$ npm install --save graphql-types-phone +``` + +### Usage +Check out examples [here](https://github.com/mfix22/gnt/tree/master/packages/gnt) diff --git a/packages/unix-date/README.md b/packages/unix-date/README.md new file mode 100644 index 0000000..3d29356 --- /dev/null +++ b/packages/unix-date/README.md @@ -0,0 +1,9 @@ +# `graphql-types-unix-timestamp` + +### Install +```bash +$ npm install --save graphql-types-unix-timestamp +``` + +### Usage +Check out examples [here](https://github.com/mfix22/gnt/tree/master/packages/gnt) diff --git a/packages/us-state/README.md b/packages/us-state/README.md new file mode 100644 index 0000000..62df945 --- /dev/null +++ b/packages/us-state/README.md @@ -0,0 +1,9 @@ +# `graphql-types-us-state` + +### Install +```bash +$ npm install --save graphql-types-us-state +``` + +### Usage +Check out examples [here](https://github.com/mfix22/gnt/tree/master/packages/gnt) diff --git a/packages/zipcode/README.md b/packages/zipcode/README.md new file mode 100644 index 0000000..88c0d06 --- /dev/null +++ b/packages/zipcode/README.md @@ -0,0 +1,9 @@ +# `graphql-types-zipcode` + +### Install +```bash +$ npm install --save graphql-types-zipcode +``` + +### Usage +Check out examples [here](https://github.com/mfix22/gnt/tree/master/packages/gnt)