createApp<Context extends object>(name: string,info: string,env_prefix: string,argDictionary: { [key: string]: ArgDictionaryItem; },addSubscriptions: boolean,addMutations: boolean,default_port: number,default_host: string,log: Log,appendSchema?: (builder: ReturnType<getBuilder>,args: Args,) => ReturnType<getBuilder> | Promise<ReturnType<getBuilder>>,beforeServe?: (args: Args) => void | Promise<void>,context?: Context,): ReturnType<createMain>
Creates a GraphQL application by combining server and CLI functionality.
Context extends object
- The type of the context object used in the GraphQL schema
name: string
- The name of the application
info: string
- Description or information about the application
env_prefix: string
- Prefix for environment variables
argDictionary: { [key: string]: ArgDictionaryItem; }
addSubscriptions: boolean
- Whether to enable GraphQL subscriptions
addMutations: boolean
- Whether to enable GraphQL mutations
default_port: number
- Default port number for the GraphQL server
default_host: string
- Default hostname for the GraphQL server
optional
appendSchema: (builder: ReturnType<getBuilder>,args: Args,) => ReturnType<getBuilder> | Promise<ReturnType<getBuilder>>
- Optional function to extend the GraphQL schema
optional
beforeServe: (args: Args) => void | Promise<void>
- Optional function to run before starting the server
optional
context: Context = {}
- Optional context object for GraphQL resolvers
ReturnType<createMain>
A function that starts the application when called