all repos — caroster @ 69a8f789f50a85eb1d8519dd7d3c54eba39233c3

[Octree] Group carpool to your event https://caroster.io

frontend/graphql/event.gql (view raw)

  1fragment EventFields on EventEntity {
  2  id
  3  attributes {
  4    uuid
  5    name
  6    description
  7    enabled_modules
  8    email
  9    administrators
 10    date
 11    address
 12    latitude
 13    longitude
 14    position
 15    waitingPassengers {
 16      data {
 17        id
 18        attributes {
 19          name
 20          email
 21          location
 22          user {
 23            data {
 24              id
 25              attributes {
 26                firstName
 27                lastName
 28              }
 29            }
 30          }
 31        }
 32      }
 33    }
 34    travels(pagination: {limit: 500}) {
 35      data {
 36        id
 37        attributes {
 38          meeting
 39          meeting_latitude
 40          meeting_longitude
 41          departure
 42          details
 43          vehicleName
 44          phone_number
 45          seats
 46          user {
 47            data {
 48              id
 49            }
 50          }
 51          passengers {
 52            data {
 53              id
 54              attributes {
 55                name
 56                location
 57                user {
 58                  data {
 59                    id
 60                    attributes {
 61                      firstName
 62                      lastName
 63                    }
 64                  }
 65                }
 66              }
 67            }
 68          }
 69        }
 70      }
 71    }
 72  }
 73}
 74
 75mutation createEvent(
 76  $name: String!
 77  $email: String!
 78  $date: Date
 79  $address: String
 80  $latitude: Float
 81  $longitude: Float
 82  $description: String
 83  $newsletter: Boolean
 84) {
 85  createEvent(
 86    data: {
 87      name: $name
 88      email: $email
 89      date: $date
 90      latitude: $latitude
 91      longitude: $longitude
 92      address: $address
 93      description: $description
 94      newsletter: $newsletter
 95    }
 96  ) {
 97    data {
 98      ...EventFields
 99    }
100  }
101}
102
103mutation updateEvent($uuid: String!, $eventUpdate: EventInput!) {
104  updateEventByUUID(uuid: $uuid, data: $eventUpdate) {
105    data {
106      ...EventFields
107    }
108  }
109}
110
111mutation addEventAdmin($eventId: ID!, $email: String!) {
112  addEventAdmin(eventId: $eventId, email: $email) {
113    data {
114      id
115      attributes {
116        administrators
117      }
118    }
119  }
120}
121
122mutation deleteEventAdmin($eventId: ID!, $email: String!) {
123  deleteEventAdmin(eventId: $eventId, email: $email) {
124    data {
125      id
126      attributes {
127        administrators
128      }
129    }
130  }
131}
132
133query eventByUUID($uuid: String!) {
134  eventByUUID(uuid: $uuid) {
135    data {
136      ...EventFields
137    }
138  }
139}