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
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ export default addTypenameToDocument(gql`
crop(ratio: $imageRatio) {
url
}
id
title
}
... on Video {
posterImage {
crop(ratio: $imageRatio) {
url
}
id
title
}
}
Expand Down
7 changes: 4 additions & 3 deletions packages/provider-queries/src/topic-articles.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,19 @@ export default addTypenameToDocument(gql`
shortIdentifier
leadAsset {
... on Image {
id
title
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

title
}
... on Video {
posterImage {
title
crop(ratio: $imageRatio) {
url
}
id
title
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion packages/provider-test-tools/src/author-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ export default ({
imageIndex += 1;
return {
__typename: "Image",
title: `Some title ${imageIndex}`
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

};
},
Media: () => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ Object {
"crop": Object {
"__typename": "Crop",
"url": "https://placeimg.com/300/200/tech",
Symbol(id): "$Article:d98c2 1c-cb16-11e7-b529-95e3fc05f40f.leadAsset.crop({\\"ratio\\":\\"3:2\\"})",
Symbol(id): "$Image:e98c2 1c-cb16-11e7-b529-95e3fc05f40f.crop({\\"ratio\\":\\"3:2\\"})",
},
"id": "e98c2 1c-cb16-11e7-b529-95e3fc05f40f",
"title": "Some title 1",
Symbol(id): "$Article:d98c2 1c-cb16-11e7-b529-95e3fc05f40f.leadAsset",
Symbol(id): "Image:e98c2 1c-cb16-11e7-b529-95e3fc05f40f",
},
"publicationName": "TIMES",
"publishedTime": "2018-06-01",
Expand Down