mirror of
https://github.com/Unkn0wnCat/calapi.git
synced 2025-04-28 09:36:20 +02:00
107 lines
1.4 KiB
GraphQL
107 lines
1.4 KiB
GraphQL
# GraphQL schema example
|
|
#
|
|
# https://gqlgen.com/getting-started/
|
|
|
|
scalar Time
|
|
|
|
type Calendar {
|
|
id: ID!
|
|
name: String!
|
|
description: String!
|
|
|
|
events(after: Time, before: Time): [Event!]!
|
|
}
|
|
|
|
type Event {
|
|
id: ID!
|
|
title: String!
|
|
location: Location
|
|
description: String!
|
|
|
|
start: Time!
|
|
end: Time!
|
|
|
|
calendar: Calendar!
|
|
}
|
|
|
|
type Location {
|
|
lat: Float
|
|
lon: Float
|
|
|
|
name: String
|
|
address: String
|
|
}
|
|
|
|
type User {
|
|
id: ID!
|
|
name: String!
|
|
}
|
|
|
|
type Query {
|
|
events(after: Time, before: Time, calendar: ID): [Event!]!
|
|
calendars: [Calendar!]!
|
|
|
|
calendar(id: ID!): Calendar
|
|
event(id: ID!): Event
|
|
}
|
|
|
|
input SetLocation {
|
|
lat: Float
|
|
lon: Float
|
|
|
|
name: String
|
|
address: String
|
|
}
|
|
|
|
input NewEvent {
|
|
title: String!
|
|
location: SetLocation
|
|
description: String!
|
|
|
|
start: Time!
|
|
end: Time!
|
|
|
|
calendar: ID!
|
|
}
|
|
|
|
input EditEvent {
|
|
id: ID!
|
|
|
|
title: String
|
|
location: SetLocation
|
|
description: String
|
|
|
|
start: Time
|
|
end: Time
|
|
|
|
calendar: ID
|
|
}
|
|
|
|
input NewCalendar {
|
|
name: String!
|
|
description: String!
|
|
}
|
|
|
|
input EditCalendar {
|
|
id: ID!
|
|
|
|
name: String
|
|
description: String
|
|
}
|
|
|
|
input Login {
|
|
username: String!
|
|
password: String!
|
|
}
|
|
|
|
type Mutation {
|
|
createEvent(input: NewEvent!): Event!
|
|
editEvent(input: EditEvent!): Event!
|
|
deleteEvent(input: ID!): Boolean!
|
|
|
|
createCalendar(input: NewCalendar!): Calendar!
|
|
editCalendar(input: EditCalendar!): Calendar!
|
|
deleteCalendar(input: ID!): Boolean!
|
|
|
|
login(input: Login!): String!
|
|
}
|