-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit
- Loading branch information
0 parents
commit ee1c208
Showing
5 changed files
with
158 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules | ||
jspm_packages | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
sudo: false | ||
language: node_js | ||
cache: | ||
directories: | ||
- node_modules | ||
notifications: | ||
email: false | ||
node_js: | ||
- '6' | ||
- '5' | ||
- '4' | ||
- '0.12' | ||
before_install: | ||
- npm i -g npm@^2.0.0 | ||
before_script: | ||
- npm prune | ||
after_success: | ||
- 'curl -Lo travis_after_all.py https://git.io/travis_after_all' | ||
- python travis_after_all.py | ||
- export $(cat .to_export_back) &> /dev/null | ||
- npm run semantic-release | ||
branches: | ||
except: | ||
- /^v\d+\.\d+\.\d+$/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
## Description | ||
|
||
**gra** is a wrapper around GraphQL's type module. It makes the syntax slightly less repetitive. | ||
|
||
## Usage | ||
|
||
### Install | ||
|
||
``` | ||
npm install --save graphql | ||
npm install --save gra | ||
``` | ||
|
||
### Use it | ||
|
||
``` | ||
var g = require('gra'); | ||
g.int | ||
g.id | ||
g.float | ||
g.str | ||
g.bool | ||
g.obj | ||
g.list | ||
g.interface | ||
g.union | ||
g.enum | ||
g.input | ||
g.nonNull | ||
g.scalar | ||
``` | ||
|
||
`g.int` is the same as using `GraphQLInt` | ||
|
||
Each of the above can be used in place of its [more verbose cousin](http://graphql.org/docs/api-reference-type-system/). | ||
|
||
GraphQL is a peerDependency of this project so you should not be hard coded to a specific GraphQL version. | ||
|
||
## Inspiration | ||
|
||
https://twitter.com/samerbuna/status/771719039441702912 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "gra", | ||
"description": "", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/jimthedev/gra.git" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/jimthedev/gra/issues" | ||
}, | ||
"homepage": "https://github.com/jimthedev/gra#readme", | ||
"devDependencies": { | ||
"cz-conventional-changelog": "^1.2.0", | ||
"semantic-release": "^4.3.5" | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "./node_modules/cz-conventional-changelog" | ||
} | ||
}, | ||
"peerDependencies": { | ||
"graphql": "^0.7.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
var gqlType = require('graphql/type'); | ||
|
||
var gra = { | ||
int: gqlType.GraphQLInt, | ||
id: gqlType.GraphQLID, | ||
float: gqlType.GraphQLFloat, | ||
str: gqlType.GraphQLString, | ||
bool: gqlType.GraphQLBoolean, | ||
scalar: gqlType.GraphQLScalarType, | ||
obj: gqlType.GraphQLObjectType, | ||
interface: gqlType.GraphQLInterfaceType, | ||
union: gqlType.GraphQLUnionType, | ||
enum: gqlType.GraphQLEnumType, | ||
input: gqlType.GraphQLInputObjectType, | ||
list: gqlType.GraphQLList, | ||
nonNull: gqlType.GraphQLNonNull, | ||
} | ||
|
||
module.exports = gra; |