mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-28 18:38:17 +00:00
docs(posts): add examples (#7688)
This commit is contained in:
parent
795b185f59
commit
44667ebd54
@ -46,7 +46,77 @@ Here are some examples of Posts displayed on the home page, with one **TEXT** po
|
||||
|
||||
* [createPost](../graphql/mutations.md#createpost)
|
||||
* [listPosts](../graphql/queries.md#listposts)
|
||||
* [deletePosts](../graphql/queries.md#listposts)
|
||||
|
||||
### Examples
|
||||
|
||||
##### Create Post
|
||||
```graphql
|
||||
mutation test {
|
||||
createPost(
|
||||
input: {
|
||||
postType: HOME_PAGE_ANNOUNCEMENT,
|
||||
content: {
|
||||
contentType: TEXT,
|
||||
title: "Planed Upgrade 2023-03-23 20:05 - 2023-03-23 23:05",
|
||||
description: "datahub upgrade to v0.10.1"
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
##### List Post
|
||||
|
||||
```graphql
|
||||
query listPosts($input: ListPostsInput!) {
|
||||
listPosts(input: $input) {
|
||||
start
|
||||
count
|
||||
total
|
||||
posts {
|
||||
urn
|
||||
type
|
||||
postType
|
||||
content {
|
||||
contentType
|
||||
title
|
||||
description
|
||||
link
|
||||
media {
|
||||
type
|
||||
location
|
||||
__typename
|
||||
}
|
||||
__typename
|
||||
}
|
||||
__typename
|
||||
}
|
||||
__typename
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
##### Input for list post
|
||||
```shell
|
||||
{
|
||||
"input": {
|
||||
"start": 0,
|
||||
"count": 10
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
##### Delete Post
|
||||
|
||||
```graphql
|
||||
mutation deletePosting {
|
||||
deletePost (
|
||||
urn: "urn:li:post:61dd86fa-9e76-4924-ad45-3a533671835e"
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
## FAQ and Troubleshooting
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user