Files
api/web/store/server.fragment.ts
Pujit Mehrotra 719f460016 fix: error logs from cloud query when connect is not installed (#1450)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Introduced a separate cloud state query, allowing cloud-related data
to be fetched independently from server state data.

* **Improvements**
* Server and cloud state queries are now managed separately, improving
data handling and refresh logic.
* Theme header color fields are now optional and can be unset, offering
greater flexibility for customization.

* **Bug Fixes**
* Enhanced error handling and data updates for cloud and server state
queries.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-02 09:44:31 -04:00

97 lines
1.5 KiB
TypeScript

import { graphql } from '~/composables/gql/gql';
export const SERVER_CLOUD_FRAGMENT = graphql(/* GraphQL */ `
fragment PartialCloud on Cloud {
error
apiKey {
valid
error
}
cloud {
status
error
}
minigraphql {
status
error
}
relay {
status
error
}
}
`);
// export const SERVER_CONFIG_FRAGMENT = graphql(/* GraphQL */`
// fragment FragmentConfig on Config {
// error
// valid
// }
// `);
// export const SERVER_OWNER_FRAGMENT = graphql(/* GraphQL */`
// fragment FragmentOwner on Owner {
// avatar
// username
// }
// `);
// export const SERVER_REGISTRATION_FRAGMENT = graphql(/* GraphQL */`
// fragment FragmentRegistration on Registration {
// state
// expiration
// keyFile {
// contents
// }
// }
// `);
// export const SERVER_VARS_FRAGMENT = graphql(/* GraphQL */`
// fragment FragmentVars on Vars {
// regGen
// regState
// configError
// configValid
// }
// `);
export const CLOUD_STATE_QUERY = graphql(/* GraphQL */ `
query cloudState {
cloud {
...PartialCloud
}
}
`);
export const SERVER_STATE_QUERY = graphql(/* GraphQL */ `
query serverState {
config {
error
valid
}
info {
os {
hostname
}
}
owner {
avatar
username
}
registration {
state
expiration
keyFile {
contents
}
updateExpiration
}
vars {
regGen
regState
configError
configValid
}
}
`);