-
-
Notifications
You must be signed in to change notification settings - Fork 84
Description
Hello
I have a few issues with generated models by mst-gql 0.15.0. My project fails to compile.
-
All of the exported types cause circular reference issues. I have to replace:
export type RootStoreType = Instance<typeof RootStore.Type>;
with
export interface RootStoreType extends Instance<typeof RootStore.Type> {}
and similar. -
TS7022: 'RootStore' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. (this one is also fixed by changes made in 1.)
-
TS2742: The inferred type of 'RootStore' cannot be named without a reference to 'mst-gql/node_modules/graphql'. This is likely not portable. A type annotation is necessary.
-
Incorrect handling of optional type args in the model selector query. One of my fields is generated like this:
instances(builder: string | ActionConnectionModelSelector | ((selector: ActionConnectionModelSelector) => ActionConnectionModelSelector) | undefined, args?: { first?: number, last?: number, before?: string, after?: string }) { return this.__child(instances(first: ${JSON.stringify(args['first'])}, last: ${JSON.stringify(args['last'])}, before: ${JSON.stringify(args['before'])}, after: ${JSON.stringify(args['after'])}), ActionConnectionModelSelector, builder) }
Inside the JSON.stringify calls, the args can be undefined.