-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add additional content to third-party API (#1206)
* Add getDocuments query * Remove print * Add print back * Add InternalNews to API * Add LandingPage articles to API * Add tests * Update test data * fix bug in developing locally with test jwt issuer service * Update name of query * Update schema and tests --------- Co-authored-by: Abigail Young <abbyoung@gmail.com>
- Loading branch information
Showing
9 changed files
with
529 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { gql } from 'graphql-tag' | ||
|
||
export const GET_DOCUMENTS = gql` | ||
query getDocuments { | ||
documents { | ||
id | ||
title | ||
description | ||
file { | ||
filename | ||
filesize | ||
url | ||
} | ||
} | ||
} | ||
` |
30 changes: 30 additions & 0 deletions
30
src/pages/api/thirdparty/operations/getLandingPageArticles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { gql } from 'graphql-tag' | ||
|
||
export const GET_LANDING_PAGE_ARTICLES = gql` | ||
query GetLandingPageArticles($publishedDate: DateTime) { | ||
articles( | ||
where: { | ||
status: { equals: Published } | ||
publishedDate: { lte: $publishedDate } | ||
category: { equals: LandingPage } | ||
} | ||
orderBy: [{ publishedDate: desc }] | ||
) { | ||
id | ||
title | ||
preview | ||
publishedDate | ||
labels { | ||
id | ||
name | ||
type | ||
} | ||
body { | ||
document | ||
} | ||
tags { | ||
name | ||
} | ||
} | ||
} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { gql } from 'graphql-tag' | ||
|
||
export const GET_NEWS_ARTICLES = gql` | ||
query GetNewsArticles($publishedDate: DateTime) { | ||
articles( | ||
where: { | ||
status: { equals: Published } | ||
publishedDate: { lte: $publishedDate } | ||
category: { equals: InternalNews } | ||
} | ||
orderBy: [{ publishedDate: desc }] | ||
) { | ||
id | ||
title | ||
preview | ||
publishedDate | ||
labels { | ||
id | ||
name | ||
type | ||
} | ||
body { | ||
document | ||
} | ||
tags { | ||
name | ||
} | ||
} | ||
} | ||
` |
Oops, something went wrong.