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
- apolloServer mocks no longer overwrite resolvers (#93) Documentation update for [Allows resolvers to be used with mocks](https://github.com/apollostack/apollo-server/pull/9) — committed to apollographql/apollo-client by rdrey 8 years ago
- Merge pull request #93 from TimMikeladze/patch-2 Document usage of compose — committed to apollographql/apollo-client by deleted user 8 years ago
@stubailo yep, it’s more idiomatic with redux and doesn’t expose an API that people not using redux might be confused by 🎉