Skip to content

Commit

Permalink
feat(types): add g.schema for GraphQLSchema
Browse files Browse the repository at this point in the history
Adds g.schema to map to GraphQLSchema
  • Loading branch information
jimthedev committed Sep 6, 2016
1 parent b637d78 commit 5e28696
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ g.in // ==> GraphQLInputObjectType,
g.sc // ==> GraphQLScalarType,
g.if // ==> GraphQLInterfaceType,
g.nn // ==> GraphQLNonNull,
g.schema // ==> GraphQLSchema,
// Short syntax
g.ident // ==> GraphQLID,
Expand All @@ -45,6 +46,7 @@ g.input // ==> GraphQLInputObjectType,
g.scal // ==> GraphQLScalarType,
g.inter // ==> GraphQLInterfaceType,
g.non // ==> GraphQLNonNull,
g.schema // ==> GraphQLSchema,
// Medium syntax
g.identifier // ==> GraphQLID,
Expand All @@ -60,6 +62,7 @@ g.inputObject // ==> GraphQLInputObjectType,
g.scalar // ==> GraphQLScalarType,
g.interface // ==> GraphQLInterfaceType,
g.nonNull // ==> GraphQLNonNull,
g.schema // ==> GraphQLSchema,
```
So, using `g.i` or `g.int` or `g.integer` is the same as using `GraphQLInt`.
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ var gra = {
nn: gqlType.GraphQLNonNull,
non: gqlType.GraphQLNonNull,
nonNull: gqlType.GraphQLNonNull,

schema: gqlType.GraphQLSchema,
}

module.exports = gra;
3 changes: 3 additions & 0 deletions src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe('gra', function() {
expect(g.sc).to.equal(t.GraphQLScalarType);
expect(g.if).to.equal(t.GraphQLInterfaceType);
expect(g.nn).to.equal(t.GraphQLNonNull);
expect(g.schema).to.equal(t.GraphQLSchema);
});
});
describe('small', function() {
Expand All @@ -37,6 +38,7 @@ describe('gra', function() {
expect(g.scal).to.equal(t.GraphQLScalarType);
expect(g.inter).to.equal(t.GraphQLInterfaceType);
expect(g.non).to.equal(t.GraphQLNonNull);
expect(g.schema).to.equal(t.GraphQLSchema);
});
});
describe('medium', function() {
Expand All @@ -54,6 +56,7 @@ describe('gra', function() {
expect(g.scalar).to.equal(t.GraphQLScalarType);
expect(g.interface).to.equal(t.GraphQLInterfaceType);
expect(g.nonNull).to.equal(t.GraphQLNonNull);
expect(g.schema).to.equal(t.GraphQLSchema);
});
});
});

0 comments on commit 5e28696

Please sign in to comment.