Skip to content

Commit

Permalink
add missing sort order values
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasJ committed Aug 28, 2023
1 parent da1d1e8 commit fe249fe
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions lib/api/api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,40 @@ defmodule AshGraphql.Api do
name: "DESC",
value: :desc
},
%Absinthe.Blueprint.Schema.EnumValueDefinition{
module: schema,
identifier: :desc_nils_first,
__reference__: AshGraphql.Resource.ref(env),
name: "DESC_NILS_FIRST",
value: :desc
},
%Absinthe.Blueprint.Schema.EnumValueDefinition{
module: schema,
identifier: :desc_nils_last,
__reference__: AshGraphql.Resource.ref(env),
name: "DESC_NILS_LAST",
value: :desc
},
%Absinthe.Blueprint.Schema.EnumValueDefinition{
module: schema,
identifier: :asc,
__reference__: AshGraphql.Resource.ref(env),
name: "ASC",
value: :asc
},
%Absinthe.Blueprint.Schema.EnumValueDefinition{
module: schema,
identifier: :asc_nils_first,
__reference__: AshGraphql.Resource.ref(env),
name: "ASC_NILS_FIRST",
value: :asc
},
%Absinthe.Blueprint.Schema.EnumValueDefinition{
module: schema,
identifier: :asc_nils_last,
__reference__: AshGraphql.Resource.ref(env),
name: "ASC_NILS_LAST",
value: :asc
}
],
identifier: :sort_order,
Expand Down
2 changes: 1 addition & 1 deletion test/paginate_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ defmodule AshGraphql.PaginateTest do
test "default_limit records are fetched" do
doc = """
query KeysetPaginatedPosts {
keysetPaginatedPosts(sort: [{field: TEXT}]) {
keysetPaginatedPosts(sort: [{field: TEXT, order: ASC_NILS_LAST}]) {
count
startKeyset
endKeyset
Expand Down

0 comments on commit fe249fe

Please sign in to comment.