Formats
GraphQL Formatter
Format and beautify GraphQL queries and mutations.
How to use it
- Open Devly from the wrench in your menu bar, or press ⌃⌥⌘D. Press ⌘P, type GraphQL Formatter and press Return.
- Paste or type your text into Input.
- Adjust the Options on the right if you need to. The defaults are listed below.
- Press Format, or ⌘↵.
- Use Copy or ⇧⌘C to copy the result. ⌘L clears everything.
Options
| Option | Values | Default |
|---|---|---|
| Indent SpacesNumber of spaces for indentation | 1–8 | 2 |
| Sort fields alphabeticallySort fields within selections | On or off | Off |
Example
Real output from Devly, with the default options.
Input
query GetUser($id: ID!) { user(id: $id) { id name email posts(first: 5) { edges { node { id title } } } } }query
GetUser($id: ID!) {
user(id: $id) {
id
name
email
posts(first: 5) {
edges {
node {
id
title
}
}
}
}
}From Terminal
With the free command-line tool installed:
Terminal
devly graphql --path input.txt # or pipe text in pbpaste | devly graphql
Quick Switch also finds it by: graphql, gql, format, query, mutation, api.
More Formats tools
JSON FormatterFormat, validate, and minify JSON with syntax highlightingJSON Path QueryQuery JSON data using JSONPath expressionsJSON ↔ YAMLConvert between JSON and YAML formatsYAML FormatterFormat, validate, and beautify YAML documentsXML FormatterFormat, validate, and beautify XML documentsXML ↔ JSONConvert between XML and JSON formats