How to use a variable with a language tag in a function?

I don’t think you can treat value variables as predicate names in GraphQL±.

One way you can do what you want from the client-side libraries is to use the GraphQL variables for string substitution within the query.