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

Enums not generating correctly with Relay 8 #164

Closed
mrtnzlml opened this issue Dec 20, 2019 · 6 comments
Closed

Enums not generating correctly with Relay 8 #164

mrtnzlml opened this issue Dec 20, 2019 · 6 comments

Comments

@mrtnzlml
Copy link

Hi, we tried to upgrade Relay to version 8 with this language plugin but the generated enums look a bit fishy, see:

@@ -2,7 +2,7 @@
 
 import { ReaderFragment } from "relay-runtime";
 import { FragmentRefs } from "relay-runtime";
-export type LabelColor = "BLUE" | "GRAY" | "GREEN" | "PURPLE" | "RED" | "YELLOW" | "%future added value";
+export type LabelColor = "%future added value" | "%future added value" | "%future added value" | "BLUE" | "GRAY" | "GREEN" | "PURPLE" | "RED" | "YELLOW" | "%future added value";
 export type Label_label = {
     readonly colorName: LabelColor | null;
     readonly name: string | null;

Notice the %future added value placeholder duplicates. Changelog which mentions the enums as well: https://github.com/facebook/relay/releases/tag/v8.0.0

Thanks for having a look! :)

@mrtnzlml mrtnzlml closed this as completed Jan 2, 2020
@mrtnzlml mrtnzlml reopened this Jan 2, 2020
@alloy
Copy link
Member

alloy commented Jan 6, 2020

Oof, good catch. Is this the only issue you have spotted? (In which case I assume there’s no actual fallout?)

@mrtnzlml
Copy link
Author

mrtnzlml commented Jan 6, 2020

@alloy Hi! It seems like that's the only issue so far. :)

@mrtnzlml
Copy link
Author

mrtnzlml commented Feb 6, 2020

Related PR: #170

@sibelius
Copy link
Contributor

sibelius commented Feb 6, 2020

does the PR solves your problem?

@mrtnzlml
Copy link
Author

mrtnzlml commented Feb 6, 2020

Not 100% sure (didn't try) but this error should be visible there when upgrading Relay (there is a test fixture for such enums). So I'd say yes. 🤞

@mrtnzlml
Copy link
Author

Fixed here: #173

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants