Skip to content

Subscription DSL filter causes filtered events to become errors #354

@justin-m-morgan

Description

@justin-m-morgan

Code of Conduct

  • I agree to follow this project's Code of Conduct

AI Policy

  • I agree to follow this project's AI Policy, or I agree that AI was not used while creating this issue.

Versions

Elixir - 1.18.4
Erlang - 28.0.2
Ash - 3.5.34
AshGraphql - 1.8.2
Absinthe - 1.7.10

Operating system

MacOS 15.6

Current Behavior

When using the subscription DSL filter, when a filter is applied, the events that out to be excluded are still sent with a nil payload and an error code: not_found.

Example:

    subscription($filter: TestResourceFilterInput) {
      testResourceCreated(filter:$filter) {
        created {
          id
          choice
        }
      }
    }
%Phoenix.Socket.Message{
topic: "__absinthe__:doc:unRcSrcuHkiBCReefuo40W42GErDK62KmQKrtqYnwyU=:1E9C1D467CBCCEB83F768CA9C9AD88068931E40CF6C347A4D1FB07F29F3762C0", 
event: "subscription:data", 
payload: %{result: %{data: %{"testResourceCreated" => nil}, 
errors: [%{code: "not_found", message: "could not be found", path: ["testResourceCreated"], fields: [], vars: [], short_message: "could not be found", locations: [%{line: 2, column: 3}]}]}, 
subscriptionId: "__absinthe__:doc:unRcSrcuHkiBCReefuo40W42GErDK62KmQKrtqYnwyU=:1E9C1D467CBCCEB83F768CA9C9AD88068931E40CF6C347A4D1FB07F29F3762C0"}, ref: nil, join_ref: nil
} 

In the gql playground, this results in just a null event without the included error message which is particularly unhelpful.

{
  "data": {
    "testResourceCreated": null
  }
}

Reproduction

Reproduction Repo

Expected Behavior

When a filter is applied to a subscription, excluded events should not be sent to the subscriber as error events with no data payload.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions