1. inisialisasi backend golang
This commit is contained in:
28
backend/graph/graphqls/schema.graphqls
Normal file
28
backend/graph/graphqls/schema.graphqls
Normal file
@@ -0,0 +1,28 @@
|
||||
# GraphQL schema example
|
||||
#
|
||||
# https://gqlgen.com/getting-started/
|
||||
|
||||
type Todo {
|
||||
id: ID!
|
||||
text: String!
|
||||
done: Boolean!
|
||||
user: User!
|
||||
}
|
||||
|
||||
type User {
|
||||
id: ID!
|
||||
name: String!
|
||||
}
|
||||
|
||||
type Query {
|
||||
todos: [Todo!]!
|
||||
}
|
||||
|
||||
input NewTodo {
|
||||
text: String!
|
||||
userId: String!
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
createTodo(input: NewTodo!): Todo!
|
||||
}
|
||||
34
backend/graph/graphqls/staff.graphqls
Normal file
34
backend/graph/graphqls/staff.graphqls
Normal file
@@ -0,0 +1,34 @@
|
||||
# model staff
|
||||
type Staff {
|
||||
staff_id: ID!
|
||||
nip: String!
|
||||
name: String!
|
||||
email: String!
|
||||
phone_number: String
|
||||
is_active: String
|
||||
is_login: Boolean
|
||||
token: String
|
||||
id_google_sign_in: String!
|
||||
display_name_google_sign_in: String
|
||||
created_at: String
|
||||
last_updated_at: String
|
||||
}
|
||||
|
||||
# model token response ketika login
|
||||
type TokenResponse {
|
||||
token: String
|
||||
message: String
|
||||
}
|
||||
|
||||
# query search
|
||||
extend type Query {
|
||||
searchStaffByEmail(email: String!): Staff!
|
||||
staffGetByStaffId(staff_id: ID!): Staff!
|
||||
staffListBySearch(search:String, page:Int, maxPerPage: Int): [Staff!]!
|
||||
}
|
||||
|
||||
# mutation untuk perubahan data
|
||||
extend type Mutation {
|
||||
generateToken(email: String!, id_google_sign_in:String!): TokenResponse!
|
||||
loginAttendance(email:String!, id_google_sign_in:String!) : Staff!
|
||||
}
|
||||
Reference in New Issue
Block a user