-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔥 Remove depricated react-apollo and replace with @apollo/client
- add graphql and graphql-tag deps
- Loading branch information
Matti Salokangas
committed
Oct 2, 2020
1 parent
ddddb08
commit 0d8d57f
Showing
7 changed files
with
133 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
import { ApolloClient } from "react-apollo"; | ||
import { ApolloClient, InMemoryCache } from '@apollo/client'; | ||
import { config } from "config"; | ||
|
||
const { API_URI } = config; | ||
|
||
export default new ApolloClient({ | ||
dataIdFromObject: result => { | ||
if (result.id && result.__typename) { | ||
return result.__typename + result.id; | ||
} | ||
return null; | ||
} | ||
uri: API_URI, | ||
cache: new InMemoryCache() | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { combineReducers } from "redux"; | ||
|
||
import { reducer as appReducer } from "modules/app"; | ||
import apolloClient from "./apolloClient"; | ||
|
||
export default combineReducers({ | ||
app: appReducer, | ||
apollo: apolloClient.reducer() | ||
app: appReducer | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// eslint-disable-next-line no-process-env | ||
const { API_URI } = process.env; | ||
|
||
export const config = { | ||
API_URI | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.