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

fix: Add id to images inside author and topic articles queries #1479

Merged
merged 2 commits into from
Nov 13, 2018

Conversation

tuncaulubilge
Copy link
Contributor

@tuncaulubilge tuncaulubilge commented Nov 13, 2018

Apollo normalised cache has an issue which fails the network request if an object has an id in one query and doesn't have it in another. Added id to all image objects inside topic and author articles

Here is the error we are receiving at the moment:

Store error: the application attempted to write an object with no provided id but the store already contains an id of Image:d3494166-0c9b-4971-86c0-602892d5b11c for this object. The selectionSet that was trying to be written is:

Here is the related github issue for more details: apollographql/apollo-client#2510

title: `Some title ${imageIndex}`,
id: `e98c2${imageIndex
.toString()
.padStart(2)}c-cb16-11e7-b529-95e3fc05f40f`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feels a bit weird

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saw this in other providers. I agree it's a bit weird but at least it ensures a certain level of uniqueness

crop(ratio: $imageRatio) {
url
}
id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not uuid? weird

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its type is "uuid" but in apollo it's called "id" by default

@colincclark colincclark merged commit e8c8858 into master Nov 13, 2018
@colincclark colincclark deleted the fix/apollo-image-ids branch November 13, 2018 14:37
@coveralls
Copy link

Coverage Status

Coverage remained the same at 92.377% when pulling 3265f9c on fix/apollo-image-ids into a70ab56 on master.

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

Successfully merging this pull request may close these issues.

3 participants