Skip to content

Commit a61629b

Browse files
authored
Merge pull request #51 from babbarankit/master
Changes to Readme and Decorator
2 parents c5d700f + 3852d7d commit a61629b

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class RootSchema {
4949

5050
Example usage of @Ctx and @Root.
5151
```typescript
52-
import { ObjectType, Ctx, Field, Root } from 'graphql-decorator';
52+
import { ObjectType, Ctx, Field, Root } from 'graphql-schema-decorator';
5353
import { GraphQLID, GraphQLString, GraphQLList } from 'graphql';
5454
import * as AnswerTypes from 'graphql/answer/types/index';
5555

@@ -78,7 +78,7 @@ export class UserType {
7878

7979
Use of @Pagination with @OrderBy
8080
```typescript
81-
import { ObjectType, Arg, Ctx, List, Field } from 'graphql-decorator';
81+
import { ObjectType, Arg, Ctx, List, Field } from 'graphql-schema-decorator';
8282

8383
@ObjectType({description: 'Get all users query.'})
8484
export class UsersQuery {
@@ -203,7 +203,7 @@ It provide the following features:
203203
This tool requires Node.js v4.4.0 or later.
204204

205205
```sh
206-
npm i graphql-decorator typescript
206+
npm i graphql-schema-decorator typescript
207207
```
208208

209209
This tool uses ES.next Decorators and Reflect, so create tsconfig.json :
@@ -230,7 +230,7 @@ And write .ts code such as:
230230
```ts
231231
/* main.ts */
232232

233-
import { Schema, Query, ObjectType, Field, schemaFactory } from "graphql-decorator";
233+
import { Schema, Query, ObjectType, Field, schemaFactory } from "graphql-schema-decorator";
234234
const graphql = require("graphql").graphql;
235235

236236
// @ObjectType creates GraphQLObjectType from a class
@@ -276,7 +276,7 @@ You can declare a GraphQL schema class with `@Schema`, `@Query` and `@Mutation`
276276
For example:
277277

278278
```ts
279-
import { Schema, Query, Mutation } from "graphql-decorator";
279+
import { Schema, Query, Mutation } from "graphql-schema-decorator";
280280

281281
@Schema()
282282
class MySchema {

src/decorator/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ export * from './arg.decorator';
77
export * from './context.decorator';
88
export * from './field.decorator';
99
export * from './order-by.decorator';
10+
export * from './root.decorator';
1011
export * from './before.decorator';

src/decorator/root.decorator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { getMetadataArgsStorage } from '../metadata-builder';
55
*
66
* @param option Options for an Schema
77
*/
8-
export function Ctx() {
8+
export function Root() {
99
return function (target: any, propertyKey: any, index: number) {
1010
getMetadataArgsStorage().roots.push({
1111
target: target,

0 commit comments

Comments
 (0)