Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat2 #2

Merged
merged 2 commits into from Nov 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file added db.mwb
Binary file not shown.
21 changes: 21 additions & 0 deletions graph/common.graphqls
@@ -0,0 +1,21 @@
# common.graphqls

interface Node {
id: ID!
}

scalar Timestamp

interface Pagination {
pageInfo: PaginationInfo!
nodes: [Node!]!
}

type PaginationInfo {
page: Int!
paginationLength: Int!
hasNextPage: Boolean!
hasPreviousPage: Boolean!
count: Int!
totalCount: Int!
}
15 changes: 15 additions & 0 deletions graph/company.graphqls
@@ -0,0 +1,15 @@
# company.graphqls

type Company implements Node {
id: ID!
companyName: String!
representative: String!
phoneNumber: String!
departments: DepartmentPagination!
employees: EmployeePagination!
}

type CompanyPagination implements Pagination{
pageInfo: PaginationInfo!
nodes: [Company!]!
}
14 changes: 14 additions & 0 deletions graph/department.graphqls
@@ -0,0 +1,14 @@
# department.graphqls

type Department implements Node {
id: ID!
departmentName: String!
email: String!
company: Company!
employees: EmployeePagination!
}

type DepartmentPagination implements Pagination {
pageInfo: PaginationInfo!
nodes: [Department!]!
}
25 changes: 25 additions & 0 deletions graph/employee.graphqls
@@ -0,0 +1,25 @@
# employee.graphqls

type Employee implements Node {
id: ID!
name: String!
gender: Gender!
email: String!
latestLoginAt: Timestamp!
""" 扶養家族の人数 """
dependentsNum: Int!
""" 管理職かどうか """
isManager: Boolean!
department: Department!
company: Company!
}

enum Gender {
Male
Female
}

type EmployeePagination implements Pagination {
pageInfo: PaginationInfo!
nodes: [Employee!]!
}
52 changes: 52 additions & 0 deletions graph/mutations.graphqls
@@ -0,0 +1,52 @@
type Mutation {
createCompany(input: CreateCompanyInput!): Company!
updateCompany(input: UpdateCompanyInput!): Company!
deleteCompany(id: ID!): Boolean!
createDepartment(input: CreateDepartmentInput!): Department!
updateDepartment(input: UpdateDepartmentInput!): Department!
deleteDepartment(id: ID!): Boolean!
createEmployee(input: CreateEmployeeInput!): Employee!
updateEmployee(input: UpdateEmployeeInput!): Employee!
deleteEmployee(id: ID!): Boolean!
}

input CreateCompanyInput {
companyName: String!
representative: String!
phoneNumber: String!
}

input UpdateCompanyInput {
id: ID!
companyName: String
representative: String
phoneNumber: String
}

input CreateDepartmentInput {
departmentName: String!
email: String!
}

input UpdateDepartmentInput {
id: ID!
departmentName: String
email: String
}

input CreateEmployeeInput {
name: String!
gender: Gender!
email: String!
dependentsNum: Int!
isManager: Boolean!
}

input UpdateEmployeeInput {
id: ID!
name: String
gender: Gender
email: String
dependentsNum: Int
isManager: Boolean
}
15 changes: 15 additions & 0 deletions graph/query.graphqls
@@ -0,0 +1,15 @@
type Query {
company(id: ID!): Company
companies(limit: Int!,offset: Int): CompanyPagination!
department(id: ID!): Department
departments(limit: Int!,offset: Int): DepartmentPagination!
employee(id: ID!): Employee
employees(
limit: Int!,
offset: Int,
email: String
gender: Gender,
isManager: Boolean,
hasDependent: Boolean
): EmployeePagination!
}
28 changes: 0 additions & 28 deletions graph/schema.graphqls

This file was deleted.

29 changes: 0 additions & 29 deletions graph/schema.resolvers.go

This file was deleted.