Closed DanielAtCosmicDNA closed 2 months ago
Many thanks for raising this bug report @DanielAtCosmicDNA. :bug: We will now attempt to reproduce the bug based on the steps you have provided.
Please ensure that you've provided the necessary information for a minimal reproduction, including but not limited to:
If you have a support agreement with Neo4j, please link this GitHub issue to a new or existing Zendesk ticket.
Thanks again! :pray:
Hey @DanielAtCosmicDNA, let's talk about your expectations.
{ "data": { "messageRelationshipCreated": { "message": { "id": "e4e4d3bc-b2b9-4f3f-8b39-7fbaf089670c", "body": "Welcome to you!" }, "createdRelationship": { "seen": [], "sender": { "id": "6015e398-3e93-4f61-a035-47abd5b969ad" }, "conversation": { "node": { "id": "8f8faa32-a565-4b48-bf6b-cd69ab4ee82a" } } } } } }
You expect seen
to be an empty array, but this field is concerning itself with whether a seen
relationship was created as part of the mutation, which it was not. seen
might be an empty array when querying the conversation, but in the mutation a seen
relationship was not created so it is being returned as null
as it should be in this case.
For sender
and conversation
- a subscription event is created for each created relationship. The event you've shown in your reproduction is the event for the conversation
relationship was created. There should be another event which contains the sender
relationship information! Can you please check this?
@darrellwarde, I would rather subscribe with:
subscription OnMessageCreated($where: MessageRelationshipCreatedSubscriptionWhere) {
messageRelationshipCreated(where: $where) {
message {
id
body
sender {
id
}
seen {
id
}
}
But I am not sure how to achieve this or workaround the limitation of filtering being only able to be applied at the root of the subscription operation...
I wanted to avoid making a second query to get the message with sender and seen fields populated. I would rather have this promptly available straight from the subscription instead...
I see. Apologies @DanielAtCosmicDNA, but we are working within the constraints of what we can do with the database, I'm afraid it's not on our roadmap to have the subscriptions payload fully match the fields that you can select in a query. I'm going to close this issue because it is working as it is intended to. Thanks for opening this!
Describe the bug A clear and concise description of what the bug is.
When following: https://github.com/CosmicDNA/neo4j-graphql-subscription, the resulting subscription returns null for the fields
seen
andsender
when they should return:Type definitions Here are the type definitions:
To Reproduce Steps to reproduce the behavior:
Expected behavior The subscription output should show
seen
andsender
variables correctly as follows:Screenshots
System (please complete the following information):
Additional context