Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AnnualBudget = graphql.NewObject(graphql.ObjectConfig{ Name: "AnnualBudget", Fields: graphql.Fields{ "id": &graphql.Field{ Type: graphql.NewNonNull(graphql.ID), }, "year": &graphql.Field{ Type: graphql.NewNonNull(graphql.Int), }, "annualBudgetItems": &graphql.Field{ Type: graphql.NewNonNull(graphql.NewList(graphql.NewNonNull(AnnualBudgetItem))), }, }, })
AnnualBudget is the model type
var AnnualBudgetItem = graphql.NewObject(graphql.ObjectConfig{ Name: "AnnualBudgetItem", Fields: graphql.Fields{ "id": &graphql.Field{ Type: graphql.NewNonNull(graphql.ID), }, "annualBudgetId": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), }, "paid": &graphql.Field{ Type: graphql.NewNonNull(graphql.Boolean), }, "interval": &graphql.Field{ Type: graphql.NewNonNull(graphql.Int), }, "amount": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), }, "dueDate": &graphql.Field{ Type: graphql.NewNonNull(Date), }, "name": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), }, }, })
AnnualBudgetItem is the model type
var AnnualBudgetItemInput = graphql.NewInputObject(graphql.InputObjectConfig{ Name: "AnnualBudgetItemInput", Fields: graphql.InputObjectConfigFieldMap{ "id": &graphql.InputObjectFieldConfig{ Type: graphql.ID, }, "annualBudgetId": &graphql.InputObjectFieldConfig{ Type: graphql.NewNonNull(graphql.Int), }, "paid": &graphql.InputObjectFieldConfig{ Type: graphql.NewNonNull(graphql.Boolean), }, "interval": &graphql.InputObjectFieldConfig{ Type: graphql.NewNonNull(graphql.Int), }, "amount": &graphql.InputObjectFieldConfig{ Type: graphql.NewNonNull(graphql.Float), }, "dueDate": &graphql.InputObjectFieldConfig{ Type: graphql.NewNonNull(graphql.String), }, "name": &graphql.InputObjectFieldConfig{ Type: graphql.NewNonNull(graphql.String), }, }, }, )
AnnualBudgetItemInput is the params to upsert an annual budget item
var AssetLiability = graphql.NewObject(graphql.ObjectConfig{ Name: "AssetLiability", Fields: graphql.Fields{ "id": &graphql.Field{ Type: graphql.NewNonNull(graphql.ID), Description: "ID of the asset/liability", }, "name": &graphql.Field{ Type: graphql.NewNonNull(graphql.ID), Description: "Name of the asset/liability", }, "isAsset": &graphql.Field{ Type: graphql.NewNonNull(graphql.Boolean), Description: "Is this an asset instead of a liability?", }, }, })
AssetLiability is the model type
var Budget = graphql.NewObject(graphql.ObjectConfig{ Name: "Budget", Fields: graphql.Fields{ "id": &graphql.Field{ Type: graphql.NewNonNull(graphql.ID), Description: "ID of the budget", }, "month": &graphql.Field{ Type: graphql.NewNonNull(graphql.Int), Description: "Calendar Month of the budget", }, "year": &graphql.Field{ Type: graphql.NewNonNull(graphql.Int), Description: "Calendar Year of the budget", }, "income": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), Description: "Expected Income for the month", }, "budgetCategories": &graphql.Field{ Type: graphql.NewNonNull(graphql.NewList(graphql.NewNonNull(BudgetCategory))), }, }, })
Budget is the model type
var BudgetCategory = graphql.NewObject(graphql.ObjectConfig{ Name: "BudgetCategory", Fields: graphql.Fields{ "id": &graphql.Field{ Type: graphql.NewNonNull(graphql.ID), Description: "ID of the budget category", }, "budgetId": &graphql.Field{ Type: graphql.NewNonNull(graphql.ID), Description: "ID of the budget", }, "name": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), Description: "Name of the category", }, "percentage": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), Description: "Recommended percentage that should be allocated in the budget", }, "budgetItems": &graphql.Field{ Type: graphql.NewNonNull(graphql.NewList(graphql.NewNonNull(BudgetItem))), }, }, })
BudgetCategory is the model type
var BudgetCategoryImport = graphql.NewObject(graphql.ObjectConfig{ Name: "BudgetCategoryImport", Fields: graphql.Fields{ "message": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), Description: "Import message", }, }, })
BudgetCategoryImport returns a message indicating what was imported
var BudgetItem = graphql.NewObject(graphql.ObjectConfig{ Name: "BudgetItem", Fields: graphql.Fields{ "id": &graphql.Field{ Type: graphql.NewNonNull(graphql.ID), Description: "ID of the item", }, "budgetCategoryId": &graphql.Field{ Type: graphql.NewNonNull(graphql.ID), Description: "ID of the category", }, "name": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), Description: "Name of the item", }, "amount": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), Description: "Amount budgeted for this item", }, "budgetItemExpenses": &graphql.Field{ Type: graphql.NewNonNull(graphql.NewList(graphql.NewNonNull(BudgetItemExpense))), }, }, })
BudgetItem is the model type
var BudgetItemExpense = graphql.NewObject(graphql.ObjectConfig{ Name: "BudgetItemExpense", Fields: graphql.Fields{ "id": &graphql.Field{ Type: graphql.NewNonNull(graphql.ID), Description: "ID of the expense", }, "budgetItemId": &graphql.Field{ Type: graphql.NewNonNull(graphql.ID), Description: "ID of the item", }, "name": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), Description: "Name of the expense", }, "amount": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), Description: "Amount spent for this expense", }, "date": &graphql.Field{ Type: graphql.NewNonNull(Date), Description: "Date of the expense", }, }, })
BudgetItemExpense is the model type
var BudgetItemExpenseInput = graphql.NewInputObject(graphql.InputObjectConfig{ Name: "BudgetItemExpenseInput", Fields: graphql.InputObjectConfigFieldMap{ "id": &graphql.InputObjectFieldConfig{ Type: graphql.ID, }, "budgetItemId": &graphql.InputObjectFieldConfig{ Type: graphql.NewNonNull(graphql.Int), }, "amount": &graphql.InputObjectFieldConfig{ Type: graphql.NewNonNull(graphql.Float), }, "name": &graphql.InputObjectFieldConfig{ Type: graphql.NewNonNull(graphql.String), }, "date": &graphql.InputObjectFieldConfig{ Type: graphql.NewNonNull(graphql.String), }, }, }, )
BudgetItemExpenseInput is the params to upsert a budget item expense
var BudgetItemInput = graphql.NewInputObject(graphql.InputObjectConfig{ Name: "BudgetItemInput", Fields: graphql.InputObjectConfigFieldMap{ "id": &graphql.InputObjectFieldConfig{ Type: graphql.ID, }, "budgetCategoryId": &graphql.InputObjectFieldConfig{ Type: graphql.NewNonNull(graphql.Int), }, "amount": &graphql.InputObjectFieldConfig{ Type: graphql.NewNonNull(graphql.Float), }, "name": &graphql.InputObjectFieldConfig{ Type: graphql.NewNonNull(graphql.String), }, }, }, )
BudgetItemInput is the params to upsert a budget item
var Date = graphql.NewScalar(graphql.ScalarConfig{ Name: "Date", Description: "Returns a Date (e.g. 2006-01-02)", Serialize: func(value interface{}) interface{} { switch value := value.(type) { case string: if len(value) > 9 { return value[0:10] } return value case time.Time: return value.Format("2006-01-02") case *time.Time: return value.Format("2006-01-02") default: return nil } }, })
Date represents a date without time
var Message = graphql.NewObject(graphql.ObjectConfig{ Name: "Message", Fields: graphql.Fields{ "message": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), Description: "Message", }, }, })
Message is the model type
var MonthlyStatistic = graphql.NewObject(graphql.ObjectConfig{ Name: "MonthlyStatistic", Fields: graphql.Fields{ "id": &graphql.Field{ Type: graphql.NewNonNull(graphql.ID), Description: "ID of the statistic", }, "month": &graphql.Field{ Type: graphql.NewNonNull(graphql.Int), Description: "Calendar Month of the statistic", }, "year": &graphql.Field{ Type: graphql.NewNonNull(graphql.Int), Description: "Calendar Year of the statistic", }, "name": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), Description: "Name of the budget category", }, "amountSpent": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), Description: "Amount spent in that category", }, "totalSpent": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), Description: "Total spent in the month", }, "percentSpent": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), Description: "Percent spent in that category", }, }, })
MonthlyStatistic is the model type
var NetWorth = graphql.NewObject(graphql.ObjectConfig{ Name: "NetWorth", Fields: graphql.Fields{ "id": &graphql.Field{ Type: graphql.NewNonNull(graphql.ID), Description: "ID of the NetWorth", }, "month": &graphql.Field{ Type: graphql.NewNonNull(graphql.Int), Description: "Calendar Month of the NetWorth", }, "year": &graphql.Field{ Type: graphql.NewNonNull(graphql.Int), Description: "Calendar Year of the NetWorth", }, "netWorthItems": &graphql.Field{ Type: graphql.NewNonNull(graphql.NewList(graphql.NewNonNull(NetWorthItem))), }, }, })
NetWorth is the model type
var NetWorthItem = graphql.NewObject(graphql.ObjectConfig{ Name: "NetWorthItem", Fields: graphql.Fields{ "id": &graphql.Field{ Type: graphql.NewNonNull(graphql.ID), Description: "ID of the item", }, "netWorthId": &graphql.Field{ Type: graphql.NewNonNull(graphql.ID), Description: "ID of the net worth", }, "assetLiabilityId": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), Description: "Name of the item", }, "amount": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), Description: "Amount budgeted for this item", }, "asset": &graphql.Field{ Type: graphql.NewNonNull(AssetLiability), }, }, })
NetWorthItem is the model type
var NetWorthItemImport = graphql.NewObject(graphql.ObjectConfig{ Name: "NetWorthItemImport", Fields: graphql.Fields{ "message": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), Description: "Import message", }, "netWorth": &graphql.Field{ Type: graphql.NewNonNull(NetWorth), Description: "Net worth month with all items after import finished", }, }, })
NetWorthItemImport returns a message indicating what was imported
var NewSession = graphql.NewObject(graphql.ObjectConfig{ Name: "NewSession", Fields: graphql.Fields{ "authenticationToken": &graphql.Field{ Type: graphql.ID, Description: "ID of the session", }, "user": &graphql.Field{ Type: User, Description: "User the new session", }, "error": &graphql.Field{ Type: graphql.String, Description: "User error message when email or password is invalid", }, }, })
NewSession is the sign in response type
var NullableString = graphql.NewScalar(graphql.ScalarConfig{ Name: "NullableString", Description: "Returns a string or null", Serialize: func(value interface{}) interface{} { switch value := value.(type) { case nulls.String: var v *string if value.Valid { v = &value.String } return v case *nulls.String: var v *string if value.Valid { v = &value.String } return v default: return nil } }, })
NullableString represents buffalo's null type
var NullableTime = graphql.NewScalar(graphql.ScalarConfig{ Name: "NullableTime", Description: "Returns a string or null", Serialize: func(value interface{}) interface{} { switch value := value.(type) { case nulls.Time: var v *time.Time if value.Valid { v = &value.Time } return v case *nulls.Time: var v *time.Time if value.Valid { v = &value.Time } return v default: return nil } }, })
NullableTime represents buffalo's null type
var Session = graphql.NewObject(graphql.ObjectConfig{ Name: "Session", Fields: graphql.Fields{ "authenticationKey": &graphql.Field{ Type: graphql.NewNonNull(graphql.ID), Description: "ID of the session", }, "userAgent": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), Description: "UserAgent of session when it started", }, "ipAddress": &graphql.Field{ Type: graphql.String, Description: "IP address used when session started", }, "deviceName": &graphql.Field{ Type: NullableString, Description: "Name of device session started on", }, "createdAt": &graphql.Field{ Type: graphql.NewNonNull(graphql.DateTime), Description: "Time session started", }, "expiredAt": &graphql.Field{ Type: NullableTime, Description: "Time session ended", }, }, })
Session is the model type
var Sessions = graphql.NewObject(graphql.ObjectConfig{ Name: "Sessions", Fields: graphql.Fields{ "active": &graphql.Field{ Type: graphql.NewNonNull(graphql.NewList(graphql.NewNonNull(Session))), Description: "Active Sessions", }, "expired": &graphql.Field{ Type: graphql.NewNonNull(graphql.NewList(graphql.NewNonNull(Session))), Description: "Expired Sessions", }, }, })
Sessions returns two kinds
var UploadType = graphql.NewScalar(graphql.ScalarConfig{
Name: "Upload",
Description: "HTML Multipart file upload",
})
var User = graphql.NewObject(graphql.ObjectConfig{ Name: "User", Fields: graphql.Fields{ "id": &graphql.Field{ Type: graphql.NewNonNull(graphql.ID), Description: "ID of the User", }, "email": &graphql.Field{ Type: graphql.NewNonNull(graphql.String), Description: "Email of user", }, "firstName": &graphql.Field{ Type: NullableString, Description: "First name of user", }, "lastName": &graphql.Field{ Type: NullableString, Description: "Last name of user", }, "admin": &graphql.Field{ Type: graphql.NewNonNull(graphql.Boolean), Description: "Is user admin", }, "avatarUrl": &graphql.Field{ Type: graphql.String, Description: "User's avatar url", }, }, })
User is the model type
var UserInput = graphql.NewInputObject(graphql.InputObjectConfig{ Name: "UserInput", Fields: graphql.InputObjectConfigFieldMap{ "email": &graphql.InputObjectFieldConfig{ Type: graphql.NewNonNull(graphql.String), }, "firstName": &graphql.InputObjectFieldConfig{ Type: graphql.String, }, "lastName": &graphql.InputObjectFieldConfig{ Type: graphql.String, }, "password": &graphql.InputObjectFieldConfig{ Type: graphql.NewNonNull(graphql.String), }, }, }, )
UserInput is the params to upsert an annual budget item
Functions ¶
This section is empty.