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

feat: add user seen artworks mutation #6443

Merged
merged 2 commits into from
Feb 19, 2025
Merged

feat: add user seen artworks mutation #6443

merged 2 commits into from
Feb 19, 2025

Conversation

egdbear
Copy link
Contributor

@egdbear egdbear commented Feb 18, 2025

This PR introduces a new mutation, createUserSeenArtwork, which will be used to track seen artworks for Infinite Discovery. Gravity PR that introduced the endpoint for tracking seen artworks.

Ticket DIA-1155

Screenshot 2025-02-19 at 2 17 08 PM

@egdbear egdbear force-pushed the egdbear/feat/DIA-1155 branch from 59f8658 to 9cfedf7 Compare February 19, 2025 13:17
@egdbear egdbear requested review from a team and nickskalkin February 19, 2025 13:21
@egdbear egdbear self-assigned this Feb 19, 2025
@egdbear egdbear changed the title [DRAFT] feat: add user seen artworks mutation feat: add user seen artworks mutation Feb 19, 2025
@egdbear egdbear force-pushed the egdbear/feat/DIA-1155 branch from 9cfedf7 to d8bbc87 Compare February 19, 2025 13:32
ResolverContext
>({
name: "CreateUserSeenArtwork",
description: "Creates User Seen Artwork.",
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: I would add more human description, like "Marks an artwork as seen when a user swipes through Infinite Discovery"

nickskalkin
nickskalkin previously approved these changes Feb 19, 2025
Copy link
Contributor

@nickskalkin nickskalkin left a comment

Choose a reason for hiding this comment

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

👍 just one small question

}

const createUserSeenArtworkLoaderPayload = Object.keys(args)
.filter((key) => key !== "id")
Copy link
Contributor

Choose a reason for hiding this comment

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

question: not sure if I understand what it does. Could we just call createUserSeenArtworkLoader({ artwork_id: args.artworkId})?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It simply converts non-ID parameters to snake_case. Since it's used in other mutations, I thought it would be good to follow this utility for consistency

Copy link
Contributor

@nickskalkin nickskalkin left a comment

Choose a reason for hiding this comment

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

🚀

@egdbear egdbear merged commit 4f87cdb into main Feb 19, 2025
4 checks passed
@egdbear egdbear deleted the egdbear/feat/DIA-1155 branch February 19, 2025 16:01
@@ -18,6 +19,11 @@ export const DiscoverArtworks: GraphQLFieldConfig<void, ResolverContext> = {
type: new GraphQLList(GraphQLString),
description: "Exclude these artworks from the response",
},
useInternalTracking: {
Copy link
Contributor

Choose a reason for hiding this comment

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

@egdbear sudden idea — let's instead of this param use an ENV var in line number 61? This way backend will be able to control behavior without frontend changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you think that is necessary if we add this change to Eigen?

@artsy-peril artsy-peril bot mentioned this pull request Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants