""" Skio GraphQL Schema Honestly-modeled schema derived from Skio's public API reference (https://code.skio.com/). Skio is a subscription-management platform for Shopify DTC brands. Its public API is GraphQL-first, served from https://graphql.skio.com/v1/graphql, and is a Hasura-style API: read queries use where/order_by/limit/offset arguments, and write operations are exposed as purpose-built mutations (createSubscription, cancelSubscription, etc.). Skio's data model mirrors Shopify GraphQL objects. Nearly every entity carries a `platformId` field holding the corresponding Shopify GID (e.g. gid://shopify/SubscriptionContract/12346616394), which can be used to cross-query Shopify. This document is a conceptual, honestly-modeled schema: the object/field names, queries, and mutations reflect Skio's documented API, but exhaustive field lists, Hasura-generated filter input types, and internal types are approximated where Skio does not publish a full SDL. Treat as endpointsModeled. """ # ───────────────────────────────────────────── # Scalars # ───────────────────────────────────────────── scalar UUID scalar DateTime scalar JSON scalar Numeric # ───────────────────────────────────────────── # Enums # ───────────────────────────────────────────── enum SubscriptionStatus { ACTIVE PAUSED CANCELLED EXPIRED FAILED } enum OrderByDirection { asc desc } enum BillingIntervalUnit { DAY WEEK MONTH YEAR } # ───────────────────────────────────────────── # Core Entity Types # ───────────────────────────────────────────── "A recurring subscription. Mirrors Shopify's SubscriptionContract." type Subscription { id: UUID! platformId: String status: SubscriptionStatus! nextBillingDate: DateTime createdAt: DateTime! updatedAt: DateTime cancelledAt: DateTime pausedAt: DateTime note: String StorefrontUser: StorefrontUser SubscriptionLines(where: SubscriptionLineWhere, order_by: JSON, limit: Int, offset: Int): [SubscriptionLine!]! PaymentMethod: PaymentMethod ShippingAddress: Address BillingPolicy: Policy DeliveryPolicy: Policy Orders(order_by: JSON, limit: Int, offset: Int): [Order!]! } "A single line item within a subscription." type SubscriptionLine { id: UUID! platformId: String quantity: Int! priceWithoutDiscount: Numeric price: Numeric createdAt: DateTime! removedAt: DateTime ProductVariant: ProductVariant Subscription: Subscription } "A customer / subscriber. Mirrors Shopify's Customer object." type StorefrontUser { id: UUID! platformId: String email: String firstName: String lastName: String createdAt: DateTime Subscriptions(where: SubscriptionWhere, order_by: JSON, limit: Int, offset: Int): [Subscription!]! Addresses: [Address!]! PaymentMethods: [PaymentMethod!]! } "An order generated by (or associated with) a subscription. Mirrors Shopify's Order." type Order { id: UUID! platformId: String name: String totalPrice: Numeric createdAt: DateTime! Subscription: Subscription StorefrontUser: StorefrontUser OrderLineItems(order_by: JSON, limit: Int, offset: Int): [OrderLineItem!]! } "A line item on an order." type OrderLineItem { id: UUID! platformId: String title: String quantity: Int! price: Numeric ProductVariant: ProductVariant Order: Order } "A sellable product. Mirrors Shopify's Product." type Product { id: UUID! platformId: String title: String handle: String ProductVariants(order_by: JSON, limit: Int, offset: Int): [ProductVariant!]! } "A specific purchasable variant of a product. Mirrors Shopify's ProductVariant." type ProductVariant { id: UUID! platformId: String title: String price: Numeric sku: String Product: Product } "A shipping or billing address." type Address { id: UUID! platformId: String firstName: String lastName: String address1: String address2: String city: String province: String country: String zip: String phone: String } "A stored payment method for a subscriber." type PaymentMethod { id: UUID! platformId: String brand: String last4: String expiryMonth: Int expiryYear: Int } "A billing or delivery policy governing a subscription's cadence." type Policy { id: UUID! interval: BillingIntervalUnit! intervalCount: Int! } "A pricing policy / selling-plan discount rule." type PricingPolicy { id: UUID! platformId: String basePrice: Numeric discountType: String discountValue: Numeric } "A selling plan group (a set of subscription offer options for products)." type SellingPlanGroup { id: UUID! platformId: String name: String merchantCode: String ProductVariants: [ProductVariant!]! } "A discount that can be applied to a subscription." type Discount { id: UUID! platformId: String code: String value: Numeric valueType: String } "A Skio storefront site (merchant shop) configuration." type Site { id: UUID! platformId: String name: String domain: String } "Aggregated daily revenue metrics." type DailyRevenueMetric { date: String! revenue: Numeric! orderCount: Int! } # ───────────────────────────────────────────── # Filter / Where Input Types (Hasura-style, approximated) # ───────────────────────────────────────────── input StringComparison { _eq: String _neq: String _in: [String!] _like: String _is_null: Boolean } input TimestampComparison { _eq: DateTime _gt: DateTime _lt: DateTime _gte: DateTime _lte: DateTime _is_null: Boolean } input StorefrontUserWhere { email: StringComparison platformId: StringComparison } input SubscriptionWhere { status: StringComparison createdAt: TimestampComparison StorefrontUser: StorefrontUserWhere } input SubscriptionLineWhere { removedAt: TimestampComparison } input OrderWhere { createdAt: TimestampComparison StorefrontUser: StorefrontUserWhere } input ProductWhere { title: StringComparison handle: StringComparison } # ───────────────────────────────────────────── # Mutation Input / Payload Types # ───────────────────────────────────────────── input CreateSubscriptionInput { storefrontUserId: UUID! productVariantIds: [UUID!]! sellingPlanGroupId: UUID nextBillingDate: DateTime } input CancelSubscriptionInput { subscriptionId: UUID! reason: String } input PauseSubscriptionInput { subscriptionId: UUID! } input SkipSubscriptionInput { subscriptionId: UUID! } input UpdateNextBillingDateInput { subscriptionId: UUID! nextBillingDate: DateTime! } input AddSubscriptionLineInput { subscriptionId: UUID! productVariantId: UUID! quantity: Int } input ApplyDiscountCodeInput { subscriptionId: UUID! discountCode: String! } input SwapSubscriptionProductVariantsInput { subscriptionId: UUID! fromProductVariantId: UUID! toProductVariantId: UUID! } input UpdateSubscriptionShippingAddressInput { subscriptionId: UUID! addressId: UUID! } input GenerateMagicLinkInput { storefrontUserId: UUID! } "Generic mutation payload used by several Skio mutations." type MutationResult { ok: Boolean! } type SubscriptionPayload { ok: Boolean! Subscription: Subscription } type MagicLinkPayload { ok: Boolean! url: String } # ───────────────────────────────────────────── # Query Root # ───────────────────────────────────────────── type Query { "List subscriptions with Hasura-style filtering, ordering, and pagination." Subscriptions(where: SubscriptionWhere, order_by: JSON, limit: Int, offset: Int): [Subscription!]! "Fetch a single subscription by primary key." SubscriptionByPk(id: UUID!): Subscription "List subscription lines." SubscriptionLines(where: SubscriptionLineWhere, order_by: JSON, limit: Int, offset: Int): [SubscriptionLine!]! "List storefront users (subscribers)." StorefrontUsers(where: StorefrontUserWhere, order_by: JSON, limit: Int, offset: Int): [StorefrontUser!]! "List orders." Orders(where: OrderWhere, order_by: JSON, limit: Int, offset: Int): [Order!]! "Fetch a single order by primary key." OrderByPk(id: UUID!): Order "List order line items." OrderLineItems(order_by: JSON, limit: Int, offset: Int): [OrderLineItem!]! "List products." Products(where: ProductWhere, order_by: JSON, limit: Int, offset: Int): [Product!]! "Fetch a single product by primary key." ProductByPk(id: UUID!): Product "List product variants." ProductVariants(order_by: JSON, limit: Int, offset: Int): [ProductVariant!]! "Fetch a single product variant by primary key." ProductVariantByPk(id: UUID!): ProductVariant "List addresses." Addresses(order_by: JSON, limit: Int, offset: Int): [Address!]! "Fetch a single address by primary key." AddressByPk(id: UUID!): Address "List pricing policies." PricingPolicies(order_by: JSON, limit: Int, offset: Int): [PricingPolicy!]! "Fetch a single pricing policy by primary key." PricingPolicyByPk(id: UUID!): PricingPolicy "List billing / delivery policies." Policies(order_by: JSON, limit: Int, offset: Int): [Policy!]! "Fetch a single policy by primary key." PolicyByPk(id: UUID!): Policy "Fetch a discount by primary key." DiscountByPk(id: UUID!): Discount "Fetch the current site configuration by primary key." SiteByPk(id: UUID!): Site "Aggregated daily revenue metrics for the shop." getDailyRevenueMetrics(startDate: String!, endDate: String!): [DailyRevenueMetric!]! } # ───────────────────────────────────────────── # Mutation Root # ───────────────────────────────────────────── type Mutation { "Create a new subscription for a subscriber." createSubscription(input: CreateSubscriptionInput!): SubscriptionPayload! "Cancel an active subscription." cancelSubscription(input: CancelSubscriptionInput!): MutationResult! "Pause a subscription." pauseSubscription(input: PauseSubscriptionInput!): MutationResult! "Resume a paused subscription." unpauseSubscription(input: PauseSubscriptionInput!): MutationResult! "Reactivate a cancelled subscription." reactivateSubscription(input: PauseSubscriptionInput!): MutationResult! "Skip the next scheduled order of a subscription." skipSubscription(input: SkipSubscriptionInput!): MutationResult! "Ship the next order immediately." shipNow(input: SkipSubscriptionInput!): MutationResult! "Update the next billing date of a subscription." updateNextBillingDate(input: UpdateNextBillingDateInput!): MutationResult! "Add a product line to a subscription." addSubscriptionLine(input: AddSubscriptionLineInput!): MutationResult! "Add multiple product lines to a subscription in bulk." addSubscriptionLineBulk(inputs: [AddSubscriptionLineInput!]!): MutationResult! "Update an existing subscription line." updateSubscriptionLine(input: AddSubscriptionLineInput!): MutationResult! "Swap one product variant for another on a subscription." swapSubscriptionProductVariants(input: SwapSubscriptionProductVariantsInput!): MutationResult! "Apply a discount code to a subscription." applyDiscountCode(input: ApplyDiscountCodeInput!): MutationResult! "Change the billing interval of a subscription." subscriptionEditInterval(subscriptionId: UUID!, interval: BillingIntervalUnit!, intervalCount: Int!): MutationResult! "Update the payment method on a subscription." subscriptionUpdatePaymentMethod(subscriptionId: UUID!, paymentMethodId: UUID!): MutationResult! "Update the shipping address on a subscription." updateSubscriptionShippingAddress(input: UpdateSubscriptionShippingAddressInput!): MutationResult! "Update the free-form note on a subscription." updateSubscriptionNote(subscriptionId: UUID!, note: String!): MutationResult! "Generate a passwordless magic link for a subscriber to manage their subscription." generateMagicLink(input: GenerateMagicLinkInput!): MagicLinkPayload! "Generate a short-lived quick-action token for customer self-service flows." generateQuickActionToken(storefrontUserId: UUID!): MagicLinkPayload! "Add a product variant to a selling plan group." addProductVariantToSellingPlanGroup(sellingPlanGroupId: UUID!, productVariantId: UUID!): MutationResult! "Remove a product variant from a selling plan group." removeProductVariantFromSellingPlanGroup(sellingPlanGroupId: UUID!, productVariantId: UUID!): MutationResult! "Update site configuration by primary key." updateSiteByPk(id: UUID!, name: String, domain: String): Site }