Ash FrameworkAF
Ash Framework3y ago
21 replies
edwinofdawn

Ash Query filter function

For background information I have binary field in my datalayer called token when I call this the following function:
%{id: id} = user = insert(:user)

  assert {:ok, %My_App.Ash.User{id: ^id} = _user} =
 User
|> Ash.Query.filter(token == user.token)
|> My_App.Ash.read_one()

but I keep running into the same error highlighted below after inspection.
#Ash.Query<
  resource: My_App.Ash.User,
  errors: [
    %Ash.Error.Unknown.UnknownError{
      error: "filter: Invalid reference user.confirmation_token at relationship_path [:user]",
      field: nil,
      changeset: nil,
      query: nil,
      error_context: [],
      vars: [],
      path: [:filter],
      stacktrace: #Stacktrace<>,
      class: :unknown
    }
  ]
>

token exists on resource user , I don't know what the problem is ?
Was this page helpful?