fix: default engine auto with graphql primary

This commit is contained in:
Peter Steinberger
2025-12-25 14:00:35 +01:00
parent c4689d2580
commit 3661f784cb
4 changed files with 26 additions and 20 deletions
+15
View File
@@ -0,0 +1,15 @@
export type EngineMode = 'graphql' | 'sweetistics' | 'auto';
export function resolveEngineMode(value?: string): EngineMode {
const normalized = (value || 'auto').toLowerCase();
if (normalized === 'graphql' || normalized === 'sweetistics' || normalized === 'auto') {
return normalized;
}
return 'auto';
}
export function shouldUseSweetistics(engine: EngineMode, hasApiKey: boolean): boolean {
if (engine === 'sweetistics') return true;
if (engine === 'graphql') return false;
return false; // auto: GraphQL primary, Sweetistics only as fallback
}