Pagination required by default in ash_graphql?

Hi, I've just upgraded to a new version of ash_graphql and now I'm getting errors of the form:
** (Ash.Error.Invalid.PageRequiresPagination) Pagination is not enabled on resource MyResource for the action %Ash.Resource.Actions.Read{name: :my_action, pagination: false, primary?: false, filter: some_attribute == true, description: nil, get?: false, manual: nil, modify_query: nil, transaction?: false, arguments: [%Ash.Resource.Actions.Argument{allow_nil?: true, type: Ash.Type.Integer, name: :limit, default: 1, private?: false, sensitive?: false, description: nil, constraints: [min: 1]}], preparations: [%Ash.Resource.Preparation{preparation: {Ash.Resource.Preparation.Build, [options: [limit: {:_arg, :limit}, sort: [order_by_attribute: :asc]]]}}], touches_resources: [], metadata: [], type: :read}. Check that you've
enabled pagination in your action. For example:


read my_action do
pagination offset?: true, keyset?: true, required?: false
end
** (Ash.Error.Invalid.PageRequiresPagination) Pagination is not enabled on resource MyResource for the action %Ash.Resource.Actions.Read{name: :my_action, pagination: false, primary?: false, filter: some_attribute == true, description: nil, get?: false, manual: nil, modify_query: nil, transaction?: false, arguments: [%Ash.Resource.Actions.Argument{allow_nil?: true, type: Ash.Type.Integer, name: :limit, default: 1, private?: false, sensitive?: false, description: nil, constraints: [min: 1]}], preparations: [%Ash.Resource.Preparation{preparation: {Ash.Resource.Preparation.Build, [options: [limit: {:_arg, :limit}, sort: [order_by_attribute: :asc]]]}}], touches_resources: [], metadata: [], type: :read}. Check that you've
enabled pagination in your action. For example:


read my_action do
pagination offset?: true, keyset?: true, required?: false
end
Adding pagination wasn't previously required - has this default behaviour changed and if so is there a way round it?
4 Replies
ZachDaniel
ZachDaniel3y ago
Hmmmmmm….this smells like a bug to me. I’ll take a look when I get to my laptop. We added an error message to help when the page option is provided to an action that doesn’t support it
Adam Harris
Adam HarrisOP3y ago
ok, thanks 👍🏼
ZachDaniel
ZachDaniel3y ago
Can you try main?
Adam Harris
Adam HarrisOP3y ago
yes - that's seems to be fixed on main now - thank you 👍🏼

Did you find this page helpful?