Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 989f8b1

Browse files
committed
1.8.5
1 parent 6d81d03 commit 989f8b1

File tree

2 files changed

+24
-25
lines changed

2 files changed

+24
-25
lines changed

README.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -84,39 +84,38 @@ npm install @gapi/core
8484
```typescript
8585
import { CoreModule } from '@gapi/core';
8686
import { Controller, Module, Bootstrap } from '@rxdi/core';
87-
import { GapiObjectType, Query, Type } from '@rxdi/graphql';
88-
import { GraphQLScalarType, GraphQLInt, GraphQLNonNull } from 'graphql';
87+
import { Query, Type } from '@rxdi/graphql';
88+
import { GraphqlObjectType, GraphQLInt, GraphQLNonNull } from 'graphql';
8989

90-
@GapiObjectType()
91-
export class UserType {
92-
readonly id: number | GraphQLScalarType = GraphQLInt;
93-
}
90+
export const UserType = new GraphqlObjectType({
91+
name: 'UserType',
92+
fields: () => ({
93+
id: {
94+
type: new GraphQLNonNull(GraphQLInt)
95+
}
96+
})
97+
});
9498

9599
@Controller()
96100
export class UserQueriesController {
97-
98-
@Type(UserType)
99-
@Query({
100-
id: {
101-
type: new GraphQLNonNull(GraphQLInt)
102-
}
103-
})
104-
findUser(root, { id }, context): UserType {
105-
return {id: id};
101+
@Type(UserType)
102+
@Query({
103+
id: {
104+
type: new GraphQLNonNull(GraphQLInt)
106105
}
107-
106+
})
107+
findUser(root, { id }, context): UserType {
108+
return { id: id };
109+
}
108110
}
109111

110112
@Module({
111-
imports: [
112-
CoreModule.forRoot()
113-
],
114-
controllers: [UserQueriesController]
113+
imports: [CoreModule.forRoot()],
114+
controllers: [UserQueriesController]
115115
})
116-
export class AppModule { }
117-
116+
export class AppModule {}
118117

119-
Bootstrap(AppModule).subscribe()
118+
Bootstrap(AppModule).subscribe();
120119
```
121120

122121
You need to create `tsconfig.json` with following content

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gapi/core",
3-
"version": "1.8.4",
3+
"version": "1.8.5",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/Stradivario/gapi.git"
@@ -63,4 +63,4 @@
6363
"@types/hapi": "^18.0.2",
6464
"typescript": "^3.0.1"
6565
}
66-
}
66+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy