Skip to content
This repository was archived by the owner on Jun 29, 2021. It is now read-only.

Commit 7f42407

Browse files
Apply suggestions from code review
Co-authored-by: Alexandre Côté <[email protected]>
1 parent 5439516 commit 7f42407

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

packages/graphql-mini-transforms/src/webpack.ts

+3-12
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@ import {parse, DocumentNode} from 'graphql';
55
import {getOptions} from 'loader-utils';
66
import validateOptions from 'schema-utils';
77

8-
import {
9-
cleanDocument,
10-
extractImports,
11-
toSimpleDocument,
12-
CleanDocumentOptions,
13-
} from './document';
8+
import {cleanDocument, extractImports, toSimpleDocument} from './document';
149

1510
interface Options {
1611
generateId?: (normalizedSource: string) => string;
@@ -36,7 +31,7 @@ export default async function graphQLLoader(
3631
this.cacheable();
3732

3833
const done = this.async();
39-
const options = {simple: false, ...getOptions(this)} as Options;
34+
const options: Options = {simple: false, ...getOptions(this)};
4035

4136
validateOptions(schema, options, {name: '@shopify/graphql-mini-transforms'});
4237

@@ -46,14 +41,10 @@ export default async function graphQLLoader(
4641
);
4742
}
4843

49-
const cleanDocumentOptions = {
50-
generateId: options.generateId,
51-
} as CleanDocumentOptions;
52-
5344
try {
5445
const document = cleanDocument(
5546
await loadDocument(source, this.context, this),
56-
cleanDocumentOptions,
47+
{generateId: options.generateId},
5748
);
5849
const exported = options.simple ? toSimpleDocument(document) : document;
5950

0 commit comments

Comments
 (0)