Skip to content

Commit

Permalink
Changed return type metaImage
Browse files Browse the repository at this point in the history
  • Loading branch information
MaPoKen committed Oct 8, 2024
1 parent 4bd9ec2 commit c200357
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/resolvers/articleResolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
GQLArticleTransformedContentArgs,
GQLRelatedContent,
GQLVisualElementOembed,
GQLMetaImageWithCopyright,
} from "../types/schema";

export const Query = {
Expand Down Expand Up @@ -92,7 +93,11 @@ export const resolvers = {
const parsed = load(oembed.html);
return parsed("iframe").attr("src");
},
async metaImage(article: IArticleV2, _: any, context: ContextWithLoaders): Promise<GQLMetaImage | undefined> {
async metaImage(
article: IArticleV2,
_: any,
context: ContextWithLoaders,
): Promise<GQLMetaImageWithCopyright | undefined> {
if (!article.metaImage) return undefined;
const imageId = article.metaImage.url.split("/").pop() ?? "";
const image = await fetchImageV3(imageId, context);
Expand Down

0 comments on commit c200357

Please sign in to comment.