Wait for server initialization
import { createSource } from '../generated/hypertune'
const hypertuneSource = createSource({
token: process.env.HYPERTUNE_TOKEN!,
initDataRefreshIntervalMs: 5_000,
})
export default async function getHypertune() {
await hypertuneSource.initIfNeeded()
return hypertuneSource.root({
args: {
context: {
environment:
process.env.NODE_ENV === 'development'
? 'development'
: 'production',
user: {
id: 'e23cc9a8-0287-40aa-8500-6802df91e56a',
name: 'Example User',
email: '[email protected]',
},
},
},
})
}Check for server initialization
Last updated