relay-compiler-language-typescript
relay-compiler-language-typescript copied to clipboard
Duplicate imports of relay-runtime
Check this
import { ConcreteRequest } from "relay-runtime";
import { FragmentRefs } from "relay-runtime";
export type HomeRootIssuesQueryVariables = {
owner: string;
name: string;
};
export type HomeRootIssuesQueryResponse = {
readonly repository: {
readonly " $fragmentRefs": FragmentRefs<"Issues_repository">;
} | null;
};
export type HomeRootIssuesQuery = {
readonly response: HomeRootIssuesQueryResponse;
readonly variables: HomeRootIssuesQueryVariables;
};
It would be nice if these two imports
import { ConcreteRequest } from "relay-runtime";
import { FragmentRefs } from "relay-runtime";
were just one
import { ConcreteRequest, FragmentRefs } from "relay-runtime";
this is actually more than superficial; in my case it's causing typescript compiler errors because enums are exported before the 2nd relay-runtime import which causes Line 5:1: Import in body of module; reorder to top import/first"
Could you give more details with snippets or a repro?
I have the same problem with @chrisdostert. It seems to be happening when using Enum.
import { ReaderFragment } from "relay-runtime";
export type HogeTypeEnum = "foo" | "bar" | "%future added value";
// Line 5:1: Import in body of module; reorder to top import/first
import { FragmentRefs } from "relay-runtime";
export type Hoge_query = {
readonly hoge: {
readonly type: HogeTypeEnum;
...
}
}
Okay, I'll tackle this today
@renanmav can we close this ticket now?
Well, not yet. ReaderFragment isn’t being aggregated on #160. I’ll investigate further soon.