-
Notifications
You must be signed in to change notification settings - Fork 1
/
compositor.json
92 lines (92 loc) · 5.76 KB
/
compositor.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{
"name": "mfix22/gnt",
"version": "0.1.4",
"libraries": {
"xv": "^1.1.25"
},
"title": "GraphQL Normalized Types",
"branch": "",
"style": {
"name": "Material",
"componentSet": {
"nav": "nav/DarkAbsoluteNav",
"header": "header/GradientHeader",
"article": "article/BasicArticle",
"footer": "footer/BasicFooter"
},
"fontFamily": "Roboto, sans-serif",
"heading": {
"fontWeight": 500,
"letterSpacing": "-0.01em"
},
"colors": {
"text": "#212121",
"background": "#fff",
"primary": "#2196f3",
"secondary": "#1565c0",
"highlight": "#ff4081",
"border": "#e0e0e0",
"muted": "#f5f5f5"
},
"layout": {
"centered": true,
"bannerHeight": "80vh",
"maxWidth": 896
}
},
"content": [
{
"component": "nav",
"links": [
{
"href": "https://www.npmjs.com/package/gnt",
"text": "Home"
},
{
"href": "https://github.com/mfix22/gnt",
"text": "GitHub"
}
]
},
{
"component": "header",
"heading": "gnt",
"subhead": "GraphQL Normalized Types 🍸",
"children": [
{
"component": "ui/TweetButton",
"text": "gnt: :cocktail: GraphQL Normalized Types",
"url": "https://www.npmjs.com/package/gnt"
},
{
"component": "ui/GithubButton",
"user": "mfix22",
"repo": "gnt"
}
],
"links": [],
"text": "simple.final.reliable",
"slug": ""
},
{
"component": "article",
"metadata": {
"source": "github.readme"
},
"html": "<h1><em>G</em>raphQL <em>N</em>ormalized <em>T</em>ypes :cocktail:</h1>\n<p>The <strong>g</strong>in-<strong>n</strong>-<strong>t</strong>onic of GraphQL types: simple, final, clean. Normalize your common data with GraphQL Scalar types.</p>\n<p><a href=\"https://github.com/facebook/jest\"><img src=\"https://img.shields.io/badge/tested_with-jest-99424f.svg\"></a>\n<a href=\"https://lernajs.io/\"><img src=\"https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg\"></a>\n<a href=\"#contributing\"><img src=\"https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat\"></a></p>\n<h2>Usage</h2>\n<pre>$ npm install --save gnt</pre><p>and then add to your schema:</p>\n<pre><span class=\"hljs-keyword\">const</span> { Phone, UnixDate, CreditCard, State, ZipCode, DriversLicense } = <span class=\"hljs-built_in\">require</span>(<span class=\"hljs-string\">'gnt'</span>)\n<span class=\"hljs-keyword\">const</span> { makeExecutableSchema } = <span class=\"hljs-built_in\">require</span>(<span class=\"hljs-string\">'graphql-tools'</span>);\n\nmakeExecutableSchema({ \n <span class=\"hljs-attr\">typeDefs</span>: schemaString, \n <span class=\"hljs-attr\">resolvers</span>: {\n Phone,\n UnixDate,\n CreditCard,\n <span class=\"hljs-attr\">USState</span>: State,\n ZipCode,\n DriversLicense\n }\n});</pre><h2>Examples</h2>\n<p>Each of these types can be installed individually using there 'Package Name' shown below</p>\n<table>\n<thead>\n<tr>\n<th>Type</th>\n<th>Package Name</th>\n<th>Input Example</th>\n<th>Output Example</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Phone</td>\n<td><code>graphql-types-phone</code></td>\n<td><code>'(817) 569-8900'</code></td>\n<td><code>'+18175698900'</code></td>\n</tr>\n<tr>\n<td>Zipcode</td>\n<td><code>graphql-types-zipcode</code></td>\n<td><code>'55902'</code>, <code>00000</code></td>\n<td><code>'55902'</code>, <code>null</code></td>\n</tr>\n<tr>\n<td>UnixDate</td>\n<td><code>graphql-types-unix-timestamp</code></td>\n<td><code>2017-05-07T14:47:59.438</code>, <code>Date</code></td>\n<td><code>1494186489</code></td>\n</tr>\n<tr>\n<td>CreditCard</td>\n<td><code>graphql-types-credit-card</code></td>\n<td><code>'4111111111111111'</code></td>\n<td><code>{ number: '4111111111111111', cardType: 'VISA', validCVV: false, validExpiryMonth: false, validExpiryYear: false, isExpired: true }</code></td>\n</tr>\n<tr>\n<td>NonEmptyString</td>\n<td><code>graphql-types-non-empty-string</code></td>\n<td><code>''</code></td>\n<td><code>null</code></td>\n</tr>\n<tr>\n<td>Drivers License</td>\n<td><code>graphql-types-drivers-license</code></td>\n<td><code>{ state: 'CA', license: 'B2347354' }</code></td>\n<td><code>{ state: 'CA', license: 'B2347354' }</code> OR <code>null</code></td>\n</tr>\n</tbody>\n</table>\n<h4>Enum Types</h4>\n<table>\n<thead>\n<tr>\n<th>Type</th>\n<th>Package Name</th>\n<th>Input Example</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>USState</td>\n<td><code>graphql-types-us-state</code></td>\n<td><code>US</code>, <code>CA</code>, <code>DE</code> <code>...</code></td>\n</tr>\n</tbody>\n</table>\n<h2>Contributing</h2>\n<p>Contributions are more than welcome! This repo is not meant to be owned by me (and if there is a more suitable owner please <a href=\"https://github.com/mfix22/gnt/issues\">let me know</a>), but rather by the commuity.</p>\n<h3>Creating a new type</h3>\n<p>First run:</p>\n<pre>$ npm run generate -- '<your type name>'</pre><p>to get started. A folder with <code>index.js</code>, <code>index.spec.js</code> (your test), and a <code>package.json</code> will be created for you!\nThen run <code>npm run link</code> and you should be on your way.</p>\n<p>If you have any idea for new types, please submit an issue or PR!</p>\n"
},
{
"component": "footer",
"links": [
{
"href": "https://github.com/mfix22/gnt",
"text": "GitHub"
},
{
"href": "https://github.com/mfix22",
"text": "mfix22"
}
]
}
]
}