all repos — caroster @ c940fdf8a245590346be0f667608bcec34974196

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