Please help, I want to know how to pass more than one tag in the below image:
When I type a comma after hypi id, the whole json will become invalid.
type Post{
tags: [HashTag!]
}
type HashTag {
name: String!
}
In Post, I’m using the array for tags. Please suggest the correct way to do this. (Put multiple hashtags in the tag field of Post).
Query:
mutation
CreatePost(
$description: String
$userId: ID!,
$tags : HashTagInputOpt
) {
upsert(
values: {
Post: [
{
description: $description
title: "new"
createdBy: { user: { hypi: { id: $userId } } }
tags:[
$tags
]
}
]
}
) {
id
}
}
Json:
{
"description": "New #hashtag #testing ",
"userId": "01ERYFDZJ7ZXKP4R4ZV6G1TZQH",
"tags": [
{
"hypi":{"id":"hashtag"},
"name" : "hashtag"
},
{
"hypi":{"id":"testing"},
"name" : "testing"
}
]
}