Class: Printavo::Resources::MerchOrders
- Defined in:
- lib/printavo/resources/merch_orders.rb
Constant Summary collapse
- ALL_QUERY =
File.read(File.join(__dir__, '../graphql/merch_orders/all.graphql')).freeze
- FIND_QUERY =
File.read(File.join(__dir__, '../graphql/merch_orders/find.graphql')).freeze
Instance Method Summary collapse
Methods inherited from Base
#all_pages, #each_page, #initialize
Constructor Details
This class inherits a constructor from Printavo::Resources::Base
Instance Method Details
#all(first: 25, after: nil) ⇒ Object
10 11 12 |
# File 'lib/printavo/resources/merch_orders.rb', line 10 def all(first: 25, after: nil) fetch_page(first: first, after: after).records end |
#find(id) ⇒ Object
14 15 16 17 |
# File 'lib/printavo/resources/merch_orders.rb', line 14 def find(id) data = @graphql.query(FIND_QUERY, variables: { id: id.to_s }) Printavo::MerchOrder.new(data['merchOrder']) end |