add stake orders list

This commit is contained in:
João Geonizeli
2021-08-16 00:58:43 -03:00
parent b065f5dca7
commit 0965333679
27 changed files with 917 additions and 125 deletions

View File

@@ -28,5 +28,10 @@ module Types
def buy_crypto_orders
Pundit.policy_scope(current_user, BuyCryptoOrder)
end
field :stake_orders, StakeOrderType.connection_type, null: false
def stake_orders
Pundit.policy_scope(current_user, StakeOrder)
end
end
end

View File

@@ -0,0 +1,16 @@
# frozen_string_literal: true
module Types
class StakeOrderType < Types::BaseObject
implements GraphQL::Types::Relay::Node
global_id_field :id
graphql_name "StakeOrder"
field :id, ID, null: false
field :pool_name, String, null: false
field :status, ProcessStatusEnum, null: false
field :amount, String, null: false
field :created_at, GraphQL::Types::ISO8601DateTime, null: false
field :updated_at, GraphQL::Types::ISO8601DateTime, null: false
end
end