all repos — caroster @ 54cb6c4b8a7dd7edbecc198ae921331a52d5aa90

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