joarwilk / gql2flow

Convert a GraphQL Schema to a flow definition
97 stars 24 forks source link

Invalid flow schema #8

Closed svrcekmichal closed 7 years ago

svrcekmichal commented 7 years ago

Hi, the scheme generated with gql2flow looks like this:

export type Query = {
  __typename: string;
  /** Fetches an object given its ID */
  node?: Node;
  me?: User;
  viewer?: Viewer;
}

but it should be

export type Query = {
  __typename: string;
  /** Fetches an object given its ID */
  node: ?Node;
  me: ?User;
  viewer: ?Viewer;
}

Am I right? Because the key is always defined, but it can return null

joarwilk commented 7 years ago

You're absolutely right, I'll fix that!