# \#rhai

**URL:** https://community.apollographql.com/tag/rhai/49.md

[Latest](https://community.apollographql.com/latest.md) · [Categories](https://community.apollographql.com/categories.md) · [Tags](https://community.apollographql.com/tags.md)

---

## [Problems with ETags - Apollo router strips Etag](https://community.apollographql.com/t/problems-with-etags-apollo-router-strips-etag/8552)

<div class="topic-metadata">

**Author:** [@Jensileus](https://community.apollographql.com/u/Jensileus)\
**Replies:** 3\
**Last updated:** [February 19, 2025, 3:31pm UTC](https://community.apollographql.com/t/problems-with-etags-apollo-router-strips-etag/8552 "2025-02-19T15:31:37Z")

</div>

Here is a query directly to my microservice: \`xx@xx:~$ curl -i -X POST -H “Content-Type: application/json” -H “X-User-Id: 4” -d ‘{ “query”: “query { hasUserPhoto }” }’ http://localhost:5017/graphql HTTP/1.1 200…

---

## [Rhai Scripting - URL in headers](https://community.apollographql.com/t/rhai-scripting-url-in-headers/7004)

<div class="topic-metadata">

**Author:** [@Jessie\_Fanella](https://community.apollographql.com/u/Jessie_Fanella)\
**Replies:** 0\
**Last updated:** [November 30, 2023, 4:19pm UTC](https://community.apollographql.com/t/rhai-scripting-url-in-headers/7004 "2023-11-30T16:19:13Z")

</div>

Hello, I am trying to set headers in a Rhai script. However, the headers are url’s. When I try to run my queries in the playground, I get this error: rhai execution error: 'Runtime error: invalid HTTP header name My co…

---

## [Why failed to set request.body.query in supergraph\_service Rhai script](https://community.apollographql.com/t/why-failed-to-set-request-body-query-in-supergraph-service-rhai-script/7907)

<div class="topic-metadata">

**Author:** [@Yongho\_Jung](https://community.apollographql.com/u/Yongho_Jung)\
**Replies:** 0\
**Last updated:** [October 23, 2024, 8:02am UTC](https://community.apollographql.com/t/why-failed-to-set-request-body-query-in-supergraph-service-rhai-script/7907 "2024-10-23T08:02:28Z")

</div>

according to rhai API document. (https://www.apollographql.com/docs/graphos/reference/router/rhai#requestbodyquery) ‘request.body.query’ is modifiable in rhai supergraph\_service function. so, I modified ‘request.body.q…

---

## [How to create plugin for Apollo server in Rust without async functoins and Rhai](https://community.apollographql.com/t/how-to-create-plugin-for-apollo-server-in-rust-without-async-functoins-and-rhai/5987)

<div class="topic-metadata">

**Author:** [@yuhnonik1](https://community.apollographql.com/u/yuhnonik1)\
**Replies:** 0\
**Last updated:** [March 21, 2023, 2:37pm UTC](https://community.apollographql.com/t/how-to-create-plugin-for-apollo-server-in-rust-without-async-functoins-and-rhai/5987 "2023-03-21T14:37:07Z")

</div>

Hello dear forum users. I need to create a plugin for my Apollo graphql server. This plugin will be compiled to a wasm file later, so I can’t use async functions and Rhai. Only Rust. How can I do it? And is it possible? …

---

## [Format logs of Apollo Router](https://community.apollographql.com/t/format-logs-of-apollo-router/7958)

<div class="topic-metadata">

**Author:** [@Kanika](https://community.apollographql.com/u/Kanika)\
**Replies:** 1\
**Last updated:** [January 28, 2025, 5:34pm UTC](https://community.apollographql.com/t/format-logs-of-apollo-router/7958 "2025-01-28T17:34:17Z")

</div>

Hi all, We use GraphQL Federation 2.0 and have a Self Hosted Supergraph-Subgraph setup. For observability purposes, we would like to format the logs of Router. We have tried with adding post processor RHAI script but …

---

## [Stringify in rhai](https://community.apollographql.com/t/stringify-in-rhai/5912)

<div class="topic-metadata">

**Author:** [@waqasraz](https://community.apollographql.com/u/waqasraz)\
**Replies:** 2\
**Last updated:** [March 9, 2023, 8:18pm UTC](https://community.apollographql.com/t/stringify-in-rhai/5912 "2023-03-09T20:18:33Z")

</div>

How do I convert an object to a string for the header? rhai script for router. let subGraphHeaders = #{ loginName: loginName, isPrimary: sPrimary }; request.subgraph.headers\["user"\] = json::stringify(…

---

## [Passing environment variable from Apollo Router to Rhai Script](https://community.apollographql.com/t/passing-environment-variable-from-apollo-router-to-rhai-script/5726)

<div class="topic-metadata">

**Author:** [@taingk](https://community.apollographql.com/u/taingk)\
**Replies:** 1\
**Last updated:** [February 17, 2023, 4:45pm UTC](https://community.apollographql.com/t/passing-environment-variable-from-apollo-router-to-rhai-script/5726 "2023-02-17T16:45:32Z")

</div>

Hello all, I am currently migrating from Apollo Gateway to Apollo Router and I need to re-develop all the plugins we made in typescript to rhai script. The challenge is interesting and I managed to do most of the work …

---

## [How do I get multiple headers with the same name in router rhai script?](https://community.apollographql.com/t/how-do-i-get-multiple-headers-with-the-same-name-in-router-rhai-script/5652)

<div class="topic-metadata">

**Author:** [@Dulguun\_Otgon](https://community.apollographql.com/u/Dulguun_Otgon)\
**Replies:** 2\
**Last updated:** [February 8, 2023, 5:32am UTC](https://community.apollographql.com/t/how-do-i-get-multiple-headers-with-the-same-name-in-router-rhai-script/5652 "2023-02-08T05:32:05Z")

</div>

I tried response.headers\["set-cookie"\] but it only returns one value. It seems to be calling http::header::map::HeaderMap::get. How do I make it call http::header::map::HeaderMap::get\_all? Full code: fn subgraph\_servic…
