{"id":19840673,"url":"https://github.com/ekryd/sortgraphql","last_synced_at":"2025-05-01T19:30:45.440Z","repository":{"id":37871269,"uuid":"369891289","full_name":"Ekryd/sortgraphql","owner":"Ekryd","description":"Maven plugin to sort GraphQL Schemas","archived":false,"fork":false,"pushed_at":"2025-04-24T19:49:53.000Z","size":672,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T20:41:48.346Z","etag":null,"topics":["formatter","graphql","graphqls","hacktoberfest","java","maven","maven-plugin","schema"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ekryd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["Ekryd"],"custom":["https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=JB25X84DDG5JW\u0026lc=SE\u0026item_name=Encourage%20the%20development\u0026item_number=sortpom\u0026currency_code=EUR\u0026bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted"]}},"created_at":"2021-05-22T19:33:20.000Z","updated_at":"2025-04-24T19:49:56.000Z","dependencies_parsed_at":"2024-01-14T20:25:46.608Z","dependency_job_id":"d0216fe0-f365-4589-944a-dde879d1115a","html_url":"https://github.com/Ekryd/sortgraphql","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ekryd%2Fsortgraphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ekryd%2Fsortgraphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ekryd%2Fsortgraphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ekryd%2Fsortgraphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ekryd","download_url":"https://codeload.github.com/Ekryd/sortgraphql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251932577,"owners_count":21667171,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["formatter","graphql","graphqls","hacktoberfest","java","maven","maven-plugin","schema"],"created_at":"2024-11-12T12:27:46.610Z","updated_at":"2025-05-01T19:30:44.574Z","avatar_url":"https://github.com/Ekryd.png","language":"Java","funding_links":["https://github.com/sponsors/Ekryd","https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=JB25X84DDG5JW\u0026lc=SE\u0026item_name=Encourage%20the%20development\u0026item_number=sortpom\u0026currency_code=EUR\u0026bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted"],"categories":[],"sub_categories":[],"readme":"# sortgraphql\n\n[![Build Status](https://circleci.com/gh/Ekryd/sortgraphql.svg?style=svg)](https://app.circleci.com/pipelines/github/Ekryd/sortgraphql)\n[![Coverage Status](https://coveralls.io/repos/github/Ekryd/sortgraphql/badge.svg?branch=master)](https://coveralls.io/github/Ekryd/sortgraphql?branch=master)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.ekryd.sortgraphql/sortgraphql-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.ekryd.sortgraphql/sortgraphql-maven-plugin)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Ekryd_sortgraphql\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=Ekryd_sortgraphql)\n[![Licence](https://img.shields.io/github/license/Ekryd/sortgraphql?color=success)](https://github.com/Ekryd/sortgraphql/blob/master/LICENSE.md)\n\nMaven plugin to sort GraphQL Schemas.\n\n## Description ##\n\nThe plugin will format and sort GraphQL schemas in a predefined way. The default sort order sections are:\n\n* All Directives first\n* The Query type\n* The Mutation type\n* The Subscription type\n* All Scalars\n* All Interfaces\n* All Unions\n* All Input types\n* All Types (beside Query, Mutation and Subscription)\n* All Enums\n\nWithin each section, the entities are sorted alphabetically. There are some parameters to suppress the alphabetical\nsorting, please submit a pull request or issue if you need more options.\n\nThe plugin should be able to handle custom directives and custom scalars. The plugin should also be able to sort\nmultiple dependent graphql schema files as long as all entities are only defined in one schema.\n\n## Goals Overview ##\n\nThe SortGraphQL Plugin has one goal.\n\n* **mvn sortgraphql:sort** sorts the grapql file/files\n\n## Usage ##\n\nAdd the plugin to your pom-file to sort the schema each time you build the project. The plugin will execute by default\nin the Maven validate phase. Remember to set the `src/main/resources/` path\n\n```xml\n\n\u003cbuild\u003e\n  \u003cplugins\u003e\n    ...\n    \u003cplugin\u003e\n      \u003cgroupId\u003ecom.github.ekryd.sortgraphql\u003c/groupId\u003e\n      \u003cartifactId\u003esortgraphql-maven-plugin\u003c/artifactId\u003e\n      \u003cversion\u003e@pom.version@\u003c/version\u003e\n      \u003cconfiguration\u003e\n        \u003cschemaFile\u003esrc/main/resources/mySchema.graphqls\u003c/schemaFile\u003e\n      \u003c/configuration\u003e\n      \u003cexecutions\u003e\n        \u003cexecution\u003e\n          \u003cgoals\u003e\n            \u003cgoal\u003esort\u003c/goal\u003e\n          \u003c/goals\u003e\n        \u003c/execution\u003e\n      \u003c/executions\u003e\n    \u003c/plugin\u003e\n    ...\n  \u003c/plugins\u003e\n\u003c/build\u003e\n\n```\n\n## Parameters ##\n\n| **Parameter**                | **Default value**                    | **Description**                                                                                                                                                                                          | **Example**                                                                                                                                                                                                                      |\n|:-----------------------------|:-------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `\u003ccreateBackupFile\u003e`         | `true`                               | Should a backup copy be created for the sorted schema.                                                                                                                                                   | `\u003ccreateBackupFile\u003efalse\u003c/createBackupFile\u003e`                                                                                                                                                                                     |\n| `\u003cbackupFileExtension\u003e`      | `.bak`                               | Name of the file extension for the backup file.                                                                                                                                                          | `\u003cbackupFileExtension\u003e.temp\u003c/backupFileExtension\u003e`                                                                                                                                                                               |\n| `\u003cencoding\u003e`                 | `UTF-8`                              | Encoding for the files.                                                                                                                                                                                  | `\u003cencoding\u003eASCII\u003c/encoding\u003e`                                                                                                                                                                                                     |\n| `\u003cindividualSchemas\u003e`        | `false`                              | By default, if multiple schema files are specified in schema files, then those schemas will be merged together during validation. This flag specifies that each schema should be validated individually. | `-Dsortgraphql.individualSchemas=true` \u003cbr\u003e\u003cbr\u003e `\u003cindividualSchemas\u003etrue\u003c/individualSchemas\u003e`                                                                                                                                    |\n| `\u003cschemaFile\u003e`               | `src/main/resources/schema.graphqls` | Location of the schema file. Remember to set the `src/main/resources/` path.                                                                                                                             | `-Dsortgraphql.schemaFile=\"src/main/resources/main.graphqls\"` \u003cbr\u003e\u003cbr\u003e `\u003cschemaFile\u003esrc/main/resources/main.graphqls\u003c/schemaFile\u003e`                                                                                               |\n| `\u003cschemaFiles\u003e`              | `\u003cempty\u003e`                            | Location of multiple graphql schema file that should be sorted. Overrides parameter schemaFile. The schema files can reference each other, but shared definitions are not allowed.                       | \u003cpre lang=\"xml\"\u003e\u0026lt;schemaFiles\u0026gt;\u003cbr\u003e  \u0026lt;schemaFile\u0026gt;src/main/resources/queries.graphqls\u0026lt;/schemaFile\u0026gt; \u003cbr\u003e  \u0026lt;schemaFile\u0026gt;src/main/resources/mutations.graphqls\u0026lt;/schemaFile\u0026gt;\u003cbr\u003e\u0026lt;/schemaFiles\u0026gt;\u003c/pre\u003e | \n| `\u003cskip\u003e`                     | `false`                              | Set this to 'true' to bypass SortGraphQL plugin.                                                                                                                                                         | `-Dsortgraphql.skip=true` \u003cbr\u003e\u003cbr\u003e `\u003cskip\u003etrue\u003c/skip\u003e`                                                                                                                                                                           |\n| `\u003cskipFieldArgumentSorting\u003e` | `false`                              | Set this to 'true' to skip sorting the arguments for a field in a type.                                                                                                                                  | `\u003cskipFieldArgumentSorting\u003etrue\u003c/skipFieldArgumentSorting\u003e`                                                                                                                                                                      |\n| `\u003cskipUnionTypeSorting\u003e`     | `false`                              | Set this to 'true' to skip sorting the types in a union.                                                                                                                                                 | `\u003cskipUnionTypeSorting\u003etrue\u003c/skipUnionTypeSorting\u003e`                                                                                                                                                                              |\n| `\u003cgenerateHashDescriptions\u003e` | `false`                              | Use hash sign for descriptions, instead of keeping string literals (with quote character).                                                                                                               | `\u003cgenerateHashDescriptions\u003etrue\u003c/generateHashDescriptions\u003e`                                                                                                                                                                      |\n| `\u003cgenerateSchemaDefinition\u003e` | `false`                              | Generate the 'schema' definition element at the top of the schema, when generating the sorted schema file.                                                                                               | `\u003cgenerateSchemaDefinition\u003etrue\u003c/generateSchemaDefinition\u003e`                                                                                                                                                                      |\n\n## Download ##\nThe plugin is hosted i [Maven Central](https://mvnrepository.com/artifact/com.github.ekryd.sortgraphql/sortgraphql-maven-plugin) and will be downloaded automatically if you include it as a plugin in your pom file.\n\n## Version history ##\n\n* 2022-09-20: Released 1.1.0 Differentiate between descriptions and comments when processing files. \n* 2022-04-02: Released 1.0.0 Supports schema definitions properly. \n* 2021-10-11: Released 0.0.4 Added configuration parameters to validate individual schemas. Input types will also have directives on separate line. \n* 2021-06-06: Released 0.0.3 Added configuration parameters to customize sorting. \n* 2021-06-01: Released 0.0.2 Fully functional but with limited configuration for sorting. Try it out and tell me what you think\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekryd%2Fsortgraphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fekryd%2Fsortgraphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekryd%2Fsortgraphql/lists"}