Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong remove mutations scheme #2

Open
xinhuang327 opened this issue Mar 31, 2016 · 1 comment
Open

Wrong remove mutations scheme #2

xinhuang327 opened this issue Mar 31, 2016 · 1 comment
Labels

Comments

@xinhuang327
Copy link

Remove actions in the demo don't work as expected, removed items show up after GraphQL responses.

The reason I've found is in MutateAndGetPayload of RemoveCompletedTodos and RemoveTodo mutations, they should return GlobalIDs (like "VG9kbzoy") instead of integer IDs defined in database.

id, _ := inputMap["id"].(string)
resolvedId := relay.FromGlobalID(id)
RemoveTodo(resolvedId.ID)
return map[string]interface{}{
     "todoId": resolvedId.ID, // resolvedId.ID should be id.
}, nil
@sogko sogko added the bug label Apr 2, 2016
@sogko
Copy link
Owner

sogko commented Apr 2, 2016

Hi @xinhuang327

Thanks for taking time to look into this, appreciate it very much.

I would very much be open to accept a PR on this if you want to contribute ☺️
(I've gotten my hands full at the moment, I'll work on this when I have the time to spare. In the mean time, any help would be very much appreciated! 😃)

Cheers!


Some notes:

  • The code that @xinhuang327 mentions is here
  • The corresponding code in relay-js todo example is here
  • At first glance, the todo example in relay-js seems like it would have the same issue here. Might need to investigate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants