qpa-client/schema.graphql

201 lines
3.3 KiB
GraphQL
Raw Normal View History

2019-08-16 10:30:29 +02:00
type User {
name: String!
username: String
email: String!
id: ID!
events: [CalendarEvent]!
roles: [UserRole!]
}
type UserRole {
user: User!
type: RoleType!
}
scalar Date
scalar RoleType
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]
meta: EventMeta
}
type EventMeta {
tags: [String]!
}
type EventOccurrence {
id: ID!
event: CalendarEvent!
start: String!
end: 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
}
input GrantRoleInput {
userId: ID!
roleType: RoleType!
}
input RevokeRoleInput {
userId: ID!
roleType: RoleType!
}
input AcceptEventInput {
eventId: ID!,
accepted: Boolean!
comment: String
}
type Error {
path: String!
message: String!
}
type Mutation {
# Auth
signup(input: SignupInput!): [Error]
signin(input: SigninInput!): UserSession!
requestInvite(input: RequestInviteInput!): Boolean!
grantRole(input: GrantRoleInput!): User!
revokeRole(input: GrantRoleInput!): User!
# Event
createEvent(input: CreateEventInput!): CalendarEvent
updateEvent(input: UpdateEventInput!): CalendarEvent
acceptEvent(input: AcceptEventInput!): CalendarEvent
}
type Query {
# Auth
me: User
# Event
event(id: ID!): CalendarEvent
events(filter: EventsQueryFilter!): [CalendarEvent]
occurrences(filter: OccurrencesQueryFilter!): [EventOccurrence]
occurrence(id: ID!): EventOccurrence
}