Skip to content

Commit

Permalink
🎨 Update graphql schema
Browse files Browse the repository at this point in the history
  • Loading branch information
saleem-hadad committed Jan 9, 2022
1 parent 20e7a03 commit 348cbd1
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,26 @@ type Transaction {
brand: Brand! @belongsTo
}

type Mutation {
updateTransaction(id: ID! amount: Float! brand: Int!): Transaction
}

type TransactionStatistics {
category_id: Int!
total: Float!
category: Category
}

type Query {
transactions: [Transaction!]! @paginate(defaultCount: 25) @orderBy(column: id direction: DESC)

allBrands: [Brand!]! @all
brands: [Brand!]! @paginate(defaultCount: 25)
transactions: [Transaction!]! @paginate(defaultCount: 25) @orderBy(column: id direction: DESC)

allCategories: [Category!]! @all
categories: [Category!]! @paginate(defaultCount: 25)

totalExpenses: Float! @aggregate(model: Transaction column: amount function: SUM scopes:["expenses"])
totalIncome: Float! @aggregate(model: Transaction column: amount function: SUM scopes: ["income"])
expensesPerCategory: [TransactionStatistics!]!
}

type Mutation {
updateTransaction(id: ID! amount: Float! brand: Int!): Transaction
}

0 comments on commit 348cbd1

Please sign in to comment.