Guest User

Untitled

a guest
Oct 11th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. import {Cmd} from 'redux-loop';
  2.  
  3. import successActions from './success-actions';
  4. import {failNetworkRequest} from './actions';
  5. import type {Operation} from './graphql/types.flow';
  6. import graphqlOperation from './graphql/operation';
  7.  
  8. export const executeGraphqlOperation = ({
  9. query,
  10. success,
  11. variables,
  12. operationName,
  13. context,
  14. extensions
  15. }: Operation) =>
  16. Cmd.run(graphqlOperation, {
  17. args: [
  18. {
  19. query,
  20. variables,
  21. operationName,
  22. context,
  23. extensions
  24. }
  25. ],
  26. successActionCreator: successActions[success],
  27. failActionCreator: failNetworkRequest
  28. });
Add Comment
Please, Sign In to add comment