Skip to content

Commit

Permalink
Remove redundant this.transformDocument calls from InMemoryCache.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamn committed Jan 17, 2019
1 parent 801a490 commit d92fc1c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/apollo-cache-inmemory/src/inMemoryCache.ts
Expand Up @@ -336,9 +336,7 @@ export class InMemoryCache extends ApolloCache<NormalizedCacheObject> {
optimistic: boolean = false,
): FragmentType | null {
return this.read({
query: this.transformDocument(
getFragmentQueryDocument(options.fragment, options.fragmentName),
),
query: getFragmentQueryDocument(options.fragment, options.fragmentName),
variables: options.variables,
rootId: options.id,
optimistic,
Expand All @@ -351,7 +349,7 @@ export class InMemoryCache extends ApolloCache<NormalizedCacheObject> {
this.write({
dataId: 'ROOT_QUERY',
result: options.data,
query: this.transformDocument(options.query),
query: options.query,
variables: options.variables,
});
}
Expand All @@ -362,9 +360,7 @@ export class InMemoryCache extends ApolloCache<NormalizedCacheObject> {
this.write({
dataId: options.id,
result: options.data,
query: this.transformDocument(
getFragmentQueryDocument(options.fragment, options.fragmentName),
),
query: getFragmentQueryDocument(options.fragment, options.fragmentName),
variables: options.variables,
});
}
Expand Down

0 comments on commit d92fc1c

Please sign in to comment.