Open matsus2 opened 2 years ago
Indeed Enhance Filtering only supports top level objects/types for now however we are planning to support nested types in the future. Would you mind sharing your use case, if possible with specific types/fields required for filtering?
Sure. We have a mutation called bulkCreateNotifications that returns a list of Notification object. We want to filter based on one of the fields of Notification object as you can do with a enhanced filtering for subscriptions for a single object output but since the mutation returns a list of them, it fails.
Enhanced subscription currently works for createNotfication that returns one Notification object. Notification has a field called "userId" and we want users to only get the subscription if that userId matches. We also want to support it for another mutation that returns list of Notifications.
Is it possible to automatically support the same filtering, but if it recognizes that output of the mutation is a list then it loops over each object and filters them accordingly?
I ran into this recently too, and would love to have this. We've got this in our schema:
interface Media {
id: ID!
name: String!
duration: Float
folder: Folder
mediaType: MediaType!
owner: User!
ownerId: ID!
createdAt: String!
updatedAt: String!
deleted: Boolean!
deletedAt: String
}
You can see my temporary workaround of having ownerId
in there, though that's not ideal, since owner
is already part of this interface.
It would be nice if we could just specify "fieldName": "owner/id"
to filter by the nested field.
+1 on this. Our usecase is a list of subscriber ids. It would be nice for the enhanced filter to work with top level lists so that each subscriber can listen to new data.
It would be great to filter by list of objects!
There are two cases for nested object filtering:
Looking at the documentation, it seems like enhanced filtering subscription only supports mutation that returns one object. https://docs.aws.amazon.com/appsync/latest/devguide/aws-appsync-real-time-enhanced-filtering.html
Will there be support for this use case?