mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-19 07:29:40 +02:00
Replace format-graphql with pretty_graphql for comment-preserving GraphQL formatting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,18 @@ export async function tryFormatJson(text: string): Promise<string> {
|
||||
return text;
|
||||
}
|
||||
|
||||
export async function tryFormatGraphql(text: string): Promise<string> {
|
||||
if (text === '') return text;
|
||||
|
||||
try {
|
||||
return await invokeCmd<string>('cmd_format_graphql', { text });
|
||||
} catch (err) {
|
||||
console.warn('Failed to format GraphQL', err);
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
export async function tryFormatXml(text: string): Promise<string> {
|
||||
if (text === '') return text;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user