Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
com.github.ekryd.sortgraphql:sortgraphql-parent
Advanced tools
A Maven plugin that sorts GraphQL Schemas
Maven plugin to sort GraphQL Schemas.
The plugin will format and sort GraphQL schemas in a predefined way. The default sort order sections are:
Within each section, the entities are sorted alphabetically. There are some parameters to suppress the alphabetical sorting, please submit a pull request or issue if you need more options.
The plugin should be able to handle custom directives and custom scalars. The plugin should also be able to sort multiple dependent graphql schema files as long as all entities are only defined in one schema.
The SortGraphQL Plugin has one goal.
Add the plugin to your pom-file to sort the schema each time you build the project. The plugin will execute by default
in the Maven validate phase. Remember to set the src/main/resources/
path
<build>
<plugins>
...
<plugin>
<groupId>com.github.ekryd.sortgraphql</groupId>
<artifactId>sortgraphql-maven-plugin</artifactId>
<version>@pom.version@</version>
<configuration>
<schemaFile>src/main/resources/mySchema.graphqls</schemaFile>
</configuration>
<executions>
<execution>
<goals>
<goal>sort</goal>
</goals>
</execution>
</executions>
</plugin>
...
</plugins>
</build>
Parameter | Default value | Description | Example |
---|---|---|---|
<createBackupFile> | true | Should a backup copy be created for the sorted schema. | <createBackupFile>false</createBackupFile> |
<backupFileExtension> | .bak | Name of the file extension for the backup file. | <backupFileExtension>.temp</backupFileExtension> |
<encoding> | UTF-8 | Encoding for the files. | <encoding>ASCII</encoding> |
<individualSchemas> | 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 <individualSchemas>true</individualSchemas> |
<schemaFile> | 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" <schemaFile>src/main/resources/main.graphqls</schemaFile> |
<schemaFiles> | <empty> | 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. | <schemaFiles> |
<skip> | false | Set this to 'true' to bypass SortGraphQL plugin. | -Dsortgraphql.skip=true <skip>true</skip> |
<skipFieldArgumentSorting> | false | Set this to 'true' to skip sorting the arguments for a field in a type. | <skipFieldArgumentSorting>true</skipFieldArgumentSorting> |
<skipUnionTypeSorting> | false | Set this to 'true' to skip sorting the types in a union. | <skipUnionTypeSorting>true</skipUnionTypeSorting> |
<generateHashDescriptions> | false | Use hash sign for descriptions, instead of keeping string literals (with quote character). | <generateHashDescriptions>true</generateHashDescriptions> |
<generateSchemaDefinition> | false | Generate the 'schema' definition element at the top of the schema, when generating the sorted schema file. | <generateSchemaDefinition>true</generateSchemaDefinition> |
The plugin is hosted i Maven Central and will be downloaded automatically if you include it as a plugin in your pom file.
FAQs
A Maven plugin that sorts GraphQL Schemas
We found that com.github.ekryd.sortgraphql:sortgraphql-parent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.