Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.

Commit b3ba387

Browse files
authored
Merge pull request #161 from martinandert/support-validate
Support relay-compiler --validate
2 parents 52465ed + 82b7550 commit b3ba387

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/formatGeneratedModule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const formatterFactory = (
2323
nodeStatement = addAnyTypeCast(nodeStatement).trim();
2424
}
2525
return `/* tslint:disable */
26-
26+
${hash ? `/* ${hash} */\n` : ""}
2727
${documentTypeImport}
2828
${typeText || ""}
2929

test/fixtures/generated-module/complete-example.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* tslint:disable */
2+
/* @relayHash abcde */
23

34
import { ConcreteFragment } from "relay-runtime";
45
export type CompleteExample = { readonly id: string }

test/formatGeneratedModule-test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe("formatGeneratedModule", () => {
4545
docText: null,
4646
concreteText: JSON.stringify({ the: { fragment: { data: 42 } } }),
4747
typeText: "export type CompleteExample = { readonly id: string }",
48-
hash: "abcde",
48+
hash: "@relayHash abcde",
4949
relayRuntimeModule: "relay-runtime",
5050
sourceHash: "edcba"
5151
})
@@ -63,7 +63,7 @@ describe("formatGeneratedModule", () => {
6363
docText: null,
6464
concreteText: JSON.stringify({ the: { fragment: { data: 42 } } }),
6565
typeText: "export type CompleteExample = { readonly id: string }",
66-
hash: "abcde",
66+
hash: "@relayHash abcde",
6767
sourceHash: "edcba"
6868
})
6969
).toMatchFile(
@@ -80,7 +80,7 @@ describe("formatGeneratedModule", () => {
8080
docText: null,
8181
concreteText: JSON.stringify({ the: { fragment: { data: 42 } } }),
8282
typeText: "export type CompleteExample = { readonly id: string }",
83-
hash: "abcde",
83+
hash: null,
8484
sourceHash: "edcba"
8585
})
8686
).toMatchFile(

0 commit comments

Comments
 (0)