-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEP Update code to work with new dependencies
Upgrading webpack necessitated upgrading most dependencies, so there are changes needed in the code, too. Also remove the browser warning which is just super out of date at this stage anyway.
- Loading branch information
1 parent
ad9a407
commit 7d90c21
Showing
50 changed files
with
381 additions
and
375 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,16 +1,20 @@ | ||
import { InMemoryCache, IntrospectionFragmentMatcher } from 'apollo-cache-inmemory'; | ||
import { InMemoryCache } from '@apollo/client/cache'; | ||
import dataIdFromObject from './dataIdFromObject'; | ||
|
||
const buildCache = (introspectionQueryResultData) => ( | ||
new InMemoryCache({ | ||
fragmentMatcher: introspectionQueryResultData | ||
? new IntrospectionFragmentMatcher({ | ||
introspectionQueryResultData, | ||
}) | ||
: null, | ||
const buildCache = (introspectionQueryResultData) => { | ||
const possibleTypes = {}; | ||
if (introspectionQueryResultData) { | ||
introspectionQueryResultData.__schema.types.forEach(supertype => { | ||
if (supertype.possibleTypes) { | ||
possibleTypes[supertype.name] = supertype.possibleTypes.map(subtype => subtype.name); | ||
} | ||
}); | ||
} | ||
return new InMemoryCache({ | ||
possibleTypes, | ||
dataIdFromObject, | ||
addTypename: true, | ||
}) | ||
); | ||
}); | ||
}; | ||
|
||
export default buildCache; |
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
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.