@@ -398,6 +398,71 @@ input ActorUpdateInput {
398398
399399This means `actedIn` can be updated on an update, but it is no longer available on `create` operations.
400400
401+
402+ == `@sortable`
403+
404+ This directive sets the availability of the input fields for sorting.
405+ It has a single argument:
406+
407+ * **byValue**: Defaults to true. If disabled, this field is not available for sorting.
408+
409+ === Definition
410+
411+ [source, graphql, indent=0]
412+ ----
413+ """Instructs @neo4j/graphql to generate sorting inputs for this field."""
414+ directive @sortable(byValue: Boolean! = true) on FIELD_DEFINITION
415+ ----
416+
417+ === Usage
418+
419+ With this definition:
420+
421+ [source, graphql, indent=0]
422+ ----
423+ type Movie @node {
424+ title: String!
425+ description: String! @sortable(byValue: false)
426+ }
427+ ----
428+
429+ The following input type is generated for Movies:
430+
431+ [source, graphql, indent=0]
432+ ----
433+ """
434+ Fields to sort Movies by. The order in which sorts are applied is not guaranteed when specifying many fields in one MovieSort object.
435+ """
436+ input MovieSort {
437+ title: SortDirection
438+ }
439+ ----
440+
441+ Movies can be sorted by the title, but not by description:
442+
443+ This is valid:
444+ [source, graphql, indent=0]
445+ ----
446+ query {
447+ movies(sort: {title: DESC}) {
448+ title
449+ }
450+ }
451+ ----
452+
453+ This is not valid:
454+ [source, graphql, indent=0]
455+ ----
456+ query {
457+ movies(sort: {description: DESC}) {
458+ title
459+ }
460+ }
461+ ----
462+
463+
464+ If no fields are sortable, the type `MovieSort` is not generated, and the `sort` input isn't available.
465+
401466== `@filterable`
402467
403468This directive defines the filters generated for the field to which this directive is applied.
0 commit comments