Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
`
/* #endregion */
/* #region type-def */
/**
* User
*/
export const User = MSTGQLObject
.named('User')
.props({
__typename: types.optional(types.literal("User"), "User"),
id: types.identifier,
email: types.string,
trips: types.array(MSTGQLRef(types.late(() => Launch))),
})
.views(self => ({
get store() {
return self.__getStore()
}
})) /* #endregion */
import { ModelBase } from "./ModelBase"
import { OrganizationModel } from "./OrganizationModel"
import { OwnerModelSelector } from "./OwnerModelSelector"
import { UserModel } from "./UserModel"
/**
* RepoBase
* auto generated base class for the model RepoModel.
*/
export const RepoModelBase = ModelBase
.named('Repo')
.props({
__typename: types.optional(types.literal("Repo"), "Repo"),
id: types.identifier,
owner: types.maybeNull(types.union(MSTGQLRef(types.late(() => UserModel)), MSTGQLRef(types.late(() => OrganizationModel)))),
})
.views(self => ({
get store() {
return self.__getStore()
}
}))
export class RepoModelSelector extends QueryBuilder {
get id() { return this.__attr(`id`) }
owner(builder) { return this.__child(`owner`, OwnerModelSelector, builder) }
}
export function selectFromRepo() {
return new RepoModelSelector()
}
export const repoModelPrimitives = selectFromRepo()
}
/**
* MessageBase
* auto generated base class for the model MessageModel.
*/
export const MessageModelBase = withTypedRefs()(ModelBase
.named('Message')
.props({
__typename: types.optional(types.literal("Message"), "Message"),
id: types.identifier,
timestamp: types.union(types.undefined, types.number),
user: types.union(types.undefined, MSTGQLRef(types.late((): any => UserModel))),
text: types.union(types.undefined, types.string),
likes: types.union(types.undefined, types.null, types.array(MSTGQLRef(types.late((): any => UserModel)))),
replyTo: types.union(types.undefined, types.null, MSTGQLRef(types.late((): any => MessageModel))),
})
.views(self => ({
get store() {
return self.__getStore()
}
})))
import { ModelBase } from "./ModelBase"
import { LaunchModel } from "./LaunchModel"
import { LaunchModelSelector } from "./LaunchModel.base"
/**
* UserBase
* auto generated base class for the model UserModel.
*/
export const UserModelBase = ModelBase
.named('User')
.props({
__typename: types.optional(types.literal("User"), "User"),
id: types.identifier,
email: types.union(types.undefined, types.string),
trips: types.union(types.undefined, types.array(types.union(types.null, MSTGQLRef(types.late(() => LaunchModel))))),
})
.views(self => ({
get store() {
return self.__getStore()
}
}))
export class UserModelSelector extends QueryBuilder {
get id() { return this.__attr(`id`) }
get email() { return this.__attr(`email`) }
trips(builder) { return this.__child(`trips`, LaunchModelSelector, builder) }
}
export function selectFromUser() {
return new UserModelSelector()
}
import { ReplyModel } from "./ReplyModel"
import { RootStore } from "./index"
/**
* MessageBase
* auto generated base class for the model MessageModel.
*/
export const MessageModelBase = MSTGQLObject
.named('Message')
.props({
__typename: types.optional(types.literal("Message"), "Message"),
id: types.identifier,
timestamp: types.number,
user: MSTGQLRef(types.late(() => UserModel)),
text: types.string,
likes: types.array(MSTGQLRef(types.late(() => UserModel))),
replies: types.array(types.late(() => ReplyModel)),
})
.views(self => ({
get store() {
return self.__getStore()
}
}))
replyTo: MessageModelType;
}
/**
* MessageBase
* auto generated base class for the model MessageModel.
*/
export const MessageModelBase = withTypedRefs()(ModelBase
.named('Message')
.props({
__typename: types.optional(types.literal("Message"), "Message"),
id: types.identifier,
timestamp: types.union(types.undefined, types.number),
user: types.union(types.undefined, MSTGQLRef(types.late((): any => UserModel))),
text: types.union(types.undefined, types.string),
likes: types.union(types.undefined, types.null, types.array(MSTGQLRef(types.late((): any => UserModel)))),
replyTo: types.union(types.undefined, types.null, MSTGQLRef(types.late((): any => MessageModel))),
})
.views(self => ({
get store() {
return self.__getStore()
}
})))
import { ReplyModel } from "./ReplyModel"
import { RootStore } from "./index"
/**
* MessageBase
* auto generated base class for the model MessageModel.
*/
export const MessageModelBase = MSTGQLObject
.named('Message')
.props({
__typename: types.optional(types.literal("Message"), "Message"),
id: types.identifier,
timestamp: types.number,
user: MSTGQLRef(types.late(() => UserModel)),
text: types.string,
likes: types.array(MSTGQLRef(types.late(() => UserModel))),
replies: types.array(types.late(() => ReplyModel)),
})
.views(self => ({
get store() {
return self.__getStore()
}
}))
export const messageModelPrimitives = `
__typename
id
timestamp
text
`
user: UserModelType;
likes: IObservableArray;
replyTo: MessageModelType;
}
/**
* MessageBase
* auto generated base class for the model MessageModel.
*/
export const MessageModelBase = withTypedRefs()(ModelBase
.named('Message')
.props({
__typename: types.optional(types.literal("Message"), "Message"),
id: types.identifier,
timestamp: types.union(types.undefined, types.number),
user: types.union(types.undefined, MSTGQLRef(types.late((): any => UserModel))),
text: types.union(types.undefined, types.string),
likes: types.union(types.undefined, types.null, types.array(MSTGQLRef(types.late((): any => UserModel)))),
replyTo: types.union(types.undefined, types.null, MSTGQLRef(types.late((): any => MessageModel))),
})
.views(self => ({
get store() {
return self.__getStore()
}
})))
type Refs = {
assignee: UserModelType;
}
/**
* TodoBase
* auto generated base class for the model TodoModel.
*/
export const TodoModelBase = withTypedRefs()(ModelBase
.named('Todo')
.props({
__typename: types.optional(types.literal("Todo"), "Todo"),
id: types.identifier,
text: types.union(types.undefined, types.string),
done: types.union(types.undefined, types.boolean),
assignee: types.union(types.undefined, types.null, MSTGQLRef(types.late((): any => UserModel))),
})
.views(self => ({
get store() {
return self.__getStore()
}
})))
export class TodoModelSelector extends QueryBuilder {
get id() { return this.__attr(`id`) }
get text() { return this.__attr(`text`) }
get done() { return this.__attr(`done`) }
assignee(builder?: string | UserModelSelector | ((selector: UserModelSelector) => UserModelSelector)) { return this.__child(`assignee`, UserModelSelector, builder) }
}
export function selectFromTodo() {
return new TodoModelSelector()
}