@@ -2854,6 +2854,275 @@ export * from \\"./reactUtils\\"
2854
2854
]
2855
2855
`;
2856
2856
2857
+ exports[`scaffolding with model generation only to work 1`] = `
2858
+ Array [
2859
+ Array [
2860
+ "ModelBase",
2861
+ "import { MSTGQLObject } from \\"mst-gql\\"
2862
+
2863
+ export const ModelBase = MSTGQLObject
2864
+ ",
2865
+ false,
2866
+ ],
2867
+ Array [
2868
+ "MyUserModel.base",
2869
+ "/* This is a mst-gql generated file, don't modify it manually */
2870
+ /* eslint-disable */
2871
+ /* tslint:disable */
2872
+
2873
+ import { IObservableArray } from \\"mobx\\"
2874
+ import { types } from \\"mobx-state-tree\\"
2875
+ import { MSTGQLRef , QueryBuilder , withTypedRefs } from \\"mst-gql\\"
2876
+ import { ModelBase } from \\"./ModelBase\\"
2877
+ import { PossiblyEmptyBoxModel , PossiblyEmptyBoxModelType } from \\"./PossiblyEmptyBoxModel\\"
2878
+ import { RootStoreType } from \\"./index\\"
2879
+
2880
+
2881
+ /* The TypeScript type that explicits the refs to other models in order to prevent a circular refs issue */
2882
+ type Refs = {
2883
+ emptyBoxes : IObservableArray <PossiblyEmptyBoxModelType >;
2884
+ }
2885
+
2886
+ /**
2887
+ * MyUserBase
2888
+ * auto generated base class for the model MyUserModel.
2889
+ */
2890
+ export const MyUserModelBase = withTypedRefs<Refs >()(ModelBase
2891
+ .named('MyUser')
2892
+ .props({
2893
+ __typename : types .optional (types .literal (\\" my_user\\ " ), \\" my_user\\ " ),
2894
+ id : types .identifier ,
2895
+ name : types .union (types .undefined , types .string ),
2896
+ avatar : types .union (types .undefined , types .string ),
2897
+ emptyBoxes : types .union (types .undefined , types .array (types .union (types .null , MSTGQLRef (types .late ((): any => PossiblyEmptyBoxModel ))))),
2898
+ } )
2899
+ .views(self => ({
2900
+ get store () {
2901
+ return self.__getStore<RootStoreType >()
2902
+ }
2903
+ } )))
2904
+
2905
+
2906
+ ",
2907
+ true,
2908
+ ],
2909
+ Array [
2910
+ "MyUserModel",
2911
+ "import { Instance } from \\"mobx-state-tree\\"
2912
+ import { MyUserModelBase } from \\"./MyUserModel.base\\"
2913
+
2914
+ /* The TypeScript type of an instance of MyUserModel */
2915
+ export interface MyUserModelType extends Instance<typeof MyUserModel.Type> { }
2916
+
2917
+
2918
+
2919
+ /**
2920
+ * MyUserModel
2921
+ */
2922
+ export const MyUserModel = MyUserModelBase
2923
+ .actions(self => ({
2924
+ // This is an auto-generated example action.
2925
+ log() {
2926
+ console .log (JSON .stringify (self ))
2927
+ }
2928
+ }))
2929
+ " ,
2930
+ false,
2931
+ ],
2932
+ Array [
2933
+ " PossiblyEmptyBoxModel.base",
2934
+ " /* This is a mst-gql generated file, don't modify it manually */
2935
+ /* eslint-disable */
2936
+ /* tslint:disable */
2937
+
2938
+ import { types } from \\" mobx-state-tree\\"
2939
+ import { QueryBuilder } from \\"mst-gql\\"
2940
+ import { ModelBase } from \\"./ModelBase\\"
2941
+ import { RootStoreType } from \\"./index\\"
2942
+
2943
+
2944
+ /**
2945
+ * PossiblyEmptyBoxBase
2946
+ * auto generated base class for the model PossiblyEmptyBoxModel.
2947
+ */
2948
+ export const PossiblyEmptyBoxModelBase = ModelBase
2949
+ .named('PossiblyEmptyBox')
2950
+ .props({
2951
+ __typename: types.optional(types.literal(\\"possibly_empty_box\\"), \\"possibly_empty_box\\"),
2952
+ id: types.identifier,
2953
+ label: types.union(types.undefined, types.string),
2954
+ isEmpty: types.union(types.undefined, types.boolean),
2955
+ })
2956
+ .views(self => ({
2957
+ get store() {
2958
+ return self .__getStore <RootStoreType >()
2959
+ }
2960
+ }))
2961
+
2962
+
2963
+ " ,
2964
+ true,
2965
+ ],
2966
+ Array [
2967
+ " PossiblyEmptyBoxModel",
2968
+ " import { Instance } from \\" mobx-state-tree\\"
2969
+ import { PossiblyEmptyBoxModelBase } from \\"./PossiblyEmptyBoxModel.base\\"
2970
+
2971
+ /* The TypeScript type of an instance of PossiblyEmptyBoxModel */
2972
+ export interface PossiblyEmptyBoxModelType extends Instance<typeof PossiblyEmptyBoxModel.Type> { }
2973
+
2974
+
2975
+
2976
+ /**
2977
+ * PossiblyEmptyBoxModel
2978
+ */
2979
+ export const PossiblyEmptyBoxModel = PossiblyEmptyBoxModelBase
2980
+ .actions(self => ({
2981
+ // This is an auto-generated example action.
2982
+ log() {
2983
+ console .log (JSON .stringify (self ))
2984
+ }
2985
+ }))
2986
+ " ,
2987
+ false,
2988
+ ],
2989
+ Array [
2990
+ " QueryRootModel.base",
2991
+ " /* This is a mst-gql generated file, don't modify it manually */
2992
+ /* eslint-disable */
2993
+ /* tslint:disable */
2994
+
2995
+ import { types } from \\" mobx-state-tree\\"
2996
+ import { MSTGQLRef , QueryBuilder , withTypedRefs } from \\"mst-gql\\"
2997
+ import { ModelBase } from \\"./ModelBase\\"
2998
+ import { MyUserModel , MyUserModelType } from \\"./MyUserModel\\"
2999
+ import { RootStoreType } from \\"./index\\"
3000
+
3001
+
3002
+ /* The TypeScript type that explicits the refs to other models in order to prevent a circular refs issue */
3003
+ type Refs = {
3004
+ me : MyUserModelType ;
3005
+ }
3006
+
3007
+ /**
3008
+ * QueryRootBase
3009
+ * auto generated base class for the model QueryRootModel.
3010
+ */
3011
+ export const QueryRootModelBase = withTypedRefs<Refs>()(ModelBase
3012
+ .named('QueryRoot')
3013
+ .props({
3014
+ __typename: types.optional(types.literal(\\"query_root\\"), \\"query_root\\"),
3015
+ me: types.union(types.undefined, types.null, MSTGQLRef(types.late((): any => MyUserModel))),
3016
+ })
3017
+ .views(self => ({
3018
+ get store() {
3019
+ return self .__getStore <RootStoreType >()
3020
+ }
3021
+ })))
3022
+
3023
+
3024
+ " ,
3025
+ true,
3026
+ ],
3027
+ Array [
3028
+ " QueryRootModel",
3029
+ " import { Instance } from \\" mobx-state-tree\\"
3030
+ import { QueryRootModelBase } from \\"./QueryRootModel.base\\"
3031
+
3032
+ /* The TypeScript type of an instance of QueryRootModel */
3033
+ export interface QueryRootModelType extends Instance<typeof QueryRootModel.Type> { }
3034
+
3035
+
3036
+
3037
+ /**
3038
+ * QueryRootModel
3039
+ */
3040
+ export const QueryRootModel = QueryRootModelBase
3041
+ .actions(self => ({
3042
+ // This is an auto-generated example action.
3043
+ log() {
3044
+ console .log (JSON .stringify (self ))
3045
+ }
3046
+ }))
3047
+ " ,
3048
+ false,
3049
+ ],
3050
+ Array [
3051
+ " RootStore",
3052
+ " import { Instance } from \\" mobx-state-tree\\"
3053
+ import { RootStoreBase } from \\"./RootStore.base\\"
3054
+
3055
+ export interface RootStoreType extends Instance<typeof RootStore.Type> { }
3056
+
3057
+ export const RootStore = RootStoreBase
3058
+ .actions(self => ({
3059
+ // This is an auto-generated example action.
3060
+ log() {
3061
+ console .log (JSON .stringify (self ))
3062
+ }
3063
+ }))
3064
+ " ,
3065
+ false,
3066
+ ],
3067
+ Array [
3068
+ " RootStore.base",
3069
+ " /* This is a mst-gql generated file, don't modify it manually */
3070
+ /* eslint-disable */
3071
+ /* tslint:disable */
3072
+ import { ObservableMap } from \\" mobx\\"
3073
+ import { types } from \\"mobx-state-tree\\"
3074
+ import { MSTGQLStore , configureStoreMixin , QueryOptions , withTypedRefs } from \\"mst-gql\\"
3075
+
3076
+ import { MyUserModel , MyUserModelType } from \\"./MyUserModel\\"
3077
+ import { PossiblyEmptyBoxModel , PossiblyEmptyBoxModelType } from \\"./PossiblyEmptyBoxModel\\"
3078
+ import { QueryRootModel , QueryRootModelType } from \\"./QueryRootModel\\"
3079
+
3080
+
3081
+
3082
+ /* The TypeScript type that explicits the refs to other models in order to prevent a circular refs issue */
3083
+ type Refs = {
3084
+ myUsers : ObservableMap < string , MyUserModelType > ,
3085
+ possiblyEmptyBoxes : ObservableMap < string , PossiblyEmptyBoxModelType >
3086
+ }
3087
+
3088
+
3089
+ /**
3090
+ * Enums for the names of base graphql actions
3091
+ */
3092
+
3093
+
3094
+
3095
+ /**
3096
+ * Store, managing, among others, all the objects received through graphQL
3097
+ */
3098
+ export const RootStoreBase = withTypedRefs<Refs>()(types.model()
3099
+ .named(\\"RootStore\\")
3100
+ .extend(configureStoreMixin([['my_user', () => MyUserModel], ['possibly_empty_box', () => PossiblyEmptyBoxModel], ['query_root', () => QueryRootModel]], ['my_user', ' possibly_empty_box' ], \\"js\\"))
3101
+ .props({
3102
+ myUsers: types.optional(types.map(types.late((): any => MyUserModel)), { } ),
3103
+ possiblyEmptyBoxes: types.optional(types.map(types.late((): any => PossiblyEmptyBoxModel)), { } )
3104
+ })
3105
+ .actions(self => ({
3106
+ })))
3107
+ " ,
3108
+ true,
3109
+ ],
3110
+ Array [
3111
+ " index",
3112
+ " /* This is a mst-gql generated file, don't modify it manually */
3113
+ /* eslint-disable */
3114
+ /* tslint:disable */
3115
+
3116
+ export * from \\" ./MyUserModel\\"
3117
+ export * from \\"./PossiblyEmptyBoxModel\\"
3118
+ export * from \\"./QueryRootModel\\"
3119
+ export * from \\"./RootStore\\"
3120
+ " ,
3121
+ true,
3122
+ ],
3123
+ ]
3124
+ `;
3125
+
2857
3126
exports[`scaffolding with scalar type 1`] = `
2858
3127
Array [
2859
3128
Array [
0 commit comments