A set of DGS Schema Directives for common response formatting use-cases.
<dependency>
<groupId>io.github.setchy</groupId>
<artifactId>dgs-extended-formatters</artifactId>
<version>1.0.14</version>
</dependency>
The following schema directives support formatting String
scalars
Abbreviates a string using ellipses for a given width
- SDL:
directive @abbreviate(width: Int!) on FIELD_DEFINITION
Converts the String into camelCase
- SDL:
directive @camelcase on FIELD_DEFINITION | ARGUMENT_DEFINITION
Capitalize the starting letter for each word in a String
- SDL:
directive @capitalize on FIELD_DEFINITION | ARGUMENT_DEFINITION
Lowercase all characters in a String
- SDL:
directive @lowercase on FIELD_DEFINITION | ARGUMENT_DEFINITION
Prepends a prefix to a String
- SDL:
directive @prefix(with: String!) on FIELD_DEFINITION
Transforms a string into a base64 protobuf opaque ID. This takes in domain, subdomain, and systemName arguments which will be encoded into the ID.
- SDL:
directive @resourceId(domain: String!, subdomain: String!, systemName: String!) on FIELD_DEFINITION
Reverse the characters in a String
- SDL:
directive @reverse on FIELD_DEFINITION | ARGUMENT_DEFINITION
Appends a suffix to a String
- SDL:
directive @suffix(with: String!) on FIELD_DEFINITION
Invert the case of each character in a String
- SDL:
directive @swapcase on FIELD_DEFINITION | ARGUMENT_DEFINITION
Remove any leading or trailing whitespace
- SDL:
directive @trim on FIELD_DEFINITION | ARGUMENT_DEFINITION
Uppercase each character in a String
- SDL:
directive @uppercase on FIELD_DEFINITION | ARGUMENT_DEFINITION
The following schema directives support formatting Int
or Float
scalars
Returns the absolute value
- SDL:
directive @absolute on FIELD_DEFINITION | ARGUMENT_DEFINITION
Returns the ceiling value
- SDL:
directive @ceiling on FIELD_DEFINITION | ARGUMENT_DEFINITION
Returns the floor value
- SDL:
directive @floor on FIELD_DEFINITION | ARGUMENT_DEFINITION
Our release process involves
- Run the release workflow
- Enter the new version number to release
- Draft a new release, create a tag that matches the release version from above and publish