add DepositOrder model and query
This commit is contained in:
16
app/graphql/types/deposit_order_type.rb
Normal file
16
app/graphql/types/deposit_order_type.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
# frozen_string_literal: true
|
||||
module Types
|
||||
class DepositOrderType < Types::BaseObject
|
||||
implements GraphQL::Types::Relay::Node
|
||||
global_id_field :id
|
||||
|
||||
graphql_name "DepositOrder"
|
||||
|
||||
field :id, ID, null: false
|
||||
field :status, String, null: false
|
||||
field :received_amount_cents, Integer, null: false
|
||||
field :paid_amount_cents, Integer, null: false
|
||||
field :created_at, GraphQL::Types::ISO8601DateTime, null: false
|
||||
field :updated_at, GraphQL::Types::ISO8601DateTime, null: false
|
||||
end
|
||||
end
|
||||
@@ -31,5 +31,10 @@ module Types
|
||||
|
||||
ransack(scope, filter)
|
||||
end
|
||||
|
||||
field :deposit_orders, DepositOrderType.connection_type, null: false
|
||||
def deposit_orders
|
||||
Pundit.policy_scope(current_user, DepositOrder)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user