You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When for some reason a post has been deleted without deleting the comments of it and you query a list of comments, you get an error with following message:
Cannot return null for non-nullable type: 'Post' within parent 'Comment' (/listComments/items[7]/post)"
But you don't know which comments are affected.
Describe the solution you'd like
It would be helpful if the IDs of the affected items are also provided in the error object. Example:
No, I don't use the data store for deleting, storing or updating the items.
I use the graphqlOperation method from "aws-amplify" for this purpose:
import { API, graphqlOperation } from "aws-amplify";
export const deletePost = async (id: string): Promise<void> => {
(await API.graphql(
graphqlOperation(deletePostMutation, { input: { id } })
)) as GraphQLResult<DeletePostMutation>;
};
But as I mentioned, for some reason, the comments of the post, were being deleted. So I know that I also have to delete all the comments before deleting the post.
But I used the Post and Comments example to simplify the example for explaining the issue.
In our case we have more than 90 entities in our GraphQL Schema with many connections between them. So sometimes when an error occurres during a deletion process, some of the data keeps in the database without their connections and it is difficult to identify these items.
Therefore it would be very helpful to get the list of items with error when calling a list query for this data model.
Is this related to a new or existing framework?
No response
Is this related to a new or existing API?
GraphQL API
Is this related to another service?
No response
Describe the feature you'd like to request
Assume this GraphQL Schema:
When for some reason a post has been deleted without deleting the comments of it and you query a list of comments, you get an error with following message:
Cannot return null for non-nullable type: 'Post' within parent 'Comment' (/listComments/items[7]/post)"
But you don't know which comments are affected.
Describe the solution you'd like
It would be helpful if the IDs of the affected items are also provided in the error object. Example:
Describe alternatives you've considered
Identify comments without a post by using their IDs from the DynamoDB table and request a getOperation for each of them to check if an error occurs.
Additional context
No response
Is this something that you'd be interested in working on?
The text was updated successfully, but these errors were encountered: