ash-project / ash_graphql

The extension for building GraphQL APIs with Ash
https://hexdocs.pm/ash_graphql
MIT License
71 stars 46 forks source link

Raised error for `update` mutation, with `read_action` and `Ash.Query.after_action()` #191

Closed moxley closed 2 months ago

moxley commented 2 months ago

Describe the bug Raised error when trying to execute update mutation with identity false and read_action action_x, and action_x has a prepare with Ash.Query.after_action().

The logged error starts as:

# 13:38:11.914 [warning] `fa343d97-883c-4734-9696-60e52b4bcfd4`: AshGraphql.Error not implemented for error:

# ** (Ash.Error.Invalid.NoMatchingBulkStrategy) AshGraphql.Test.User.update had no matching bulk strategy that could be used.

# Requested strategies: [:atomic]

# Could not use `:stream`: could not stream the query
# Could not use `:atomic_batches`: Not in requested strategies
# Could not use `:atomic`: cannot atomically update a query if it has `before_action` or `after_action` hooks

To Reproduce

See this modification of ash_graphl's tests.

Note: The after_action() callback in this example is essentially a no-op or identity function, but in my application, it does something useful.

Expected behavior

** Runtime

Additional context

This started happening while I was upgrading to Ash 3.0.

moxley commented 2 months ago

I wasn't running the latest version of Ash. This is resolved in main. Closing.