implement graphQL and init postgres
This commit is contained in:
100
local/graphql/schema/schema.graphql
Normal file
100
local/graphql/schema/schema.graphql
Normal file
@@ -0,0 +1,100 @@
|
||||
# Minimal GraphQL Schema for Phase 1
|
||||
|
||||
# Core Types
|
||||
type User {
|
||||
id: String!
|
||||
email: String!
|
||||
fullName: String
|
||||
createdAt: String!
|
||||
updatedAt: String!
|
||||
}
|
||||
|
||||
type Project {
|
||||
id: String!
|
||||
name: String!
|
||||
description: String
|
||||
ownerId: String!
|
||||
createdAt: String!
|
||||
updatedAt: String!
|
||||
}
|
||||
|
||||
type Task {
|
||||
id: String!
|
||||
title: String!
|
||||
description: String
|
||||
status: String!
|
||||
priority: String!
|
||||
projectId: String!
|
||||
createdAt: String!
|
||||
updatedAt: String!
|
||||
}
|
||||
|
||||
# Input Types
|
||||
input LoginInput {
|
||||
email: String!
|
||||
password: String!
|
||||
}
|
||||
|
||||
input UserCreateInput {
|
||||
email: String!
|
||||
fullName: String!
|
||||
password: String!
|
||||
}
|
||||
|
||||
input ProjectCreateInput {
|
||||
name: String!
|
||||
description: String
|
||||
ownerId: String!
|
||||
}
|
||||
|
||||
input TaskCreateInput {
|
||||
title: String!
|
||||
description: String
|
||||
status: String
|
||||
priority: String
|
||||
projectId: String!
|
||||
}
|
||||
|
||||
# Response Types
|
||||
type AuthResponse {
|
||||
token: String!
|
||||
user: User!
|
||||
}
|
||||
|
||||
type MessageResponse {
|
||||
message: String!
|
||||
success: Boolean!
|
||||
}
|
||||
|
||||
# Queries
|
||||
type Query {
|
||||
# Authentication
|
||||
me: User!
|
||||
|
||||
# Users
|
||||
users: [User!]!
|
||||
user(id: String!): User
|
||||
|
||||
# Projects
|
||||
projects: [Project!]!
|
||||
project(id: String!): Project
|
||||
|
||||
# Tasks
|
||||
tasks(projectId: String): [Task!]!
|
||||
task(id: String!): Task
|
||||
}
|
||||
|
||||
# Mutations
|
||||
type Mutation {
|
||||
# Authentication
|
||||
login(input: LoginInput!): AuthResponse!
|
||||
|
||||
# Users
|
||||
createUser(input: UserCreateInput!): User!
|
||||
|
||||
# Projects
|
||||
createProject(input: ProjectCreateInput!): Project!
|
||||
|
||||
# Tasks
|
||||
createTask(input: TaskCreateInput!): Task!
|
||||
}
|
||||
Reference in New Issue
Block a user