Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Commit

Permalink
fix(mail): not receiving updates in realtime
Browse files Browse the repository at this point in the history
close #683
  • Loading branch information
batamar committed Dec 23, 2019
1 parent 6c5e015 commit 2e4a382
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/apolloClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,24 @@ if (NODE_ENV !== 'production') {
};
}

const generateDataSources = () => {
return {
EngagesAPI: new EngagesAPI(),
IntegrationsAPI: new IntegrationsAPI(),
};
};

const apolloServer = new ApolloServer({
typeDefs,
resolvers,
dataSources: () => {
return {
EngagesAPI: new EngagesAPI(),
IntegrationsAPI: new IntegrationsAPI(),
};
},
dataSources: generateDataSources,
playground,
uploads: false,
context: ({ req, res }) => {
if (!req || NODE_ENV === 'test') {
return {};
return {
dataSources: generateDataSources(),
};
}

const user = req.user;
Expand Down

0 comments on commit 2e4a382

Please sign in to comment.