diff --git a/src/App.tsx b/src/App.tsx index c53376d..7f0d470 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -4,11 +4,14 @@ import { useSubscription } from "@apollo/client"; import { subscriptionQueueSchedule } from "./components/GlobalState/scheduleSubscription"; import { useContext, useEffect, useRef } from "react"; import { GlobalStateContext } from "./components/GlobalState/GlobalState"; +import { Toast } from "primereact/toast"; function App() { const { setNightPlans, setPlansSummary, setLoadingPlan, uuid } = useContext(GlobalStateContext); + const toast = useRef(null); + const { data: scheduleData, loading: subscriptionLoading } = useSubscription( subscriptionQueueSchedule, { @@ -18,8 +21,18 @@ function App() { useEffect(() => { if (!subscriptionLoading) { - setNightPlans(scheduleData?.queueSchedule?.nightPlans?.nightTimeline); - setPlansSummary(scheduleData?.queueSchedule?.plansSummary); + if (scheduleData.queueSchedule.__typename === "NewNightPlans") { + setNightPlans(scheduleData.queueSchedule.nightPlans.nightTimeline); + setPlansSummary(scheduleData.queueSchedule.plansSummary); + } else if (scheduleData.queueSchedule.__typename === "NightPlansError") { + toast.current?.show({ + severity: "error", + summary: "Error", + detail: scheduleData.queueSchedule.error, + }); + setNightPlans([]); + setPlansSummary({} as any); + } setLoadingPlan(false); } }, [scheduleData, subscriptionLoading]); @@ -27,6 +40,7 @@ function App() { return ( + ); } diff --git a/src/apollo-client.ts b/src/apollo-client.ts index 8af8d0e..b0e9398 100644 --- a/src/apollo-client.ts +++ b/src/apollo-client.ts @@ -10,6 +10,21 @@ const wsLink = new GraphQLWsLink( import.meta.env.VITE_API_URL ?? "https://gpp-schedule-staging.herokuapp.com/graphql" }`, + + keepAlive: 10000, + retryAttempts: Infinity, + shouldRetry: () => true, + on: { + connected: () => { + console.log("Socket successfully connected"); + }, + error: (error) => { + console.log("Socket error", error); + }, + closed: () => { + console.log("Socket closed"); + }, + }, }) ); diff --git a/src/components/ControlPanel/ControlPanel.tsx b/src/components/ControlPanel/ControlPanel.tsx index e46a3bd..31aa8a7 100644 --- a/src/components/ControlPanel/ControlPanel.tsx +++ b/src/components/ControlPanel/ControlPanel.tsx @@ -1,4 +1,4 @@ -import { useState, useRef, useContext } from "react"; +import { useState, useRef, useContext, useEffect } from "react"; import { GlobalStateContext } from "../GlobalState/GlobalState"; import "./ControlPanel.scss"; @@ -34,9 +34,13 @@ export default function ControlPanel() { ]; const [numNight, setNumNight] = useState(1); - // const { isReady, txMessage } = useContext(WebsocketContext); - const [schedule, { loading, error, data: scheduleData }] = - useLazyQuery(scheduleQuery); + const [validInputs, setValidInputs] = useState(false); + const [schedule, { loading, error, data: scheduleData }] = useLazyQuery( + scheduleQuery, + { + fetchPolicy: "no-cache", + } + ); const { thesis, @@ -51,6 +55,60 @@ export default function ControlPanel() { uuid, } = useContext(GlobalStateContext); + function validateInputs() { + let valid = true; + if (numNight < 1) { + toast.current?.show({ + severity: "error", + summary: "Error", + detail: "Number of nights must be at least 1", + life: 3000, + }); + valid = false; + } + + let dateRange = 1; + if (datesState) { + if (datesState[0] && datesState[1]) { + dateRange = + 1 + + Math.floor( + Math.abs(datesState[1].getTime() - datesState[0].getTime()) / + 1000 / + 60 / + 60 / + 24 + ); + } + } + + if (dateRange < 2 && !semesterVisibility) { + toast.current?.show({ + severity: "error", + summary: "Error", + detail: "A date range should be selected or use semester visibility", + life: 3000, + }); + valid = false; + } + + if (numNight > dateRange && !semesterVisibility) { + toast.current?.show({ + severity: "error", + summary: "Error", + detail: "Number of nights cannot be greater than date range", + life: 3000, + }); + valid = false; + } + return valid; + } + + useEffect(() => { + if (validateInputs()) setValidInputs(true); + else setValidInputs(false); + }, [numNight, datesState, semesterVisibility]); + const customBase64Uploader = async (event: FileUploadHandlerEvent) => { // convert file to base64 encoded const file = event.files[0]; @@ -83,7 +141,8 @@ export default function ControlPanel() { datesState !== null && datesState.length >= 2 && Array.isArray(datesState) && - numNight + numNight && + validInputs ); const onRunClick = () => { @@ -99,6 +158,9 @@ export default function ControlPanel() { thesisFactor: thesis, semesterVisibility: semesterVisibility, power: power, + whaPower: whaPower, + metPower: metPower, + visPower: visPower, }, }); }; diff --git a/src/components/ControlPanel/query.ts b/src/components/ControlPanel/query.ts index f14c59c..e42a5d6 100644 --- a/src/components/ControlPanel/query.ts +++ b/src/components/ControlPanel/query.ts @@ -10,6 +10,9 @@ export const scheduleQuery = graphql(` $semesterVisibility: Boolean! $thesisFactor: Float $power: Int + $metPower: Float + $whaPower: Float + $visPower: Float ) { testSubQuery( scheduleId: $scheduleId @@ -20,6 +23,9 @@ export const scheduleQuery = graphql(` endTime: $endTime thesisFactor: $thesisFactor power: $power + metPower: $metPower + whaPower: $whaPower + visPower: $visPower semesterVisibility: $semesterVisibility numNightsToSchedule: $numNightsToSchedule } diff --git a/src/components/GlobalState/scheduleSubscription.tsx b/src/components/GlobalState/scheduleSubscription.tsx index e1622e5..b0dbff9 100644 --- a/src/components/GlobalState/scheduleSubscription.tsx +++ b/src/components/GlobalState/scheduleSubscription.tsx @@ -3,55 +3,61 @@ import { graphql } from "../../gql"; export const subscriptionQueueSchedule = graphql(` subscription queueSchedule($scheduleId: String!) { queueSchedule(scheduleId: $scheduleId) { - nightPlans { - nightTimeline { - nightIndex - timeEntriesBySite { - site - mornTwilight - eveTwilight - timeEntries { - startTimeSlots - event - plan { - startTime - nightConditions { - iq - cc - } - visits { - obsId - endTime - altitude - atomEndIdx - atomStartIdx + __typename + ... on NewNightPlans { + nightPlans { + nightTimeline { + nightIndex + timeEntriesBySite { + site + mornTwilight + eveTwilight + timeEntries { + startTimeSlots + event + plan { startTime - instrument - fpu - disperser - filters - score - obsClass - completion - peakScore - requiredConditions { + nightConditions { iq cc } - } - nightStats { - timeLoss - planScore - nToos - completionFraction - programCompletion + visits { + obsId + endTime + altitude + atomEndIdx + atomStartIdx + startTime + instrument + fpu + disperser + filters + score + obsClass + completion + peakScore + requiredConditions { + iq + cc + } + } + nightStats { + timeLoss + planScore + nToos + completionFraction + programCompletion + } } } } } } + plansSummary + } + ... on NightPlansError { + error } - plansSummary } } `); diff --git a/src/gql/gql.ts b/src/gql/gql.ts index cdae8fd..7d03863 100644 --- a/src/gql/gql.ts +++ b/src/gql/gql.ts @@ -13,18 +13,18 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/ * Therefore it is highly recommended to use the babel-plugin for production. */ const documents = { - "\n query testSubQuery(\n $scheduleId: String!\n $startTime: String!\n $endTime: String!\n $sites: Sites!\n $mode: SchedulerModes!\n $numNightsToSchedule: Int!\n $semesterVisibility: Boolean!\n $thesisFactor: Float\n $power: Int\n ) {\n testSubQuery(\n scheduleId: $scheduleId\n newScheduleInput: {\n startTime: $startTime\n sites: $sites\n mode: $mode\n endTime: $endTime\n thesisFactor: $thesisFactor\n power: $power\n semesterVisibility: $semesterVisibility\n numNightsToSchedule: $numNightsToSchedule\n }\n )\n }\n": types.TestSubQueryDocument, - "\n subscription queueSchedule($scheduleId: String!) {\n queueSchedule(scheduleId: $scheduleId) {\n nightPlans {\n nightTimeline {\n nightIndex\n timeEntriesBySite {\n site\n mornTwilight\n eveTwilight\n timeEntries {\n startTimeSlots\n event\n plan {\n startTime\n nightConditions {\n iq\n cc\n }\n visits {\n obsId\n endTime\n altitude\n atomEndIdx\n atomStartIdx\n startTime\n instrument\n fpu\n disperser\n filters\n score\n obsClass\n completion\n peakScore\n requiredConditions {\n iq\n cc\n }\n }\n nightStats {\n timeLoss\n planScore\n nToos\n completionFraction\n programCompletion\n }\n }\n }\n }\n }\n }\n plansSummary\n }\n }\n": types.QueueScheduleDocument, + "\n query testSubQuery(\n $scheduleId: String!\n $startTime: String!\n $endTime: String!\n $sites: Sites!\n $mode: SchedulerModes!\n $numNightsToSchedule: Int!\n $semesterVisibility: Boolean!\n $thesisFactor: Float\n $power: Int\n $metPower: Float\n $whaPower: Float\n $visPower: Float\n ) {\n testSubQuery(\n scheduleId: $scheduleId\n newScheduleInput: {\n startTime: $startTime\n sites: $sites\n mode: $mode\n endTime: $endTime\n thesisFactor: $thesisFactor\n power: $power\n metPower: $metPower\n whaPower: $whaPower\n visPower: $visPower\n semesterVisibility: $semesterVisibility\n numNightsToSchedule: $numNightsToSchedule\n }\n )\n }\n": types.TestSubQueryDocument, + "\n subscription queueSchedule($scheduleId: String!) {\n queueSchedule(scheduleId: $scheduleId) {\n __typename\n ... on NewNightPlans {\n nightPlans {\n nightTimeline {\n nightIndex\n timeEntriesBySite {\n site\n mornTwilight\n eveTwilight\n timeEntries {\n startTimeSlots\n event\n plan {\n startTime\n nightConditions {\n iq\n cc\n }\n visits {\n obsId\n endTime\n altitude\n atomEndIdx\n atomStartIdx\n startTime\n instrument\n fpu\n disperser\n filters\n score\n obsClass\n completion\n peakScore\n requiredConditions {\n iq\n cc\n }\n }\n nightStats {\n timeLoss\n planScore\n nToos\n completionFraction\n programCompletion\n }\n }\n }\n }\n }\n }\n plansSummary\n }\n ... on NightPlansError {\n error\n }\n }\n }\n": types.QueueScheduleDocument, }; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n query testSubQuery(\n $scheduleId: String!\n $startTime: String!\n $endTime: String!\n $sites: Sites!\n $mode: SchedulerModes!\n $numNightsToSchedule: Int!\n $semesterVisibility: Boolean!\n $thesisFactor: Float\n $power: Int\n ) {\n testSubQuery(\n scheduleId: $scheduleId\n newScheduleInput: {\n startTime: $startTime\n sites: $sites\n mode: $mode\n endTime: $endTime\n thesisFactor: $thesisFactor\n power: $power\n semesterVisibility: $semesterVisibility\n numNightsToSchedule: $numNightsToSchedule\n }\n )\n }\n"): (typeof documents)["\n query testSubQuery(\n $scheduleId: String!\n $startTime: String!\n $endTime: String!\n $sites: Sites!\n $mode: SchedulerModes!\n $numNightsToSchedule: Int!\n $semesterVisibility: Boolean!\n $thesisFactor: Float\n $power: Int\n ) {\n testSubQuery(\n scheduleId: $scheduleId\n newScheduleInput: {\n startTime: $startTime\n sites: $sites\n mode: $mode\n endTime: $endTime\n thesisFactor: $thesisFactor\n power: $power\n semesterVisibility: $semesterVisibility\n numNightsToSchedule: $numNightsToSchedule\n }\n )\n }\n"]; +export function graphql(source: "\n query testSubQuery(\n $scheduleId: String!\n $startTime: String!\n $endTime: String!\n $sites: Sites!\n $mode: SchedulerModes!\n $numNightsToSchedule: Int!\n $semesterVisibility: Boolean!\n $thesisFactor: Float\n $power: Int\n $metPower: Float\n $whaPower: Float\n $visPower: Float\n ) {\n testSubQuery(\n scheduleId: $scheduleId\n newScheduleInput: {\n startTime: $startTime\n sites: $sites\n mode: $mode\n endTime: $endTime\n thesisFactor: $thesisFactor\n power: $power\n metPower: $metPower\n whaPower: $whaPower\n visPower: $visPower\n semesterVisibility: $semesterVisibility\n numNightsToSchedule: $numNightsToSchedule\n }\n )\n }\n"): (typeof documents)["\n query testSubQuery(\n $scheduleId: String!\n $startTime: String!\n $endTime: String!\n $sites: Sites!\n $mode: SchedulerModes!\n $numNightsToSchedule: Int!\n $semesterVisibility: Boolean!\n $thesisFactor: Float\n $power: Int\n $metPower: Float\n $whaPower: Float\n $visPower: Float\n ) {\n testSubQuery(\n scheduleId: $scheduleId\n newScheduleInput: {\n startTime: $startTime\n sites: $sites\n mode: $mode\n endTime: $endTime\n thesisFactor: $thesisFactor\n power: $power\n metPower: $metPower\n whaPower: $whaPower\n visPower: $visPower\n semesterVisibility: $semesterVisibility\n numNightsToSchedule: $numNightsToSchedule\n }\n )\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n subscription queueSchedule($scheduleId: String!) {\n queueSchedule(scheduleId: $scheduleId) {\n nightPlans {\n nightTimeline {\n nightIndex\n timeEntriesBySite {\n site\n mornTwilight\n eveTwilight\n timeEntries {\n startTimeSlots\n event\n plan {\n startTime\n nightConditions {\n iq\n cc\n }\n visits {\n obsId\n endTime\n altitude\n atomEndIdx\n atomStartIdx\n startTime\n instrument\n fpu\n disperser\n filters\n score\n obsClass\n completion\n peakScore\n requiredConditions {\n iq\n cc\n }\n }\n nightStats {\n timeLoss\n planScore\n nToos\n completionFraction\n programCompletion\n }\n }\n }\n }\n }\n }\n plansSummary\n }\n }\n"): (typeof documents)["\n subscription queueSchedule($scheduleId: String!) {\n queueSchedule(scheduleId: $scheduleId) {\n nightPlans {\n nightTimeline {\n nightIndex\n timeEntriesBySite {\n site\n mornTwilight\n eveTwilight\n timeEntries {\n startTimeSlots\n event\n plan {\n startTime\n nightConditions {\n iq\n cc\n }\n visits {\n obsId\n endTime\n altitude\n atomEndIdx\n atomStartIdx\n startTime\n instrument\n fpu\n disperser\n filters\n score\n obsClass\n completion\n peakScore\n requiredConditions {\n iq\n cc\n }\n }\n nightStats {\n timeLoss\n planScore\n nToos\n completionFraction\n programCompletion\n }\n }\n }\n }\n }\n }\n plansSummary\n }\n }\n"]; +export function graphql(source: "\n subscription queueSchedule($scheduleId: String!) {\n queueSchedule(scheduleId: $scheduleId) {\n __typename\n ... on NewNightPlans {\n nightPlans {\n nightTimeline {\n nightIndex\n timeEntriesBySite {\n site\n mornTwilight\n eveTwilight\n timeEntries {\n startTimeSlots\n event\n plan {\n startTime\n nightConditions {\n iq\n cc\n }\n visits {\n obsId\n endTime\n altitude\n atomEndIdx\n atomStartIdx\n startTime\n instrument\n fpu\n disperser\n filters\n score\n obsClass\n completion\n peakScore\n requiredConditions {\n iq\n cc\n }\n }\n nightStats {\n timeLoss\n planScore\n nToos\n completionFraction\n programCompletion\n }\n }\n }\n }\n }\n }\n plansSummary\n }\n ... on NightPlansError {\n error\n }\n }\n }\n"): (typeof documents)["\n subscription queueSchedule($scheduleId: String!) {\n queueSchedule(scheduleId: $scheduleId) {\n __typename\n ... on NewNightPlans {\n nightPlans {\n nightTimeline {\n nightIndex\n timeEntriesBySite {\n site\n mornTwilight\n eveTwilight\n timeEntries {\n startTimeSlots\n event\n plan {\n startTime\n nightConditions {\n iq\n cc\n }\n visits {\n obsId\n endTime\n altitude\n atomEndIdx\n atomStartIdx\n startTime\n instrument\n fpu\n disperser\n filters\n score\n obsClass\n completion\n peakScore\n requiredConditions {\n iq\n cc\n }\n }\n nightStats {\n timeLoss\n planScore\n nToos\n completionFraction\n programCompletion\n }\n }\n }\n }\n }\n }\n plansSummary\n }\n ... on NightPlansError {\n error\n }\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. diff --git a/src/gql/graphql.ts b/src/gql/graphql.ts index 609512a..f95cd8a 100644 --- a/src/gql/graphql.ts +++ b/src/gql/graphql.ts @@ -44,6 +44,13 @@ export type NewNightPlans = { plansSummary: Scalars['JSON']; }; +export type NightPlansError = { + __typename?: 'NightPlansError'; + error: Scalars['String']; +}; + +export type NightPlansResponse = NewNightPlans | NightPlansError; + export type Query = { __typename?: 'Query'; allPlans: Array; @@ -149,7 +156,7 @@ export type Site = export type Subscription = { __typename?: 'Subscription'; - queueSchedule: NewNightPlans; + queueSchedule: NightPlansResponse; }; @@ -175,6 +182,9 @@ export type TestSubQueryQueryVariables = Exact<{ semesterVisibility: Scalars['Boolean']; thesisFactor?: InputMaybe; power?: InputMaybe; + metPower?: InputMaybe; + whaPower?: InputMaybe; + visPower?: InputMaybe; }>; @@ -185,8 +195,8 @@ export type QueueScheduleSubscriptionVariables = Exact<{ }>; -export type QueueScheduleSubscription = { __typename?: 'Subscription', queueSchedule: { __typename?: 'NewNightPlans', plansSummary: any, nightPlans: { __typename?: 'SNightTimelines', nightTimeline: Array<{ __typename?: 'SNightInTimeline', nightIndex: number, timeEntriesBySite: Array<{ __typename?: 'TimelineEntriesBySite', site: Site, mornTwilight: any, eveTwilight: any, timeEntries: Array<{ __typename?: 'STimelineEntry', startTimeSlots: number, event: string, plan: { __typename?: 'SPlan', startTime: any, nightConditions: { __typename?: 'SConditions', iq: string, cc: string }, visits: Array<{ __typename?: 'SVisit', obsId: any, endTime: any, altitude: Array, atomEndIdx: number, atomStartIdx: number, startTime: any, instrument: string, fpu: string, disperser: string, filters: Array, score: number, obsClass: string, completion: string, peakScore: number, requiredConditions: { __typename?: 'SConditions', iq: string, cc: string } }>, nightStats: { __typename?: 'SNightStats', timeLoss: any, planScore: number, nToos: number, completionFraction: any, programCompletion: any } } }> }> }> } } }; +export type QueueScheduleSubscription = { __typename?: 'Subscription', queueSchedule: { __typename: 'NewNightPlans', plansSummary: any, nightPlans: { __typename?: 'SNightTimelines', nightTimeline: Array<{ __typename?: 'SNightInTimeline', nightIndex: number, timeEntriesBySite: Array<{ __typename?: 'TimelineEntriesBySite', site: Site, mornTwilight: any, eveTwilight: any, timeEntries: Array<{ __typename?: 'STimelineEntry', startTimeSlots: number, event: string, plan: { __typename?: 'SPlan', startTime: any, nightConditions: { __typename?: 'SConditions', iq: string, cc: string }, visits: Array<{ __typename?: 'SVisit', obsId: any, endTime: any, altitude: Array, atomEndIdx: number, atomStartIdx: number, startTime: any, instrument: string, fpu: string, disperser: string, filters: Array, score: number, obsClass: string, completion: string, peakScore: number, requiredConditions: { __typename?: 'SConditions', iq: string, cc: string } }>, nightStats: { __typename?: 'SNightStats', timeLoss: any, planScore: number, nToos: number, completionFraction: any, programCompletion: any } } }> }> }> } } | { __typename: 'NightPlansError', error: string } }; -export const TestSubQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"testSubQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"scheduleId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"startTime"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"endTime"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"sites"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Sites"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"mode"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SchedulerModes"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"numNightsToSchedule"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"semesterVisibility"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"thesisFactor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"power"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"testSubQuery"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"scheduleId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"scheduleId"}}},{"kind":"Argument","name":{"kind":"Name","value":"newScheduleInput"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"startTime"},"value":{"kind":"Variable","name":{"kind":"Name","value":"startTime"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"sites"},"value":{"kind":"Variable","name":{"kind":"Name","value":"sites"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"mode"},"value":{"kind":"Variable","name":{"kind":"Name","value":"mode"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"endTime"},"value":{"kind":"Variable","name":{"kind":"Name","value":"endTime"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"thesisFactor"},"value":{"kind":"Variable","name":{"kind":"Name","value":"thesisFactor"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"power"},"value":{"kind":"Variable","name":{"kind":"Name","value":"power"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"semesterVisibility"},"value":{"kind":"Variable","name":{"kind":"Name","value":"semesterVisibility"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"numNightsToSchedule"},"value":{"kind":"Variable","name":{"kind":"Name","value":"numNightsToSchedule"}}}]}}]}]}}]} as unknown as DocumentNode; -export const QueueScheduleDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"queueSchedule"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"scheduleId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"queueSchedule"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"scheduleId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"scheduleId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nightPlans"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nightTimeline"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nightIndex"}},{"kind":"Field","name":{"kind":"Name","value":"timeEntriesBySite"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"site"}},{"kind":"Field","name":{"kind":"Name","value":"mornTwilight"}},{"kind":"Field","name":{"kind":"Name","value":"eveTwilight"}},{"kind":"Field","name":{"kind":"Name","value":"timeEntries"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"startTimeSlots"}},{"kind":"Field","name":{"kind":"Name","value":"event"}},{"kind":"Field","name":{"kind":"Name","value":"plan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"startTime"}},{"kind":"Field","name":{"kind":"Name","value":"nightConditions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"iq"}},{"kind":"Field","name":{"kind":"Name","value":"cc"}}]}},{"kind":"Field","name":{"kind":"Name","value":"visits"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"obsId"}},{"kind":"Field","name":{"kind":"Name","value":"endTime"}},{"kind":"Field","name":{"kind":"Name","value":"altitude"}},{"kind":"Field","name":{"kind":"Name","value":"atomEndIdx"}},{"kind":"Field","name":{"kind":"Name","value":"atomStartIdx"}},{"kind":"Field","name":{"kind":"Name","value":"startTime"}},{"kind":"Field","name":{"kind":"Name","value":"instrument"}},{"kind":"Field","name":{"kind":"Name","value":"fpu"}},{"kind":"Field","name":{"kind":"Name","value":"disperser"}},{"kind":"Field","name":{"kind":"Name","value":"filters"}},{"kind":"Field","name":{"kind":"Name","value":"score"}},{"kind":"Field","name":{"kind":"Name","value":"obsClass"}},{"kind":"Field","name":{"kind":"Name","value":"completion"}},{"kind":"Field","name":{"kind":"Name","value":"peakScore"}},{"kind":"Field","name":{"kind":"Name","value":"requiredConditions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"iq"}},{"kind":"Field","name":{"kind":"Name","value":"cc"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"nightStats"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"timeLoss"}},{"kind":"Field","name":{"kind":"Name","value":"planScore"}},{"kind":"Field","name":{"kind":"Name","value":"nToos"}},{"kind":"Field","name":{"kind":"Name","value":"completionFraction"}},{"kind":"Field","name":{"kind":"Name","value":"programCompletion"}}]}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"plansSummary"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export const TestSubQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"testSubQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"scheduleId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"startTime"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"endTime"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"sites"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Sites"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"mode"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SchedulerModes"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"numNightsToSchedule"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"semesterVisibility"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"thesisFactor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"power"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"metPower"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"whaPower"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"visPower"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"testSubQuery"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"scheduleId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"scheduleId"}}},{"kind":"Argument","name":{"kind":"Name","value":"newScheduleInput"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"startTime"},"value":{"kind":"Variable","name":{"kind":"Name","value":"startTime"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"sites"},"value":{"kind":"Variable","name":{"kind":"Name","value":"sites"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"mode"},"value":{"kind":"Variable","name":{"kind":"Name","value":"mode"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"endTime"},"value":{"kind":"Variable","name":{"kind":"Name","value":"endTime"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"thesisFactor"},"value":{"kind":"Variable","name":{"kind":"Name","value":"thesisFactor"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"power"},"value":{"kind":"Variable","name":{"kind":"Name","value":"power"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"metPower"},"value":{"kind":"Variable","name":{"kind":"Name","value":"metPower"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"whaPower"},"value":{"kind":"Variable","name":{"kind":"Name","value":"whaPower"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"visPower"},"value":{"kind":"Variable","name":{"kind":"Name","value":"visPower"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"semesterVisibility"},"value":{"kind":"Variable","name":{"kind":"Name","value":"semesterVisibility"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"numNightsToSchedule"},"value":{"kind":"Variable","name":{"kind":"Name","value":"numNightsToSchedule"}}}]}}]}]}}]} as unknown as DocumentNode; +export const QueueScheduleDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"queueSchedule"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"scheduleId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"queueSchedule"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"scheduleId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"scheduleId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NewNightPlans"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nightPlans"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nightTimeline"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nightIndex"}},{"kind":"Field","name":{"kind":"Name","value":"timeEntriesBySite"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"site"}},{"kind":"Field","name":{"kind":"Name","value":"mornTwilight"}},{"kind":"Field","name":{"kind":"Name","value":"eveTwilight"}},{"kind":"Field","name":{"kind":"Name","value":"timeEntries"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"startTimeSlots"}},{"kind":"Field","name":{"kind":"Name","value":"event"}},{"kind":"Field","name":{"kind":"Name","value":"plan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"startTime"}},{"kind":"Field","name":{"kind":"Name","value":"nightConditions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"iq"}},{"kind":"Field","name":{"kind":"Name","value":"cc"}}]}},{"kind":"Field","name":{"kind":"Name","value":"visits"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"obsId"}},{"kind":"Field","name":{"kind":"Name","value":"endTime"}},{"kind":"Field","name":{"kind":"Name","value":"altitude"}},{"kind":"Field","name":{"kind":"Name","value":"atomEndIdx"}},{"kind":"Field","name":{"kind":"Name","value":"atomStartIdx"}},{"kind":"Field","name":{"kind":"Name","value":"startTime"}},{"kind":"Field","name":{"kind":"Name","value":"instrument"}},{"kind":"Field","name":{"kind":"Name","value":"fpu"}},{"kind":"Field","name":{"kind":"Name","value":"disperser"}},{"kind":"Field","name":{"kind":"Name","value":"filters"}},{"kind":"Field","name":{"kind":"Name","value":"score"}},{"kind":"Field","name":{"kind":"Name","value":"obsClass"}},{"kind":"Field","name":{"kind":"Name","value":"completion"}},{"kind":"Field","name":{"kind":"Name","value":"peakScore"}},{"kind":"Field","name":{"kind":"Name","value":"requiredConditions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"iq"}},{"kind":"Field","name":{"kind":"Name","value":"cc"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"nightStats"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"timeLoss"}},{"kind":"Field","name":{"kind":"Name","value":"planScore"}},{"kind":"Field","name":{"kind":"Name","value":"nToos"}},{"kind":"Field","name":{"kind":"Name","value":"completionFraction"}},{"kind":"Field","name":{"kind":"Name","value":"programCompletion"}}]}}]}}]}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"plansSummary"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NightPlansError"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"error"}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file