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

Option to automatically add ID field to queries #15

Open
chrisdevereux opened this issue May 22, 2018 · 1 comment
Open

Option to automatically add ID field to queries #15

chrisdevereux opened this issue May 22, 2018 · 1 comment

Comments

@chrisdevereux
Copy link

In order for automatic cache updates to work correctly, Apollo (by default) requires that the id and __typename fields are provided in queries. It is very easy to forget to do this, often leading to subtle bugs that are annoying to track down.

Since this loader has access to the graphql schema, and therefore knows which types have a field of type ID, it could it be configured to auto-append the id field wherever it is needed in a query. This would be extremely helpful!

@stephen
Copy link
Contributor

stephen commented May 23, 2018

Sounds like a nice option to add. A PR would be welcome! 😄

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

No branches or pull requests

2 participants