New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fragments on unions and interfaces #70
Comments
As far as I can understand both cache implementations use InMemory as a base class, so the fragment matcher logic is untouched. Maybe we could pass the fragmentMatcher with the constructor argument? |
We're doing this via #62 by passing in a set of links and cache |
(the link(s) depend on a cache implementation, and it should be a singleton afaik) |
Allows the usage of: - Custom link - Custom cache - Custom cache options Fixes awslabs#3 Fixes awslabs#21 Fixes awslabs#24 Fixes awslabs#36 Fixes awslabs#52 Fixes awslabs#70 Fixes awslabs#87 Closes awslabs#62
Once PR #96 gets merged, it should be possible to pass custom cache options to the AWS AppSync client like this: import AWSAppSyncClient from "aws-appsync";
const client = new AWSAppSyncClient({
url: appSyncConfig.graphqlEndpoint,
region: appSyncConfig.region,
auth: {
type: appSyncConfig.authenticationType,
apiKey: appSyncConfig.apiKey
},
cacheOptions: {
dataIdFromObject: obj => obj.__typename && obj.id && `MyPrefix:${obj.__typename}:${obj.id}`
}
}); |
* Use custom link cache and cache options Allows the usage of: - Custom link - Custom cache - Custom cache options Fixes #3 Fixes #21 Fixes #24 Fixes #36 Fixes #52 Fixes #70 Fixes #87 Closes #62 * Pass store to OfflineLink when using createAppSyncLink * Fix eslint rules violations * Fix typo. Address CR comment.
There is no way to use union type or interfaces with the current client implementation as apollo requires an instance of
IntrospectionFragmentMatcher
passed into theInMemoryCache
and there is no way to hook into the instantiation of the client at the moment.First, I assumed that #3 might be the way to go. Yet it's not about additional links, we actually need to provide the fragmentMatcher for InMemoryCache here:
aws-mobile-appsync-sdk-js/packages/aws-appsync/src/client.js
Line 100 in 87c52f4
The text was updated successfully, but these errors were encountered: