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:
Gregory Schier
2026-03-05 15:53:13 -08:00
parent cfab62707e
commit a0cb7f813f
9 changed files with 113 additions and 344 deletions

View File

@@ -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;

View File

@@ -17,6 +17,7 @@ type TauriCmd =
| 'cmd_delete_send_history'
| 'cmd_dismiss_notification'
| 'cmd_export_data'
| 'cmd_format_graphql'
| 'cmd_format_json'
| 'cmd_get_http_authentication_config'
| 'cmd_get_http_authentication_summaries'