fix: avoid sending query params to planet
This commit is contained in:
@@ -2,30 +2,14 @@ import "server-only"
|
||||
|
||||
import deepmerge from "deepmerge"
|
||||
|
||||
import { arrayMerge } from "@/utils/merge"
|
||||
|
||||
import { request } from "./request"
|
||||
|
||||
import type { BatchRequestDocument } from "graphql-request"
|
||||
|
||||
import type { Data } from "@/types/request"
|
||||
|
||||
function arrayMerge(
|
||||
target: any[],
|
||||
source: any[],
|
||||
options: deepmerge.ArrayMergeOptions | undefined
|
||||
) {
|
||||
const destination = target.slice()
|
||||
source.forEach((item, index) => {
|
||||
if (typeof destination[index] === "undefined") {
|
||||
destination[index] = options?.cloneUnlessOtherwiseSpecified(item, options)
|
||||
} else if (options?.isMergeableObject(item)) {
|
||||
destination[index] = deepmerge(target[index], item, options)
|
||||
} else if (target.indexOf(item) === -1) {
|
||||
destination.push(item)
|
||||
}
|
||||
})
|
||||
return destination
|
||||
}
|
||||
|
||||
export async function batchRequest<T>(
|
||||
queries: (BatchRequestDocument & { options?: RequestInit })[]
|
||||
): Promise<Data<T>> {
|
||||
|
||||
Reference in New Issue
Block a user