Skip to content

Commit

Permalink
Merge pull request #6375 from artsy/let-logged-out-see-collections-if…
Browse files Browse the repository at this point in the history
…-public

feat: let a logged out user view public collection data
  • Loading branch information
mzikherman authored Jan 22, 2025
2 parents 5f85fbc + 2af8a92 commit 6a3126a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/lib/loaders/loaders_without_authentication/gravity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ export default (opts) => {
artworksLoader: gravityLoader("artworks"),
authenticationStatusLoader: gravityLoader("me", {}, { headers: true }),
bidderLoader: gravityLoader((id) => `bidder/${id}`),
collectionArtworksLoader: gravityLoader(
(id) => `collection/${id}/artworks`,
{},
{ headers: true }
),
collectionLoader: gravityLoader((id) => `collection/${id}`),
createInvoicePaymentLoader: gravityLoader(
(id) => `invoice/${id}/payment`,
{},
Expand Down
2 changes: 1 addition & 1 deletion src/schema/v2/me/myCollectionInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export const MyCollectionInfo: GraphQLFieldConfig<any, ResolverContext> = {
type: MyCollectionInfoType,
description: "Info about the current user's my-collection",
resolve: async (_parent, _options, { userID, collectionLoader }) => {
if (!(collectionLoader && userID)) {
if (!userID) {
return null
}

Expand Down

0 comments on commit 6a3126a

Please sign in to comment.