Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Ekryd/graphql-formatter

graphql-formatter

Build Version Downloads

Plugin description

An IntelliJ plugin to format, maximize and minimize GraphQL queries and schemas.

The plugin can format both GraphQL queries and GraphQL schemas. Open the plugin tool window and paste the text that you want to format.

The following operations can be performed:

  • Collapse text to a minimized format without comments, documentation or whitespace.
  • Expand text to a structured format preserving comments and documentation.
  • Compress GraphQL queries to a format where leaves of the query types are placed on the same line and all end braces are placed on the same line. This is useful when you want to use queries in tests; to have an overview of the query, but preserve the number of lines used. Compressing a GraphQL schema will just expand it.
  • Verify GraphQL to check if the query or schema is syntactically valid.

Screenshots

Screen Recording

Compressing Query

Installation

  • Using IDE built-in plugin system:

    Settings/Preferences > Plugins > Marketplace > Search for " graphql-formatter" > Install Plugin

  • Manually:

    Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...


Plugin based on the IntelliJ Platform Plugin Template.

Acknowledgement

A big 'Thank you' to Jiaxing Zhang for the inspiring JSON Formatter plugin.

Thanks to IntelliJ for the thorough documentation around building plugins.