Skip to content

Commit

Permalink
quick fix to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kennetpostigo committed Jan 30, 2016
1 parent 4e2dc10 commit ebb619e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,41 @@ npm install --save react-reach

react-reach makes fetching data from a GraphQL server as easy as this:
```js
//.reachGraphQL() to make a query for some data, or add mutation
//reachGraphQL() to make a query for some data, or add mutation
//I created this function with for simply communicating back and forth with graphQL
//params: reachGraphQL(url, query/mutation, queryParameters)

import { reachGraphQL } from 'react-reach';

reachGraphQL('localhost:1000', `{
user(id: "1") {
name
}
}`, {});


//.reachWithDispatch() to make a query and dispatch actionCreator passed in
//reachWithDispatch() to make a query and dispatch actionCreator passed in
//I created this function for receiving data from the server and automatically caching it in the redux store.
//To be used with redux-thunk or any similar middleware.
//params: reachWithDispatch(url, query/mutation, queryParameters, actionCreator)

import { reachWithDispatch } from 'react-reach';

reachWithDispatch('localhost:1000', `{
user(id: "1") {
name
}
}`, {}, somePredefinedActionCreator);


//.reachWithOpts() to make a query and dispatch specified actionCreators from an Object passed in
//reachWithOpts() to make a query and dispatch specified actionCreators from an Object passed in
//I created this function for sending data to the server and optimistically updating the redux store client-side
//To be used with redux-thunk or any similar middleware.
//params: reachWithDispatch(url, query/mutation, queryParameters, actionCreator, store, retry)
//Automatically handles updating redux store client-side
//This function is still a WIP not implemented

import { reachWithOpts } from 'react-reach';

reachWithOpts('localhost:1000', `mutation {
CreateUser {
Expand Down

0 comments on commit ebb619e

Please sign in to comment.