Sha256: b109ea3f9066f90df7c8243e9ede0d898b942de009572fd9dfd2a28e77f4df8d
Contents?: true
Size: 993 Bytes
Versions: 6
Compression:
Stored size: 993 Bytes
Contents
module ShopifyCli class PartnersAPI class Organizations class << self def fetch_all(ctx) resp = PartnersAPI.query(ctx, "all_organizations") (resp.dig("data", "organizations", "nodes") || []).map do |org| org["stores"] = (org.dig("stores", "nodes") || []) org end end def fetch(ctx, id:) resp = PartnersAPI.query(ctx, "find_organization", id: id) org = resp.dig("data", "organizations", "nodes").first return nil if org.nil? org["stores"] = (org.dig("stores", "nodes") || []) org end def fetch_with_app(ctx) resp = PartnersAPI.query(ctx, "all_orgs_with_apps") (resp.dig("data", "organizations", "nodes") || []).map do |org| org["stores"] = (org.dig("stores", "nodes") || []) org["apps"] = (org.dig("apps", "nodes") || []) org end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems