70 lines
1.7 KiB
JavaScript
70 lines
1.7 KiB
JavaScript
import gql from "graphql-tag";
|
|
import {FRAGMENT_FLIGHT_FULL_INFO, FRAGMENT_FLIGHT_FULL_PRIVATE_INFO} from "src/graphql/fragments/flight";
|
|
import {FRAGMENT_FLIGHT_LIST_INFO} from "src/graphql/fragments/flight_list";
|
|
import {FRAGMENT_PHOTO_FULL_INFO} from "src/graphql/fragments/photo";
|
|
|
|
export const FLIGHTS_LIST = gql`
|
|
query FlightsList($eventId: Int, $aircraftId: Int, $copilotId: Int, $pointOfInterestId: Int, $limit: Int!, $offset: Int) {
|
|
flights(
|
|
eventId: $eventId,
|
|
aircraftId: $aircraftId,
|
|
copilotId: $copilotId,
|
|
pointOfInterestId: $pointOfInterestId,
|
|
limit: $limit,
|
|
offset: $offset
|
|
) {
|
|
totalItemsCount
|
|
items {
|
|
...flightListInfo
|
|
}
|
|
}
|
|
}
|
|
${FRAGMENT_FLIGHT_LIST_INFO}
|
|
`;
|
|
|
|
export const FLIGHTS_PUBLIC_LIST = gql`
|
|
query FlightsPublicList($username: String, $eventId: Int, $aircraftId: Int, $copilotId: Int, $pointOfInterestId: Int, $limit: Int!, $offset: Int) {
|
|
flights(
|
|
username: $username,
|
|
eventId: $eventId,
|
|
aircraftId: $aircraftId,
|
|
copilotId: $copilotId,
|
|
pointOfInterestId: $pointOfInterestId,
|
|
limit: $limit,
|
|
offset: $offset,
|
|
public: true
|
|
) {
|
|
totalItemsCount
|
|
items {
|
|
...flightListInfo
|
|
pilot {
|
|
id
|
|
publicUsername
|
|
}
|
|
}
|
|
}
|
|
}
|
|
${FRAGMENT_FLIGHT_LIST_INFO}
|
|
`;
|
|
|
|
export const FLIGHT_DETAIL = gql`
|
|
query FlightDetail($id: Int!, $username: String) {
|
|
flight(id: $id, username: $username) {
|
|
...flightFullPrivateInfo
|
|
}
|
|
}
|
|
|
|
${FRAGMENT_FLIGHT_FULL_PRIVATE_INFO}
|
|
`;
|
|
|
|
export const FLIGHT_PUBLIC_DETAIL = gql`
|
|
query FlightPublicDetail($urlSlug: String!, $username: String) {
|
|
flight(urlSlug: $urlSlug, username: $username, public: true) {
|
|
...flightFullInfo
|
|
}
|
|
}
|
|
|
|
${FRAGMENT_FLIGHT_FULL_INFO}
|
|
`;
|
|
|