Skip to content

Instantly share code, notes, and snippets.

@iliran11
Created May 3, 2020 17:30
Show Gist options
  • Save iliran11/f9ebccca8dc4299de4ead778fad000a8 to your computer and use it in GitHub Desktop.
Save iliran11/f9ebccca8dc4299de4ead778fad000a8 to your computer and use it in GitHub Desktop.
final context function - put the t function on the graphql context.
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