How to handle deletedAt in Graphql and faunadb?

I cannot replicate your issue. Taking information from here and from this previous topic, I’ve reconstructed your schema as best I can (including copy-pasting the query to update the function) and I get the same results in GraphQL as I do while using FQL.

I created a key for a user and created a script to run Call("getUserGoals", 50 , null, null)

image

I used the same key in the GraphQL auth header and ran getUserGoals

My best guess at this point is that your GraphQL API was not running the same code as you were in the shell.

The reason I was asking you to run the UDF, and not paste the definition into the shell, was to make sure that GraphQL was, in fact, running the code you expected it to.

Note if I query for the logged in user, then all of the goals, I get the “deleted” goals, indicating that the index to filter for “deletedAt == null” in the getUserGoals UDF is working correctly.

It looks like your latest topic means that you are trying to find a workaround for the issue you have here. I think we need to figure out what’s going on here, though, because it really should work!