Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@graphql-codegen/typescript-resolvers": "^5.1.8",
"@graphql-eslint/eslint-plugin": "^4.4.0",
"@graphql-tools/mock": "^9.1.6",
"@ndla/types-backend": "^1.0.117",
"@ndla/types-backend": "^1.0.123",
"@ndla/types-embed": "^5.0.21-alpha.0",
"@ndla/types-taxonomy": "^1.0.54",
"@types/compression": "^1.8.1",
Expand Down
4 changes: 4 additions & 0 deletions src/resolvers/articleResolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ export const resolvers = {
language(article: ArticleV2DTO): string {
return article.content.language;
},
revised(article: ArticleV2DTO): string {
// Temporary until revised field is available in environment
return article.revised ?? article.published;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Stemmer vel heller for at vi bare deployer?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Er så lite glad i endringer som knekker ting!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Lover å fjerne dette med en gong ting er ute overalt!

},
requiredLibraries(article: ArticleV2DTO): ArticleV2DTO["requiredLibraries"] {
return article.requiredLibraries.map((lib) =>
lib.url.startsWith("http://") ? { ...lib, url: lib.url.replace("http://", "https://") } : lib,
Expand Down
1 change: 1 addition & 0 deletions src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@ export const typeDefs = gql`
created: String!
updated: String!
published: String!
revised: String!
metaImage: ImageMetaInformationV3
metaDescription: String!
articleType: String!
Expand Down
2 changes: 2 additions & 0 deletions src/types/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export type GQLArticle = {
published: Scalars['String']['output'];
relatedContent?: Maybe<Array<GQLRelatedContent>>;
requiredLibraries?: Maybe<Array<GQLArticleRequiredLibrary>>;
revised: Scalars['String']['output'];
revision: Scalars['Int']['output'];
revisionDate?: Maybe<Scalars['String']['output']>;
slug?: Maybe<Scalars['String']['output']>;
Expand Down Expand Up @@ -2727,6 +2728,7 @@ export type GQLArticleResolvers<ContextType = any, ParentType extends GQLResolve
published?: Resolver<GQLResolversTypes['String'], ParentType, ContextType>;
relatedContent?: Resolver<Maybe<Array<GQLResolversTypes['RelatedContent']>>, ParentType, ContextType, Partial<GQLArticleRelatedContentArgs>>;
requiredLibraries?: Resolver<Maybe<Array<GQLResolversTypes['ArticleRequiredLibrary']>>, ParentType, ContextType>;
revised?: Resolver<GQLResolversTypes['String'], ParentType, ContextType>;
revision?: Resolver<GQLResolversTypes['Int'], ParentType, ContextType>;
revisionDate?: Resolver<Maybe<GQLResolversTypes['String']>, ParentType, ContextType>;
slug?: Resolver<Maybe<GQLResolversTypes['String']>, ParentType, ContextType>;
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1639,10 +1639,10 @@ __metadata:
languageName: node
linkType: hard

"@ndla/types-backend@npm:^1.0.117":
version: 1.0.117
resolution: "@ndla/types-backend@npm:1.0.117"
checksum: 10c0/58dae577af05297cb333e202f40921b641972e0f360e067beac597b777688a970a8d3ca4fd2dee18606c0ba32c96b346ad40a3eddc128bfd832b3d896427bd2b
"@ndla/types-backend@npm:^1.0.123":
version: 1.0.123
resolution: "@ndla/types-backend@npm:1.0.123"
checksum: 10c0/515bf270a29abbb05d83fe1e3a20a29c88bd0b33d3984e14a9908b3d0a38856851d74d03c4ffdb36c59922ef867ed37f112939ee5052cf86e8320772e1be9891
languageName: node
linkType: hard

Expand Down Expand Up @@ -6327,7 +6327,7 @@ __metadata:
"@graphql-tools/mock": "npm:^9.1.6"
"@graphql-tools/schema": "npm:^10.0.32"
"@ndla/licenses": "npm:^9.0.3"
"@ndla/types-backend": "npm:^1.0.117"
"@ndla/types-backend": "npm:^1.0.123"
"@ndla/types-embed": "npm:^5.0.21-alpha.0"
"@ndla/types-taxonomy": "npm:^1.0.54"
"@types/compression": "npm:^1.8.1"
Expand Down
Loading