Home Provide Data from GraphQL to Redux
Reply: 0

Provide Data from GraphQL to Redux

user815
1#
user815 Published in July 18, 2018, 10:29 pm

I have project, where I use redux, react-apollo and I wonder, is any chance to provide data from react-apollo to redux through reducer. Pseudo code below.

...
import { graphql } from 'react-apollo'
import gql from 'graphql-tag'

const query = gql`
{
  ...
}`

/* Function, which I want to returns data from graphql */
const getDate = () => {
  return graphql(query)
}


/*---- Reducer ----*/
export default (state = getDate(), action) => {
  console.log(state) // function, instead data
  ...
}

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.309983 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO