Created
May 3, 2020 17:30
-
-
Save iliran11/f9ebccca8dc4299de4ead778fad000a8 to your computer and use it in GitHub Desktop.
final context function - put the t function on the graphql context.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const server = new ApolloServer({ | |
typeDefs, | |
resolvers, | |
context: async ({ req }) => { | |
// now we have the user requeted language | |
const t = await i18Next("es"); | |
return { t }; | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment