@ardatan/relay-compiler 12.1.2 → 12.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,7 @@
15
15
  const IRTransformer = require('../core/IRTransformer');
16
16
 
17
17
  import type CompilerContext from '../core/CompilerContext';
18
+ const IMap = require('immutable').Map;
18
19
  const partitionArray = require('../util/partitionArray');
19
20
  const getIdentifierForSelection = require('../core/getIdentifierForSelection');
20
21
  const invariant = require('invariant');
@@ -30,7 +31,7 @@ import type {Fragment, Node, Root, SplitOperation, Selection} from '../core/IR';
30
31
  * etc).
31
32
  */
32
33
  // $FlowFixMe[value-as-type]
33
- type SelectionMap = Map<string, ?SelectionMap>;
34
+ type SelectionMap = IMap<string, ?SelectionMap>;
34
35
 
35
36
  /**
36
37
  * A transform that removes redundant fields and fragment spreads. Redundancy is
@@ -138,7 +139,7 @@ function visitNode<T: Fragment | Root | SplitOperation>(node: T): ?T {
138
139
  cache = new Map();
139
140
  // $FlowFixMe[incompatible-use]
140
141
  const context: CompilerContext = this.getContext();
141
- return transformNode(context.getSchema(), node, new Map()).node;
142
+ return transformNode(context.getSchema(), node, new IMap()).node;
142
143
  }
143
144
 
144
145
  /**
@@ -196,7 +197,7 @@ function transformNode<T: Node>(
196
197
  const transformed = transformNode(
197
198
  schema,
198
199
  selection,
199
- selectionMap.get(identifier) || new Map(),
200
+ selectionMap.get(identifier) || new IMap(),
200
201
  );
201
202
  if (transformed.node) {
202
203
  selections.push(transformed.node);