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

Commit 5941ee4

Browse files
authored
Merge pull request #159 from renanmav/fix/enum-import-order
Fix enum import order
2 parents ce7cdba + c431c28 commit 5941ee4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/TypeScriptGenerator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,8 @@ function createVisitor(
542542
}
543543

544544
return [
545-
...getEnumDefinitions(schema, state),
546545
importTypes(Array.from(state.runtimeImports).sort(), "relay-runtime"),
546+
...getEnumDefinitions(schema, state),
547547
exportType(node.name, type),
548548
exportType(dataTypeName, dataType),
549549
exportType(

test/__snapshots__/TypeScriptGenerator-test.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -918,8 +918,8 @@ export type CommentCreateMutation = {
918918
919919
920920
// FriendFragment.graphql
921-
export type TestEnums = "mark" | "zuck" | "%future added value";
922921
import { FragmentRefs } from "relay-runtime";
922+
export type TestEnums = "mark" | "zuck" | "%future added value";
923923
export type FriendFragment = {
924924
readonly name: string | null;
925925
readonly lastName: string | null;
@@ -1677,8 +1677,8 @@ fragment ScalarField on User {
16771677
16781678
~~~~~~~~~~ OUTPUT ~~~~~~~~~~
16791679
// ScalarField.graphql
1680-
export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value";
16811680
import { FragmentRefs } from "relay-runtime";
1681+
export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value";
16821682
export type ScalarField = {
16831683
readonly id: string;
16841684
readonly name: string | null;
@@ -3004,8 +3004,8 @@ export type CommentCreateMutation = {
30043004
30053005
30063006
// FriendFragment.graphql
3007-
export type TestEnums = "mark" | "zuck" | "%future added value";
30083007
import { FragmentRefs } from "relay-runtime";
3008+
export type TestEnums = "mark" | "zuck" | "%future added value";
30093009
export type FriendFragment = {
30103010
readonly name: string | null;
30113011
readonly lastName: string | null;
@@ -3762,8 +3762,8 @@ fragment ScalarField on User {
37623762
37633763
~~~~~~~~~~ OUTPUT ~~~~~~~~~~
37643764
// ScalarField.graphql
3765-
export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value";
37663765
import { FragmentRefs } from "relay-runtime";
3766+
export type PersonalityTraits = "CHEERFUL" | "DERISIVE" | "HELPFUL" | "SNARKY" | "%future added value";
37673767
export type ScalarField = {
37683768
readonly id: string;
37693769
readonly name: string | null;

0 commit comments

Comments
 (0)