-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from dDevAhmed/feature/module-architecture
Module Architecture Setup
- Loading branch information
Showing
32 changed files
with
486 additions
and
1 deletion.
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,59 @@ | ||
# compiled output | ||
/dist | ||
/node_modules | ||
/build | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
pnpm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# OS | ||
.DS_Store | ||
|
||
# Tests | ||
/coverage | ||
/.nyc_output | ||
|
||
# IDEs and editors | ||
/.idea | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
|
||
# IDE - VSCode | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
|
||
# dotenv environment variable files | ||
.env | ||
.env.development.local | ||
.env.development | ||
.env.test.local | ||
.env.test | ||
.env.production.local | ||
.env.production | ||
.env.local | ||
|
||
# temp directory | ||
.temp | ||
.tmp | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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 @@ | ||
type Auth { | ||
# Example field (placeholder) | ||
exampleField: Int | ||
} | ||
|
||
input CreateAuthInput { | ||
# Example field (placeholder) | ||
exampleField: Int | ||
} | ||
|
||
input UpdateAuthInput { | ||
id: Int! | ||
} | ||
|
||
type Query { | ||
auth: [Auth]! | ||
auth(id: Int!): Auth | ||
} | ||
|
||
type Mutation { | ||
createAuth(createAuthInput: CreateAuthInput!): Auth! | ||
updateAuth(updateAuthInput: UpdateAuthInput!): Auth! | ||
removeAuth(id: Int!): Auth | ||
} |
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,8 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { AuthService } from './auth.service'; | ||
import { AuthResolver } from './auth.resolver'; | ||
|
||
@Module({ | ||
providers: [AuthResolver, AuthService], | ||
}) | ||
export class AuthModule {} |
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,34 @@ | ||
import { Resolver, Query, Mutation, Args } from '@nestjs/graphql'; | ||
import { AuthService } from './auth.service'; | ||
import { CreateAuthInput } from './dto/create-auth.input'; | ||
import { UpdateAuthInput } from './dto/update-auth.input'; | ||
|
||
@Resolver('Auth') | ||
export class AuthResolver { | ||
constructor(private readonly authService: AuthService) {} | ||
|
||
@Mutation('createAuth') | ||
create(@Args('createAuthInput') createAuthInput: CreateAuthInput) { | ||
return this.authService.create(createAuthInput); | ||
} | ||
|
||
@Query('auth') | ||
findAll() { | ||
return this.authService.findAll(); | ||
} | ||
|
||
@Query('auth') | ||
findOne(@Args('id') id: number) { | ||
return this.authService.findOne(id); | ||
} | ||
|
||
@Mutation('updateAuth') | ||
update(@Args('updateAuthInput') updateAuthInput: UpdateAuthInput) { | ||
return this.authService.update(updateAuthInput.id, updateAuthInput); | ||
} | ||
|
||
@Mutation('removeAuth') | ||
remove(@Args('id') id: number) { | ||
return this.authService.remove(id); | ||
} | ||
} |
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,26 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { CreateAuthInput } from './dto/create-auth.input'; | ||
import { UpdateAuthInput } from './dto/update-auth.input'; | ||
|
||
@Injectable() | ||
export class AuthService { | ||
create(createAuthInput: CreateAuthInput) { | ||
return 'This action adds a new auth'; | ||
} | ||
|
||
findAll() { | ||
return `This action returns all auth`; | ||
} | ||
|
||
findOne(id: number) { | ||
return `This action returns a #${id} auth`; | ||
} | ||
|
||
update(id: number, updateAuthInput: UpdateAuthInput) { | ||
return `This action updates a #${id} auth`; | ||
} | ||
|
||
remove(id: number) { | ||
return `This action removes a #${id} auth`; | ||
} | ||
} |
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 @@ | ||
export class CreateAuthInput {} |
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,6 @@ | ||
import { CreateAuthInput } from './create-auth.input'; | ||
import { PartialType } from '@nestjs/mapped-types'; | ||
|
||
export class UpdateAuthInput extends PartialType(CreateAuthInput) { | ||
id: number; | ||
} |
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 @@ | ||
export class Auth {} |
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 @@ | ||
type Chat { | ||
# Example field (placeholder) | ||
exampleField: Int | ||
} | ||
|
||
input CreateChatInput { | ||
# Example field (placeholder) | ||
exampleField: Int | ||
} | ||
|
||
input UpdateChatInput { | ||
id: Int! | ||
} | ||
|
||
type Query { | ||
chat: [Chat]! | ||
chat(id: Int!): Chat | ||
} | ||
|
||
type Mutation { | ||
createChat(createChatInput: CreateChatInput!): Chat! | ||
updateChat(updateChatInput: UpdateChatInput!): Chat! | ||
removeChat(id: Int!): Chat | ||
} |
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,8 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { ChatService } from './chat.service'; | ||
import { ChatResolver } from './chat.resolver'; | ||
|
||
@Module({ | ||
providers: [ChatResolver, ChatService], | ||
}) | ||
export class ChatModule {} |
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,34 @@ | ||
import { Resolver, Query, Mutation, Args } from '@nestjs/graphql'; | ||
import { ChatService } from './chat.service'; | ||
import { CreateChatInput } from './dto/create-chat.input'; | ||
import { UpdateChatInput } from './dto/update-chat.input'; | ||
|
||
@Resolver('Chat') | ||
export class ChatResolver { | ||
constructor(private readonly chatService: ChatService) {} | ||
|
||
@Mutation('createChat') | ||
create(@Args('createChatInput') createChatInput: CreateChatInput) { | ||
return this.chatService.create(createChatInput); | ||
} | ||
|
||
@Query('chat') | ||
findAll() { | ||
return this.chatService.findAll(); | ||
} | ||
|
||
@Query('chat') | ||
findOne(@Args('id') id: number) { | ||
return this.chatService.findOne(id); | ||
} | ||
|
||
@Mutation('updateChat') | ||
update(@Args('updateChatInput') updateChatInput: UpdateChatInput) { | ||
return this.chatService.update(updateChatInput.id, updateChatInput); | ||
} | ||
|
||
@Mutation('removeChat') | ||
remove(@Args('id') id: number) { | ||
return this.chatService.remove(id); | ||
} | ||
} |
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,26 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { CreateChatInput } from './dto/create-chat.input'; | ||
import { UpdateChatInput } from './dto/update-chat.input'; | ||
|
||
@Injectable() | ||
export class ChatService { | ||
create(createChatInput: CreateChatInput) { | ||
return 'This action adds a new chat'; | ||
} | ||
|
||
findAll() { | ||
return `This action returns all chat`; | ||
} | ||
|
||
findOne(id: number) { | ||
return `This action returns a #${id} chat`; | ||
} | ||
|
||
update(id: number, updateChatInput: UpdateChatInput) { | ||
return `This action updates a #${id} chat`; | ||
} | ||
|
||
remove(id: number) { | ||
return `This action removes a #${id} chat`; | ||
} | ||
} |
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 @@ | ||
export class CreateChatInput {} |
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,6 @@ | ||
import { CreateChatInput } from './create-chat.input'; | ||
import { PartialType } from '@nestjs/mapped-types'; | ||
|
||
export class UpdateChatInput extends PartialType(CreateChatInput) { | ||
id: number; | ||
} |
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 @@ | ||
export class Chat {} |
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 @@ | ||
export class CreateUserInput {} |
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,6 @@ | ||
import { CreateUserInput } from './create-user.input'; | ||
import { PartialType } from '@nestjs/mapped-types'; | ||
|
||
export class UpdateUserInput extends PartialType(CreateUserInput) { | ||
id: number; | ||
} |
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 @@ | ||
export class User {} |
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 @@ | ||
type User { | ||
# Example field (placeholder) | ||
exampleField: Int | ||
} | ||
|
||
input CreateUserInput { | ||
# Example field (placeholder) | ||
exampleField: Int | ||
} | ||
|
||
input UpdateUserInput { | ||
id: Int! | ||
} | ||
|
||
type Query { | ||
users: [User]! | ||
user(id: Int!): User | ||
} | ||
|
||
type Mutation { | ||
createUser(createUserInput: CreateUserInput!): User! | ||
updateUser(updateUserInput: UpdateUserInput!): User! | ||
removeUser(id: Int!): User | ||
} |
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,8 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { UsersService } from './users.service'; | ||
import { UsersResolver } from './users.resolver'; | ||
|
||
@Module({ | ||
providers: [UsersResolver, UsersService], | ||
}) | ||
export class UsersModule {} |
Oops, something went wrong.