/*** IMPORT ------------------------------------------- ***/ import { parse, print } from "graphql"; /*** EXPORT ------------------------------------------- ***/ export function format(query: string): string { const trimmed = query.trim(); if (!trimmed) return query; try { return print(parse(query)); } catch { return query; } }