ruvector/studio/data/content-api/docs-error-codes-query.ts
rUv 814f595995 feat(studio): Add complete RuVector Studio application
Major additions:
- Complete Next.js studio application with 1600+ components
- Docker support (Dockerfile.combined, docker-compose.yml)
- GCP deployment documentation and benchmarks
- SQL benchmark scripts for performance testing
- Sentry integration for monitoring
- Comprehensive test suite and mocks

Studio features:
- Dashboard and admin interfaces
- Data visualization components
- Authentication and user management
- API integration with RuVector backend
- Static data and public assets

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 23:04:48 +00:00

45 lines
1.3 KiB
TypeScript

import { useQuery } from '@tanstack/react-query'
import { executeGraphQL } from 'data/graphql/execute'
import { graphql } from 'data/graphql/gql'
import { Service } from 'data/graphql/graphql'
import { contentApiKeys } from './keys'
import { UseCustomQueryOptions } from 'types'
const ErrorCodeQuery = graphql(`
query ErrorCodeQuery($code: String!, $service: Service) {
errors(code: $code, service: $service) {
nodes {
code
service
message
}
}
}
`)
interface Variables {
code: string
service?: Service
}
async function getErrorCodeDescriptions({ code, service }: Variables, signal?: AbortSignal) {
return await executeGraphQL(ErrorCodeQuery, { variables: { code, service }, signal })
}
type ErrorCodeDescriptionsData = Awaited<ReturnType<typeof getErrorCodeDescriptions>>
type ErrorCodeDescriptionsError = unknown
export const useErrorCodesQuery = <TData = ErrorCodeDescriptionsData>(
variables: Variables,
{
enabled = true,
...options
}: UseCustomQueryOptions<ErrorCodeDescriptionsData, ErrorCodeDescriptionsError, TData> = {}
) => {
return useQuery<ErrorCodeDescriptionsData, ErrorCodeDescriptionsError, TData>({
queryKey: contentApiKeys.errorCodes(variables),
queryFn: ({ signal }) => getErrorCodeDescriptions(variables, signal),
enabled,
...options,
})
}