I want to know how to pass more than one tag

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"
    }
  ]
}

Yes, you should be able to put multiple tags into this array field.

Your query was wrong. You did not declare tags as an array and you tried to put an array inside an array.

mutation CreatePost(
  $description: String
  $userId: ID!
  $tags: [HashTagInputOpt!]!
) {
  upsert(
    values: {
      Post: [
        {
          description: $description
          title: "new"
          createdBy: { user: { hypi: { id: $userId } } }
          tags: $tags
        }
      ]
    }
  ) {
    id
  }
}

Look at the tags variable that I changed to $tags: [HashTagInputOpt!]! And instead of tags: [$tags] it’s just tags: $tags

What you had was really [[HashTag]] not [HashTag]