Skip to content

Commit

Permalink
Merge pull request #73 from simonsobs/dev
Browse files Browse the repository at this point in the history
Upgrade urql, rerun codegen, and fix related type errors
  • Loading branch information
TaiSakuma authored Aug 26, 2024
2 parents cd3346a + fcad6ce commit eacc799
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 34 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@material/material-color-utilities": "^0.3.0",
"@urql/vue": "^1.3.2",
"@urql/vue": "^1.4.1",
"@vuelidate/core": "^2.0.3",
"@vuelidate/validators": "^2.0.4",
"@vueuse/core": "^10.11.0",
Expand Down
11 changes: 7 additions & 4 deletions src/api/use-continuous-enabled-subscription.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { computed } from "vue";
import type { ComputedRef } from "vue";
import {
useCtrlContinuousEnabledQuery,
useCtrlContinuousEnabledSSubscription,
} from "@/graphql/codegen/generated";
import type { ComputedRef } from "vue";
import { computed } from "vue";

interface _ContinuousEnabledSubscription {
continuousEnabled: ComputedRef<boolean | undefined>;
Expand All @@ -16,8 +16,11 @@ type ContinuousEnabledSubscription = _ContinuousEnabledSubscription &
PromiseLike<_ContinuousEnabledSubscription>;

export function useSubscribeContinuousEnabled(): ContinuousEnabledSubscription {
const query = useCtrlContinuousEnabledQuery({ requestPolicy: "network-only" });
const subscription = useCtrlContinuousEnabledSSubscription({});
const query = useCtrlContinuousEnabledQuery({
requestPolicy: "network-only",
variables: {},
});
const subscription = useCtrlContinuousEnabledSSubscription({ variables: {} });

const error = computed(() => subscription.error?.value || query.error?.value);

Expand Down
8 changes: 4 additions & 4 deletions src/api/use-run-no-subscription.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { computed } from "vue";
import type { ComputedRef } from "vue";
import {
useCtrlRunNoQuery,
useCtrlRunNoSSubscription,
} from "@/graphql/codegen/generated";
import type { ComputedRef } from "vue";
import { computed } from "vue";

interface _RunNoSubscription {
runNo: ComputedRef<number | undefined>;
Expand All @@ -15,8 +15,8 @@ interface _RunNoSubscription {
type RunNoSubscription = _RunNoSubscription & PromiseLike<_RunNoSubscription>;

export function useSubscribeRunNo(): RunNoSubscription {
const query = useCtrlRunNoQuery({ requestPolicy: "network-only" });
const subscription = useCtrlRunNoSSubscription({});
const query = useCtrlRunNoQuery({ requestPolicy: "network-only", variables: {} });
const subscription = useCtrlRunNoSSubscription({ variables: {} });

const error = computed(() => subscription.error?.value || query.error?.value);

Expand Down
11 changes: 7 additions & 4 deletions src/api/use-schedule-auto-mode-mode-subscription.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { computed } from "vue";
import type { ComputedRef } from "vue";
import {
useScheduleAutoModeModeQuery,
useScheduleAutoModeModeSSubscription,
} from "@/graphql/codegen/generated";
import type { ComputedRef } from "vue";
import { computed } from "vue";

// type AutoMode = "off" | "scheduler" | "queue";

Expand All @@ -18,8 +18,11 @@ type ScheduleAutoModeModeSubscription = _ScheduleAutoModeModeSubscription &
PromiseLike<_ScheduleAutoModeModeSubscription>;

export function useSubscribeScheduleAutoModeMode(): ScheduleAutoModeModeSubscription {
const query = useScheduleAutoModeModeQuery({ requestPolicy: "network-only" });
const subscription = useScheduleAutoModeModeSSubscription({});
const query = useScheduleAutoModeModeQuery({
requestPolicy: "network-only",
variables: {},
});
const subscription = useScheduleAutoModeModeSSubscription({ variables: {} });

const error = computed(() => subscription.error?.value || query.error?.value);

Expand Down
11 changes: 7 additions & 4 deletions src/api/use-schedule-auto-mode-state-subscription.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { computed } from "vue";
import type { ComputedRef } from "vue";
import {
useQScheduleAutoModeStateQuery,
useScheduleAutoModeStateSSubscription,
} from "@/graphql/codegen/generated";
import type { ComputedRef } from "vue";
import { computed } from "vue";

interface _ScheduleAutoModeStateSubscription {
autoModeState: ComputedRef<string | undefined>;
Expand All @@ -16,8 +16,11 @@ type ScheduleAutoModeStateSubscription = _ScheduleAutoModeStateSubscription &
PromiseLike<_ScheduleAutoModeStateSubscription>;

export function useSubscribeScheduleAutoModeState(): ScheduleAutoModeStateSubscription {
const query = useQScheduleAutoModeStateQuery({ requestPolicy: "network-only" });
const subscription = useScheduleAutoModeStateSSubscription({});
const query = useQScheduleAutoModeStateQuery({
requestPolicy: "network-only",
variables: {},
});
const subscription = useScheduleAutoModeStateSSubscription({ variables: {} });

const error = computed(() => subscription.error?.value || query.error?.value);

Expand Down
13 changes: 8 additions & 5 deletions src/api/use-schedule-queue-items-subscription.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { computed } from "vue";
import type { ComputedRef } from "vue";
import type { ScheduleQueueItem } from "@/graphql/codegen/generated";
import {
useScheduleQueueItemsQuery,
useScheduleQueueItemsSSubscription,
} from "@/graphql/codegen/generated";
import type { ScheduleQueueItem } from "@/graphql/codegen/generated";
import type { ComputedRef } from "vue";
import { computed } from "vue";

interface _ScheduleQueueItemsSubscription {
items: ComputedRef<ScheduleQueueItem[] | undefined>;
Expand All @@ -18,8 +18,11 @@ type ScheduleQueueItemsSubscription = _ScheduleQueueItemsSubscription &
PromiseLike<_ScheduleQueueItemsSubscription>;

export function useSubscribeScheduleQueueItems(): ScheduleQueueItemsSubscription {
const query = useScheduleQueueItemsQuery({ requestPolicy: "network-only" });
const subscription = useScheduleQueueItemsSSubscription({});
const query = useScheduleQueueItemsQuery({
requestPolicy: "network-only",
variables: {},
});
const subscription = useScheduleQueueItemsSSubscription({ variables: {} });

const loading = computed(() => query.fetching?.value);
const error = computed(() => subscription.error?.value || query.error?.value);
Expand Down
11 changes: 7 additions & 4 deletions src/api/use-state-subscription.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { computed } from "vue";
import {
useCtrlStateQuery,
useCtrlStateSSubscription,
} from "@/graphql/codegen/generated";
import type { ComputedRef } from "vue";
import { useCtrlStateQuery, useCtrlStateSSubscription } from "@/graphql/codegen/generated";
import { computed } from "vue";

interface _StateSubscription {
state: ComputedRef<string | undefined>;
Expand All @@ -12,8 +15,8 @@ interface _StateSubscription {
type StateSubscription = _StateSubscription & PromiseLike<_StateSubscription>;

export function useSubscribeState(): StateSubscription {
const query = useCtrlStateQuery({ requestPolicy: "network-only" });
const subscription = useCtrlStateSSubscription({});
const query = useCtrlStateQuery({ requestPolicy: "network-only", variables: {} });
const subscription = useCtrlStateSSubscription({ variables: {} });

const error = computed(() => subscription.error?.value || query.error?.value);

Expand Down
8 changes: 4 additions & 4 deletions src/api/use-trace_ids-subscription.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { computed } from "vue";
import type { ComputedRef } from "vue";
import {
useCtrlTraceIdsQuery,
useCtrlTraceIdsSSubscription,
} from "@/graphql/codegen/generated";
import type { ComputedRef } from "vue";
import { computed } from "vue";

interface _TraceIdsSubscription {
traceIds: ComputedRef<number[] | undefined>;
Expand All @@ -15,8 +15,8 @@ interface _TraceIdsSubscription {
type TraceIdsSubscription = _TraceIdsSubscription & PromiseLike<_TraceIdsSubscription>;

export function useSubscribeTraceIds(): TraceIdsSubscription {
const query = useCtrlTraceIdsQuery({ requestPolicy: "network-only" });
const subscription = useCtrlTraceIdsSSubscription({});
const query = useCtrlTraceIdsQuery({ requestPolicy: "network-only", variables: {} });
const subscription = useCtrlTraceIdsSSubscription({ variables: {} });

const error = computed(() => subscription.error?.value || query.error?.value);

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2277,10 +2277,10 @@
"@0no-co/graphql.web" "^1.0.5"
wonka "^6.3.2"

"@urql/vue@^1.3.2":
version "1.3.2"
resolved "https://registry.yarnpkg.com/@urql/vue/-/vue-1.3.2.tgz#2a4c610e761fce2c0818808da82411b1f46371bb"
integrity sha512-QzuAAoJ0RRby7+HWvI+36IAdH4bpQd1JHVxTE8kYQZEkxtw3rcKapoxFJr/+6ZW9CFHjihdBHy9Kgncm54w86A==
"@urql/vue@^1.4.1":
version "1.4.1"
resolved "https://registry.yarnpkg.com/@urql/vue/-/vue-1.4.1.tgz#469a44b408faacf1db35d5f7995a53f85c2bb2c6"
integrity sha512-Y8hknHUVQ2s5e9Nt8Q8XAknYeNUP2VdOLxyTL9pPuVzE14BDF2pwlewFqxofKTfZA6w8Uc7mP/0nFkdrnG0diA==
dependencies:
"@urql/core" "^5.0.0"
wonka "^6.3.2"
Expand Down

0 comments on commit eacc799

Please sign in to comment.