# Performing a GraphQL query inside the htmlSerializer

**URL:** https://community.prismic.io/t/performing-a-graphql-query-inside-the-htmlserializer/6697
**Category:** Developing with Prismic
**Tags:** gatsby
**Created:** [August 20, 2021, 4:43pm UTC](https://community.prismic.io/t/performing-a-graphql-query-inside-the-htmlserializer/6697 "2021-08-20T16:43:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tudor2004](https://avatars.discourse-cdn.com/v4/letter/t/6de8d8/32.png) [@tudor2004](https://community.prismic.io/u/tudor2004)
#### Post date: [August 20, 2021, 4:43pm UTC](https://community.prismic.io/t/performing-a-graphql-query-inside-the-htmlserializer/6697/1 "2021-08-20T16:43:57Z")

</div>

For my website I would like to replace in all rich text contents some abbreviations with a `<span class="abbrevation">%abbrevation%</span>` structure.

For this I was thinking of using the `htmlSerializer` function.

The problem is now that the list of abbreviations is pretty big (about 200) and needs to also be maintained on prismic, in a designated content type.

How can I perform a GraphQL query inside the htmlSerializer function also with thinking about performance and build speed.

---

<div class="post-metadata">

### Author: ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)
#### Post date: [August 26, 2021, 1:15pm UTC](https://community.prismic.io/t/performing-a-graphql-query-inside-the-htmlserializer/6697/5 "2021-08-26T13:15:30Z")

</div>

Hi Tudor,

Unfortunately, it's not possible to do queries inside the HTMLSerializer as it is never called as an async function.

Thanks.

---

<div class="post-metadata">

### Author: ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)
#### Post date: [September 2, 2021, 4:22pm UTC](https://community.prismic.io/t/performing-a-graphql-query-inside-the-htmlserializer/6697/6 "2021-09-02T16:22:54Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

### Author: ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)
#### Post date: [December 9, 2021, 5:24pm UTC](https://community.prismic.io/t/performing-a-graphql-query-inside-the-htmlserializer/6697/7 "2021-12-09T17:24:29Z")

</div>


