all repos — caroster @ 25ef569b9aff78df82eea6d516cca3a4aeccbb8a

[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    date
 10    address
 11    latitude
 12    longitude
 13    position
 14    waitingPassengers {
 15      data {
 16        id
 17        attributes {
 18          name
 19          email
 20          location
 21          user {
 22            data {
 23              id
 24              attributes {
 25                firstName
 26                lastName
 27              }
 28            }
 29          }
 30        }
 31      }
 32    }
 33    travels(pagination: {limit: 500}) {
 34      data {
 35        id
 36        attributes {
 37          meeting
 38          meeting_latitude
 39          meeting_longitude 
 40          departure
 41          details
 42          vehicleName
 43          phone_number
 44          seats
 45          passengers {
 46            data {
 47              id
 48              attributes {
 49                name
 50                location
 51                user {
 52                  data {
 53                    id
 54                    attributes {
 55                      firstName
 56                      lastName
 57                    }
 58                  }
 59                }
 60              }
 61            }
 62          }
 63        }
 64      }
 65    }
 66  }
 67}
 68
 69mutation createEvent(
 70  $name: String!
 71  $email: String!
 72  $date: Date
 73  $address: String
 74  $latitude: Float
 75  $longitude: Float
 76  $description: String
 77  $newsletter: Boolean
 78) {
 79  createEvent(
 80    data: {
 81      name: $name
 82      email: $email
 83      date: $date
 84      latitude: $latitude
 85      longitude: $longitude
 86      address: $address
 87      description: $description
 88      newsletter: $newsletter
 89    }
 90  ) {
 91    data {
 92      ...EventFields
 93    }
 94  }
 95}
 96
 97mutation updateEvent($uuid: String!, $eventUpdate: EventInput!) {
 98  updateEventByUUID(uuid: $uuid, data: $eventUpdate) {
 99    data {
100      ...EventFields
101    }
102  }
103}
104
105query eventByUUID($uuid: String!) {
106  eventByUUID(uuid: $uuid) {
107    data {
108      ...EventFields
109    }
110  }
111}