21 lines
476 B
TypeScript
21 lines
476 B
TypeScript
import { DocumentNode } from "graphql"
|
|
import { GraphQLClient } from "graphql-request"
|
|
|
|
import { env } from "@/env/server"
|
|
|
|
import { request as _request } from "./_request"
|
|
|
|
import { Data } from "@/types/request"
|
|
|
|
const client = new GraphQLClient(env.CMS_URL, {
|
|
fetch: fetch,
|
|
})
|
|
|
|
export async function edgeRequest<T>(
|
|
query: string | DocumentNode,
|
|
variables?: {},
|
|
next?: NextFetchRequestConfig
|
|
): Promise<Data<T>> {
|
|
return _request(client, query, variables, next)
|
|
}
|