Eventjet GraphQL API documentation

createTagAndTagSubject

Creates a tag and attaches it to a subject in one step.

This is the shortcut for what createTag followed by tag does: name the tag and name the subject, and both the tag and the attachment are taken care of. createTag only creates the tag and hands back its Tag.id, leaving the attachment to a separate call, and it needs an explicit TagType, whereas here the kind follows from the subject.

If your company already owns a tag of that kind with the given name, that tag is attached instead of a second one being created, so repeating the call with the same name does not multiply tags. The subject is identified by the subjectId input field, the same subject identifier tag and untag accept. Only TicketType subjects can be tagged, matching the single TagType.TICKET_TYPE value.

Authorization is required, and the tag is owned by the company currently selected for the authenticated user. A subject identifier that is not a ticket type identifier, a ticket type that does not exist, an empty name, or a request made while no company is selected each respond with an error. On success CreateTagAndTagSubjectPayload.tag carries the created or reused tag and CreateTagAndTagSubjectPayload.subject carries the subject, whose TagSubject.tags now include it.

mutation CreateTagAndTagSubject($name: String!, $subjectId: String!) {
  createTagAndTagSubject(input: {name: $name, subjectId: $subjectId}) {
    tag {
      id
      name
    }
    subject {
      id
      tags {
        id
        name
      }
    }
  }
}
mutation CreateTagAndTagSubject($name: String!, $subjectId: String!) {
  createTagAndTagSubject(input: {name: $name, subjectId: $subjectId}) {
    tag {
      id
      name
    }
    subject {
      id
      tags {
        id
        name
      }
    }
  }
}

Arguments

ArgumentDescriptionType
inputCreateTagAndTagSubjectInput!

Type

This field resolves to CreateTagAndTagSubjectPayload, which has the following fields:

FieldDescriptionType
subjectTagSubject
tagTag