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

Duplicate imports of relay-runtime #158

Open
renanmav opened this issue Nov 10, 2019 · 6 comments
Open

Duplicate imports of relay-runtime #158

renanmav opened this issue Nov 10, 2019 · 6 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@renanmav
Copy link
Contributor

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";
@renanmav renanmav added the enhancement New feature or request label Nov 10, 2019
@renanmav renanmav self-assigned this Nov 10, 2019
@chrisdostert
Copy link
Contributor

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"

@renanmav
Copy link
Contributor Author

Could you give more details with snippets or a repro?

@h-sakano
Copy link

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;
        ...
    }
}

@renanmav
Copy link
Contributor Author

Okay, I'll tackle this today

@renanmav renanmav added the bug Something isn't working label Nov 21, 2019
This was referenced Nov 21, 2019
@maraisr
Copy link
Member

maraisr commented Dec 10, 2019

@renanmav can we close this ticket now?

@renanmav
Copy link
Contributor Author

Well, not yet. ReaderFragment isn’t being aggregated on #160. I’ll investigate further soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants