Use custom emoji with GraphQL
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
To use custom emoji in comments and descriptions, you can add them to a top-level group by using the GraphQL API.
Create a custom emoji
mutation CreateCustomEmoji($groupPath: ID!) {
createCustomEmoji(input: {groupPath: $groupPath, name: "party-parrot", url: "https://cultofthepartyparrot.com/parrots/hd/parrot.gif"}) {
clientMutationId
customEmoji {
name
}
errors
}
}
After you add a custom emoji to the group, members can use it in the same way as other emoji in the comments.
Attributes
The query accepts these attributes:
Attribute | Type | Required | Description |
---|---|---|---|
group_path | integer/string | Yes | ID or URL-encoded path of the top-level group. |
name | string | Yes | Name of the custom emoji. |
file | string | Yes | URL of the custom emoji image. |
Use GraphiQL
You can use GraphiQL to query the emoji for a group.
Open GraphiQL:
- For GitLab.com, use:
https://gitlab.com/-/graphql-explorer
- For GitLab Self-Managed, use:
https://gitlab.example.com/-/graphql-explorer
- For GitLab.com, use:
Copy the following text and paste it in the left window. In this query,
gitlab-org
is the group path.query GetCustomEmoji { group(fullPath: "gitlab-org") { id customEmoji { nodes { name, url } } } }
Select Play.
Related topics
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support