mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-28 20:21:52 +01: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;
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user