mirror of
https://github.com/unraid/api.git
synced 2026-01-06 08:39:54 -06:00
feat: working unraid-api gql
This commit is contained in:
15
components/UserProfile/DropdownConnectStatus.fragment.ts
Normal file
15
components/UserProfile/DropdownConnectStatus.fragment.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { graphql } from "~/composables/gql/gql";
|
||||
|
||||
export const TEST_FRAGMENT = graphql(/* GraphQL */`
|
||||
fragment TestFragment on Cloud {
|
||||
error
|
||||
}
|
||||
`);
|
||||
|
||||
export const TEST_QUERY = graphql(/* GraphQL */`
|
||||
query cloudError {
|
||||
cloud {
|
||||
...TestFragment
|
||||
}
|
||||
}
|
||||
`);
|
||||
@@ -1,8 +1,21 @@
|
||||
<script setup lang="ts">
|
||||
import { ExclamationTriangleIcon, CheckCircleIcon } from '@heroicons/vue/24/solid';
|
||||
// import { storeToRefs } from 'pinia';
|
||||
// import { useServerStore } from '~/store/server';
|
||||
// const { stateData } = storeToRefs(useServerStore());
|
||||
import { useQuery } from '@vue/apollo-composable';
|
||||
|
||||
import {
|
||||
TEST_FRAGMENT,
|
||||
TEST_QUERY,
|
||||
} from './DropdownConnectStatus.fragment';
|
||||
import { useFragment } from '@/composables/gql/fragment-masking';
|
||||
|
||||
const { result: newResult } = useQuery(
|
||||
TEST_QUERY,
|
||||
);
|
||||
const result = computed(() => useFragment(TEST_FRAGMENT, newResult.value?.cloud));
|
||||
|
||||
watch(result, (newVal, oldVal) => {
|
||||
console.log('result', newVal, oldVal);
|
||||
});
|
||||
|
||||
type ApiOnlineStatus = 'online'|'offline';
|
||||
const onlineStatus = ref<ApiOnlineStatus>('online');
|
||||
|
||||
Reference in New Issue
Block a user