apollo-client: Don't treat `id` as a special field unless instructed to do so

Right now, the id field on an object is treated as a globally unique ID no matter what. I think this could cause serious issues for backends where the id property is not unique across types.

It’s probably worth hiding this feature behind a flag somehow so that you can turn it on if you have a relay-like backend, and think about whether we want to handle non-unique IDs, or just build the Apollo Server to make it super easy to use these unique IDs.

@helfer do you think the Relay node spec is something that would be easy to build into the server? One more option is to make the client work with (id, typename) pairs, and not assume id is unique across all objects.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 3
  • Comments: 15 (15 by maintainers)

Commits related to this issue

Most upvoted comments

@stubailo yep, it’s more idiomatic with redux and doesn’t expose an API that people not using redux might be confused by 🎉