Skip to content

Commit

Permalink
Add crud operations
Browse files Browse the repository at this point in the history
  • Loading branch information
ju4n97 committed Sep 8, 2021
1 parent 9aecd33 commit 40224d7
Show file tree
Hide file tree
Showing 53 changed files with 2,305 additions and 106 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,11 @@ module.exports = {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
},
],
},
};
6 changes: 6 additions & 0 deletions dist/app.controller.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { AppService } from './app.service';
export declare class AppController {
private readonly appService;
constructor(appService: AppService);
getHello(): string;
}
34 changes: 34 additions & 0 deletions dist/app.controller.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/app.controller.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/app.module.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export declare class AppModule {
}
32 changes: 32 additions & 0 deletions dist/app.module.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/app.module.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions dist/app.service.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export declare class AppService {
getHello(): string;
}
20 changes: 20 additions & 0 deletions dist/app.service.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/app.service.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/generate-typings.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
11 changes: 11 additions & 0 deletions dist/generate-typings.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/generate-typings.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions dist/graphql.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export declare class NewPost {
title: string;
content: string;
}
export declare class UpdatePost {
id: string;
published?: Nullable<boolean>;
title?: Nullable<string>;
content?: Nullable<string>;
}
export declare class Post {
id: string;
title: string;
content: string;
published: boolean;
createdAt: string;
}
export declare abstract class IQuery {
abstract posts(): Post[] | Promise<Post[]>;
abstract post(id: string): Nullable<Post> | Promise<Nullable<Post>>;
}
export declare abstract class IMutation {
abstract createPost(input?: Nullable<NewPost>): Post | Promise<Post>;
abstract updatePost(input?: Nullable<UpdatePost>): Nullable<Post> | Promise<Nullable<Post>>;
abstract deletePost(id: string): Nullable<Post> | Promise<Nullable<Post>>;
}
declare type Nullable<T> = T | null;
export {};
19 changes: 19 additions & 0 deletions dist/graphql.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/graphql.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/main.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
10 changes: 10 additions & 0 deletions dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/main.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/posts/posts.module.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export declare class PostsModule {
}
22 changes: 22 additions & 0 deletions dist/posts/posts.module.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/posts/posts.module.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions dist/posts/posts.resolver.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { NewPost, UpdatePost } from 'src/graphql';
import { PostsService } from './posts.service';
export declare class PostResolvers {
private readonly postsService;
constructor(postsService: PostsService);
posts(): Promise<import(".prisma/client").Post[]>;
post(args: string): Promise<import(".prisma/client").Post>;
create(args: NewPost): Promise<import(".prisma/client").Post>;
update(args: UpdatePost): Promise<import(".prisma/client").Post>;
delete(args: string): Promise<import(".prisma/client").Post>;
}
78 changes: 78 additions & 0 deletions dist/posts/posts.resolver.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/posts/posts.resolver.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions dist/posts/posts.service.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Post } from '.prisma/client';
import { NewPost, UpdatePost } from 'src/graphql';
import { PrismaService } from 'src/prisma.service';
export declare class PostsService {
private prisma;
constructor(prisma: PrismaService);
post(id: string): Promise<Post | null>;
posts(): Promise<Post[]>;
createPost(input: NewPost): Promise<Post>;
updatePost(input: UpdatePost): Promise<Post>;
deletePost(id: string): Promise<Post>;
}
Loading

0 comments on commit 40224d7

Please sign in to comment.