import { NextRequest, NextResponse } from 'next/server'; import { gql, GraphQLClient } from 'graphql-request'; const GET_CONFIGS = gql` query GetConfigs { siteConfigs { key value } } ` export async function GET(request: NextRequest) { const client = new GraphQLClient(process.env.GRAPHQL_URL || 'http://localhost:3050/graphql'); try { const data: any = await client.request(GET_CONFIGS); return NextResponse.json(data.siteConfigs); } catch (error) { return NextResponse.json({ error: 'No site configs found' }, { status: 404 }); } }