Closed jacqui closed 3 years ago
Related to https://github.com/news-catalyst/google-app-scripts/issues/153
Issue #61
This adds 2 new mutations to articles in the API: publishArticle sets article.published to true while updating the publishedOn date(s) and unpublishArticle sets article.published to false.
publishArticle
unpublishArticle
To test:
Use this deployed testing API: https://d3ahlfgcyw174q.cloudfront.net/graphql and token: 9178c7f1e6bac26195f2f6e1460450c2adcb24cc97b5085a
9178c7f1e6bac26195f2f6e1460450c2adcb24cc97b5085a
List articles with the following query and note the value of published.
query ListArticles($where: ArticleListWhere) { articles { listArticles(where: $where) { data { id parent version latestVersion published slug headline { values { value locale } } } } } }
{ "where": { "slug": "test-pub-dates-pub-true-2" } }
mutation PublishArticle($revision: ID!) { articles { publishArticle(revision: $revision) { error { code message data } data { id slug parent version latestVersion published firstPublishedOn lastPublishedOn } } } }
mutation UnpublishArticle($revision: ID!) { articles { unpublishArticle(revision: $revision) { error { code message data } data { id slug parent version latestVersion published firstPublishedOn lastPublishedOn } } } }
{ "revision": "5ff5155d2be98800082c321c" }
Related to https://github.com/news-catalyst/google-app-scripts/issues/153
Issue #61
This adds 2 new mutations to articles in the API:
publishArticle
sets article.published to true while updating the publishedOn date(s) andunpublishArticle
sets article.published to false.To test:
Use this deployed testing API: https://d3ahlfgcyw174q.cloudfront.net/graphql and token:
9178c7f1e6bac26195f2f6e1460450c2adcb24cc97b5085a
List articles with the following query and note the value of published.