15 lines
503 B
TypeScript
15 lines
503 B
TypeScript
import { createDirectusConnection } from "@/lib/directus";
|
|
import { print } from 'graphql';
|
|
import getRobotsQuery from '@/graphql/settings/robots.graphql';
|
|
|
|
export async function getRobotsSettings(): Promise<RobotsSettings> {
|
|
const client = await createDirectusConnection();
|
|
const result = await client.query(print(getRobotsQuery));
|
|
|
|
const robotsResult = result["Robots"];
|
|
|
|
return {
|
|
crawlers: robotsResult["crawlers"],
|
|
extraContent: robotsResult["extra_content"]
|
|
};
|
|
} |