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 fragments */
export const queryPrimitives = `
id
__typename
`
/* #endregion */
/* #region type-def */
/**
* Query
*/
const Query = MSTGQLObject
.named('Query')
.props({
messages: types.array(types.reference(types.late(() => Message))),
})
/* #endregion */
.actions(self => ({
// this is just an auto-generated example action.
// Feel free to add your own actions, props, views etc to the model.
// Any code outside the '#region mst-gql-*' regions will be preserved
log() {
console.log(JSON.stringify(self))
}
}))
export { Query }
/* #endregion */
/* #region fragments */
export const subscriptionPrimitives = `
id
__typename
`
/* #endregion */
/* #region type-def */
/**
* Subscription
*/
const Subscription = MSTGQLObject
.named('Subscription')
.props({
newMessages: types.maybe(types.reference(types.late(() => Message))),
})
/* #endregion */
.actions(self => ({
// this is just an auto-generated example action.
// Feel free to add your own actions, props, views etc to the model.
// Any code outside the '#region mst-gql-*' regions will be preserved
log() {
console.log(JSON.stringify(self))
}
}))
export { Subscription }
/* #region fragments */
export const queryPrimitives = `
id
__typename
`
/* #endregion */
/* #region type-def */
/**
* Query
*
* Query any Pokémon by number or name
*/
const Query = MSTGQLObject
.named('Query')
.props({
query: types.maybe(types.reference(types.late((): any => Query))),
})
/* #endregion */
.actions(self => ({
// this is just an auto-generated example action.
// Feel free to add your own actions, props, views etc to the model.
// Any code outside the '#region mst-gql-*' regions will be preserved
log() {
console.log(JSON.stringify(self))
}
}))
export { Query }
/* This is a mst-sql generated file, don't modify it manually */
/* eslint-disable */
/* tslint:disable */
import { types } from "mobx-state-tree"
import { MSTGQLObject, MSTGQLRef } from "mst-gql"
import { UserModel } from "./UserModel"
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 launchConnectionPrimitives = `
__typename
cursor
hasMore
`
/* #endregion */
/* #region type-def */
/**
* LaunchConnection
*
* Simple wrapper around our list of launches that contains a cursor to the last item in the list. Pass this cursor to the launches query to fetch results after these.
*/
export const LaunchConnection = MSTGQLObject
.named('LaunchConnection')
.props({
__typename: types.optional(types.literal("LaunchConnection"), "LaunchConnection"),
cursor: types.string,
hasMore: types.boolean,
launches: types.array(MSTGQLRef(types.late(() => Launch))),
})
.views(self => ({
get store() {
return self.__getStore()
}
})) /* #endregion */
.volatile(self => ({
isFetchingMore: false
}))
.actions(self => ({
__typename
amount
name
`
/* #endregion */
/* #region type-def */
export type PokemonEvolutionRequirementType = typeof PokemonEvolutionRequirement.Type
/**
* PokemonEvolutionRequirement
*
* Represents a Pokémon's requirement to evolve
*/
export const PokemonEvolutionRequirement = MSTGQLObject
.named('PokemonEvolutionRequirement')
.props({
__typename: types.optional(types.literal("PokemonEvolutionRequirement"), "PokemonEvolutionRequirement"),
/** The amount of candy to evolve */
amount: types.optional(types.integer, 0),
/** The name of the candy to evolve */
name: types.optional(types.string, ''),
})
.views(self => ({
get store() {
return self.__getStore()
}
}))
/* #endregion */
.actions(self => ({
/* This is a mst-gql generated file, don't modify it manually */
/* eslint-disable */
/* tslint:disable */
import { types } from "mobx-state-tree"
import { MSTGQLObject, MSTGQLRef } from "mst-gql"
import { UserModel } from "./UserModel"
import { RootStore } from "./index"
/**
* ReplyBase
* auto generated base class for the model ReplyModel.
*/
export const ReplyModelBase = MSTGQLObject
.named('Reply')
.props({
__typename: types.optional(types.literal("Reply"), "Reply"),
id: types.identifier,
timestamp: types.number,
user: MSTGQLRef(types.late(() => UserModel)),
text: types.string,
likes: types.array(MSTGQLRef(types.late(() => UserModel))),
})
.views(self => ({
get store() {
return self.__getStore()
}
}))
export const messagePrimitives = `
__typename
id
from
message
`
/* #endregion */
/* #region type-def */
export type MessageType = typeof Message.Type
/**
* Message
*/
export const Message = MSTGQLObject
.named('Message')
.props({
__typename: types.optional(types.literal("Message"), "Message"),
id: types.identifier,
from: types.optional(types.string, ''),
message: types.optional(types.string, ''),
})
.views(self => ({
get store() {
return self.__getStore()
}
}))
/* #endregion */
/* This is a mst-sql generated file, don't modify it manually */
/* eslint-disable */
/* tslint:disable */
import { types } from "mobx-state-tree"
import { MSTGQLObject, MSTGQLRef } from "mst-gql"
import { UserModel } from "./UserModel"
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()
}
}))
createdAt
done
id
isPublished
title
updatedAt
`
/* #endregion */
/* #region type-def */
/**
* Todo
*/
export const Todo = MSTGQLObject
.named('Todo')
.props({
__typename: types.optional(types.literal("Todo"), "Todo"),
createdAt: types.frozen(),
done: types.boolean,
id: types.identifier,
/** Indicates if the record is published */
isPublished: types.boolean,
title: types.string,
updatedAt: types.frozen(),
})
.views(self => ({
get store() {
return self.__getStore()
}
})) /* #endregion */