Giving permission to all the tags

If we use 5 tags in a post, then how do I give permission to all the tags, so that any user can type and search the tag?

There are several options:

  1. Create permission the same way you create a Permission for Bar and grant all users access to the find or get methods.
  2. Add a trigger that creates permission for you. Same as above but you make one request and the trigger will call the GQL upsert function to create the Permission. Triggers are documented here https://docs.hypi.app/references/triggers

actually i don’t know how to write trigger for this …can u please help me in this.

Can you share the GraphQL definition of your Tag type.
Are you creating tags directly with an upsert or as a field of your Post type referred to here?

mutation {
upsert(
values: {
Post: [
{
description: “HI, i m #testing #the #hashtag functionality”
title:“new”
createdBy:{hypi: {id: “01ET7WT9R2J938596Y3EEVQWGN”}}
tags: [
{
“hypi”:{“id”:“testing”},
“name” : “testing”
},
{
“hypi”:{“id”:“the”},
“name” : “the”
}
]
}
]
}
) {
id
}
}

can you use three ` to format your code.

I was asking to see the schema definitions for the types so I can see the fields and relationships.
I can see that you’re creating tags as part of the post. So you will need to write the trigger to accept the post.

I will create a sample app to demonstrate how to do this and get back to you with working code examples.

type HashTag  {
  name: String!
}

i m creating tags With Post… like this…

mutation {
upsert(
values: {
Post: [
{
description: “HI, i m #testing #the #hashtag functionality”
title:“new”
createdBy:{hypi: {id: “01ET7WT9R2J938596Y3EEVQWGN”}}
tags: [
{
“hypi”:{“id”:“testing”},
“name” : “testing”
},
{
“hypi”:{“id”:“the”},
“name” : “the”
}
]
}
]
}
) {
id
}
}

please provide a solution