Replies: 1 comment
-
Sorry for the late response mate, been busy with Rematch, my actual job etc. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to get per request i18n for a GraphQL api, and I'm hoping for a sanity check.
Apollo Server let's you make a custom context object per request. I'm wanting to create an i18n object per request and pass it in like this (assuming it has some locale attached like what express-request-language provides).
That context object (and it's i18n property) is then available to all the resolvers involved in that request, dependency injection style.
I want lingui to be able to extract the strings I'm using in the resolvers but it seems that the
t
macro refers to a global object, so I thinkdefineMessage
gives me what I'm looking for.Is this the best way to achieve what I'm after?
Beta Was this translation helpful? Give feedback.
All reactions