Here's a snippet from one of my flow exports
flowtypes.js
export type AnalyticsSetResult = IConversationMetricResult | IBotUpdateMetricResult;
export interface IAnalyticsSetResult = {
__typename: "AnalyticsSetResult";
id: string;
sets: Array<AnalyticsSet> | null;
}
schema.graphql
interface AnalyticsSetResult {
id: ID!
sets: [AnalyticsSet]
}
type ConversationMetricResult implements AnalyticsSetResult {
id: ID!
sets: [ConversationMetricSet]
}
I can sort of see why this decision was made - you wanted a concrete type with the name of the interface that is a union of all the types implementing that interface. So to get around that you moved all graphql types to be interfaces and only generate types for these unions. It seems unnecessary and its confusing to have different names between code types and graphql types.
Here's a snippet from one of my flow exports
flowtypes.js
schema.graphql
I can sort of see why this decision was made - you wanted a concrete type with the name of the interface that is a union of all the types implementing that interface. So to get around that you moved all graphql types to be interfaces and only generate types for these unions. It seems unnecessary and its confusing to have different names between code types and graphql types.