Skip to content
This repository has been archived by the owner on Aug 20, 2020. It is now read-only.

Commit

Permalink
Merge pull request #46 from dimitri-koenig/feature/avoid-clonedeep
Browse files Browse the repository at this point in the history
Fix maximum call stack error when using cloneDeep in query transformer #45
  • Loading branch information
Poincare authored Oct 27, 2017
2 parents 78abb15 + 6a4dec4 commit b754a80
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/queryTransformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import {
isFragmentDefinition,
} from './extractFromAST';

import { cloneDeep } from 'lodash';

// TODO Most of this implementation has been copped from here:
// https://github.com/apollostack/apollo-client/blob/master/src/queries/queryTransform.ts
//
Expand Down Expand Up @@ -60,7 +58,7 @@ function addTypenameToSelectionSet(
}

export const addTypenameTransformer: QueryTransformer = (doc: DocumentNode) => {
const docClone = cloneDeep(doc);
const docClone = JSON.parse(JSON.stringify(doc));

docClone.definitions.forEach((definition: DefinitionNode) => {
const isRoot = definition.kind === 'OperationDefinition';
Expand Down

0 comments on commit b754a80

Please sign in to comment.