Apply Composer changes: comprehensive API updates, migrations, middleware, and infrastructure improvements
- Add comprehensive database migrations (001-024) for schema evolution
- Enhance API schema with expanded type definitions and resolvers
- Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth
- Implement new services: AI optimization, billing, blockchain, compliance, marketplace
- Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage)
- Update Crossplane provider with enhanced VM management capabilities
- Add comprehensive test suite for API endpoints and services
- Update frontend components with improved GraphQL subscriptions and real-time updates
- Enhance security configurations and headers (CSP, CORS, etc.)
- Update documentation and configuration files
- Add new CI/CD workflows and validation scripts
- Implement design system improvements and UI enhancements
2025-12-12 18:01:35 -08:00
|
|
|
import { ApolloClient, InMemoryCache, split, HttpLink } from '@apollo/client'
|
|
|
|
|
import { getMainDefinition } from '@apollo/client/utilities'
|
|
|
|
|
import { GraphQLWsLink } from '@apollo/client/link/subscriptions'
|
|
|
|
|
import { createClient } from 'graphql-ws'
|
2025-11-28 12:54:33 -08:00
|
|
|
|
Apply Composer changes: comprehensive API updates, migrations, middleware, and infrastructure improvements
- Add comprehensive database migrations (001-024) for schema evolution
- Enhance API schema with expanded type definitions and resolvers
- Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth
- Implement new services: AI optimization, billing, blockchain, compliance, marketplace
- Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage)
- Update Crossplane provider with enhanced VM management capabilities
- Add comprehensive test suite for API endpoints and services
- Update frontend components with improved GraphQL subscriptions and real-time updates
- Enhance security configurations and headers (CSP, CORS, etc.)
- Update documentation and configuration files
- Add new CI/CD workflows and validation scripts
- Implement design system improvements and UI enhancements
2025-12-12 18:01:35 -08:00
|
|
|
const httpLink = new HttpLink({
|
|
|
|
|
uri: process.env.NEXT_PUBLIC_GRAPHQL_URL || 'http://localhost:4000/graphql',
|
2025-11-28 12:54:33 -08:00
|
|
|
})
|
|
|
|
|
|
Apply Composer changes: comprehensive API updates, migrations, middleware, and infrastructure improvements
- Add comprehensive database migrations (001-024) for schema evolution
- Enhance API schema with expanded type definitions and resolvers
- Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth
- Implement new services: AI optimization, billing, blockchain, compliance, marketplace
- Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage)
- Update Crossplane provider with enhanced VM management capabilities
- Add comprehensive test suite for API endpoints and services
- Update frontend components with improved GraphQL subscriptions and real-time updates
- Enhance security configurations and headers (CSP, CORS, etc.)
- Update documentation and configuration files
- Add new CI/CD workflows and validation scripts
- Implement design system improvements and UI enhancements
2025-12-12 18:01:35 -08:00
|
|
|
// WebSocket link for subscriptions (only in browser)
|
|
|
|
|
const wsLink =
|
|
|
|
|
typeof window !== 'undefined'
|
|
|
|
|
? new GraphQLWsLink(
|
|
|
|
|
createClient({
|
|
|
|
|
url: process.env.NEXT_PUBLIC_GRAPHQL_WS_URL || 'ws://localhost:4000/graphql',
|
|
|
|
|
connectionParams: () => {
|
|
|
|
|
// Add auth token if available
|
|
|
|
|
const token = localStorage.getItem('authToken')
|
|
|
|
|
return token ? { authorization: `Bearer ${token}` } : {}
|
|
|
|
|
},
|
|
|
|
|
})
|
2025-11-28 12:54:33 -08:00
|
|
|
)
|
Apply Composer changes: comprehensive API updates, migrations, middleware, and infrastructure improvements
- Add comprehensive database migrations (001-024) for schema evolution
- Enhance API schema with expanded type definitions and resolvers
- Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth
- Implement new services: AI optimization, billing, blockchain, compliance, marketplace
- Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage)
- Update Crossplane provider with enhanced VM management capabilities
- Add comprehensive test suite for API endpoints and services
- Update frontend components with improved GraphQL subscriptions and real-time updates
- Enhance security configurations and headers (CSP, CORS, etc.)
- Update documentation and configuration files
- Add new CI/CD workflows and validation scripts
- Implement design system improvements and UI enhancements
2025-12-12 18:01:35 -08:00
|
|
|
: null
|
2025-11-28 12:54:33 -08:00
|
|
|
|
Apply Composer changes: comprehensive API updates, migrations, middleware, and infrastructure improvements
- Add comprehensive database migrations (001-024) for schema evolution
- Enhance API schema with expanded type definitions and resolvers
- Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth
- Implement new services: AI optimization, billing, blockchain, compliance, marketplace
- Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage)
- Update Crossplane provider with enhanced VM management capabilities
- Add comprehensive test suite for API endpoints and services
- Update frontend components with improved GraphQL subscriptions and real-time updates
- Enhance security configurations and headers (CSP, CORS, etc.)
- Update documentation and configuration files
- Add new CI/CD workflows and validation scripts
- Implement design system improvements and UI enhancements
2025-12-12 18:01:35 -08:00
|
|
|
// Split link: use WebSocket for subscriptions, HTTP for queries/mutations
|
|
|
|
|
const splitLink =
|
|
|
|
|
typeof window !== 'undefined' && wsLink
|
|
|
|
|
? split(
|
|
|
|
|
({ query }) => {
|
|
|
|
|
const definition = getMainDefinition(query)
|
|
|
|
|
return (
|
|
|
|
|
definition.kind === 'OperationDefinition' &&
|
|
|
|
|
definition.operation === 'subscription'
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
wsLink,
|
|
|
|
|
httpLink
|
|
|
|
|
)
|
|
|
|
|
: httpLink
|
2025-11-28 12:54:33 -08:00
|
|
|
|
|
|
|
|
export const apolloClient = new ApolloClient({
|
Apply Composer changes: comprehensive API updates, migrations, middleware, and infrastructure improvements
- Add comprehensive database migrations (001-024) for schema evolution
- Enhance API schema with expanded type definitions and resolvers
- Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth
- Implement new services: AI optimization, billing, blockchain, compliance, marketplace
- Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage)
- Update Crossplane provider with enhanced VM management capabilities
- Add comprehensive test suite for API endpoints and services
- Update frontend components with improved GraphQL subscriptions and real-time updates
- Enhance security configurations and headers (CSP, CORS, etc.)
- Update documentation and configuration files
- Add new CI/CD workflows and validation scripts
- Implement design system improvements and UI enhancements
2025-12-12 18:01:35 -08:00
|
|
|
link: splitLink,
|
|
|
|
|
cache: new InMemoryCache({
|
|
|
|
|
typePolicies: {
|
|
|
|
|
NetworkTopology: {
|
|
|
|
|
fields: {
|
|
|
|
|
nodes: {
|
|
|
|
|
merge(existing = [], incoming) {
|
|
|
|
|
return incoming
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
edges: {
|
|
|
|
|
merge(existing = [], incoming) {
|
|
|
|
|
return incoming
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}),
|
2025-11-28 12:54:33 -08:00
|
|
|
defaultOptions: {
|
|
|
|
|
watchQuery: {
|
Apply Composer changes: comprehensive API updates, migrations, middleware, and infrastructure improvements
- Add comprehensive database migrations (001-024) for schema evolution
- Enhance API schema with expanded type definitions and resolvers
- Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth
- Implement new services: AI optimization, billing, blockchain, compliance, marketplace
- Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage)
- Update Crossplane provider with enhanced VM management capabilities
- Add comprehensive test suite for API endpoints and services
- Update frontend components with improved GraphQL subscriptions and real-time updates
- Enhance security configurations and headers (CSP, CORS, etc.)
- Update documentation and configuration files
- Add new CI/CD workflows and validation scripts
- Implement design system improvements and UI enhancements
2025-12-12 18:01:35 -08:00
|
|
|
fetchPolicy: 'cache-and-network',
|
2025-11-28 12:54:33 -08:00
|
|
|
},
|
|
|
|
|
query: {
|
Apply Composer changes: comprehensive API updates, migrations, middleware, and infrastructure improvements
- Add comprehensive database migrations (001-024) for schema evolution
- Enhance API schema with expanded type definitions and resolvers
- Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth
- Implement new services: AI optimization, billing, blockchain, compliance, marketplace
- Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage)
- Update Crossplane provider with enhanced VM management capabilities
- Add comprehensive test suite for API endpoints and services
- Update frontend components with improved GraphQL subscriptions and real-time updates
- Enhance security configurations and headers (CSP, CORS, etc.)
- Update documentation and configuration files
- Add new CI/CD workflows and validation scripts
- Implement design system improvements and UI enhancements
2025-12-12 18:01:35 -08:00
|
|
|
fetchPolicy: 'cache-first',
|
2025-11-28 12:54:33 -08:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
})
|
2026-03-29 13:40:56 -07:00
|
|
|
|
|
|
|
|
/** Used by `src/app/providers.tsx` (client Providers wrapper). */
|
|
|
|
|
export function getApolloClient() {
|
|
|
|
|
return apolloClient
|
|
|
|
|
}
|