How to add a custom response header? #7445
-
How can I add a custom response header that returns the total number of rows from the database that match the query? So if 10 rows came back from a query, I'd want a response header that says: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
To get the total number of rows you can use the aggregate queries from Hasura. But it is not possible to add a header to the response. |
Beta Was this translation helpful? Give feedback.
-
+1 to adding custom response headers. In my case it's adding security headers like the ones assessed on securityheaders.com |
Beta Was this translation helpful? Give feedback.
To get the total number of rows you can use the aggregate queries from Hasura.
https://hasura.io/docs/latest/graphql/core/databases/postgres/queries/aggregation-queries.html
But it is not possible to add a header to the response.