qpa-client/schema.graphql
2019-06-05 07:57:15 +02:00

172 lines
2.8 KiB
GraphQL

type User {
name: String!
username: String!
email: String!
id: ID!
}
scalar Date
type UserSession {
hash: String!
user: User!
ctime: Date!
isValid: Boolean!
}
input SignupInput {
email: String!
username: String!
name: String!
}
input SigninInput {
hash: String!
}
input RequestInviteInput {
email: String!
}
# ------
# Events
# ------
type CalendarEvent {
id: ID!
owner: User!
info: [EventInformation]!
time: EventTime!
status: EventStatus!
location: Location!
occurrences: [EventOccurrence]
}
type EventOccurrence {
id: ID!
event: CalendarEvent!
start: String!
utcStart: String!
end: String!
utcEnd: String!
timeZone: String!
}
type Location {
address: String
name: String
}
type EventTime {
timeZone: TimeZone
start: Timestamp
end: Timestamp
recurrence: String
exceptions: String
}
# in RFC3339 e.g. 2002-10-02T10:00:00-05:00 or 2002-10-02T15:00:00Z
scalar Timestamp
# IANA Timezone e.g. "Europe/Zurich"
scalar TimeZone
# "confirmed" | "tentative" | "cancelled"
scalar EventStatus
# e.g. 'de', 'en', etc'
scalar Language
# Event information for presentation
type EventInformation {
language: String!
title: String!
description: String
}
scalar Category
input EventsQueryFilter {
owner: ID
limit: Int
from: Timestamp
to: Timestamp
categories: [Category]
}
input OccurrencesQueryFilter {
from: Timestamp
to: Timestamp
timeZone: TimeZone
categories: [Category]
limit: Int
}
input EventTimeInput {
timeZone: TimeZone!
start: Timestamp!
end: Timestamp!
recurrence: String
}
input EventInformationInput {
language: String!
title: String!
description: String
}
input EventLocationInput {
address: String
name: String
}
input EventMetaInput {
tags: [String]!
}
input CreateEventInput {
time: EventTimeInput!
info: [EventInformationInput]!
location: EventLocationInput!
meta: EventMetaInput!
status: String!
}
input UpdateEventInput {
id: ID!
time: EventTimeInput
info: [EventInformationInput!]
location: EventLocationInput
meta: EventMetaInput
status: String
}
type Error {
path: String!
message: String!
}
type Mutation {
# Auth
signup(input: SignupInput): [Error]
signin(input: SigninInput): UserSession!
requestInvite(input: RequestInviteInput): Boolean!
# Event
createEvent(input: CreateEventInput!): CalendarEvent
updateEvent(input: UpdateEventInput!): CalendarEvent
}
type Query {
# Auth
me: User
# Event
event(id: ID!): CalendarEvent
events(filter: EventsQueryFilter!): [CalendarEvent]
occurrences(filter: OccurrencesQueryFilter!): [EventOccurrence]
}