diff --git a/lib/api/api.ex b/lib/api/api.ex index 4c6f9299..96875b32 100644 --- a/lib/api/api.ex +++ b/lib/api/api.ex @@ -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, diff --git a/test/paginate_test.exs b/test/paginate_test.exs index 07b27dc9..f5147417 100644 --- a/test/paginate_test.exs +++ b/test/paginate_test.exs @@ -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