Skip to content

Commit

Permalink
Merge pull request #1114 from clement911/master
Browse files Browse the repository at this point in the history
GraphQL Float properties are now generated as decimal to avoid loss of precision
  • Loading branch information
clement911 authored Dec 4, 2024
2 parents 4512d5d + 7726b68 commit c8950e2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 34 deletions.
1 change: 1 addition & 0 deletions ShopifySharp.Tests/GenerateGraphQLSchema_Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public async Task GenerateGraphQLTypes()
{ "UnsignedInt64", "ulong" },
{ "Money", "decimal" },
{ "Decimal", "decimal" },
{ "Float", "decimal" },
{ "DateTime", "DateTime" },//GraphQL datetimes are always UTC
{ "Date", "DateOnly" },
{ "UtcOffset", "TimeSpan" },
Expand Down
66 changes: 33 additions & 33 deletions ShopifySharp/Entities/GraphQL/GraphQLSchema.generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public class Abandonment : GraphQLObject<Abandonment>, INode
///<summary>
///The number of hours since the customer has last abandoned a checkout.
///</summary>
public float? hoursSinceLastAbandonedCheckout { get; set; }
public decimal? hoursSinceLastAbandonedCheckout { get; set; }
///<summary>
///A globally-unique ID.
///</summary>
Expand Down Expand Up @@ -2020,7 +2020,7 @@ public class AppSubscriptionDiscountPercentage : GraphQLObject<AppSubscriptionDi
///<summary>
///The percentage value of a discount.
///</summary>
public float? percentage { get; set; }
public decimal? percentage { get; set; }
}

///<summary>
Expand Down Expand Up @@ -4780,7 +4780,7 @@ public class CalculatedRestockingFee : GraphQLObject<CalculatedRestockingFee>, I
///<summary>
///The value of the fee as a percentage.
///</summary>
public float? percentage { get; set; }
public decimal? percentage { get; set; }
}

///<summary>
Expand Down Expand Up @@ -6994,11 +6994,11 @@ public class CheckoutBrandingFontSize : GraphQLObject<CheckoutBrandingFontSize>
///<summary>
///The base font size.
///</summary>
public float? @base { get; set; }
public decimal? @base { get; set; }
///<summary>
///The scale ratio used to derive all font sizes such as small and large.
///</summary>
public float? ratio { get; set; }
public decimal? ratio { get; set; }
}

///<summary>
Expand Down Expand Up @@ -16830,7 +16830,7 @@ public class DeliveryParticipant : GraphQLObject<DeliveryParticipant>, INode, ID
///<summary>
///The merchant-defined percentage-of-rate fee for this participant.
///</summary>
public float? percentageOfRateFee { get; set; }
public decimal? percentageOfRateFee { get; set; }
}

///<summary>
Expand Down Expand Up @@ -17294,7 +17294,7 @@ public interface IDepositConfiguration : IGraphQLObject
///<summary>
///The percentage value of the deposit.
///</summary>
public float? percentage { get; set; }
public decimal? percentage { get; set; }
}

///<summary>
Expand All @@ -17305,7 +17305,7 @@ public class DepositPercentage : GraphQLObject<DepositPercentage>, IDepositConfi
///<summary>
///The percentage value of the deposit.
///</summary>
public float? percentage { get; set; }
public decimal? percentage { get; set; }
}

///<summary>
Expand Down Expand Up @@ -19526,7 +19526,7 @@ public class DiscountPercentage : GraphQLObject<DiscountPercentage>, IDiscountCu
///<summary>
///The percentage value of the discount.
///</summary>
public float? percentage { get; set; }
public decimal? percentage { get; set; }
}

///<summary>
Expand Down Expand Up @@ -20716,7 +20716,7 @@ public class DraftOrderAppliedDiscount : GraphQLObject<DraftOrderAppliedDiscount
///The order level discount amount. If `valueType` is `"percentage"`,
///then `value` is the percentage discount.
///</summary>
public float? value { get; set; }
public decimal? value { get; set; }
///<summary>
///Type of the order-level discount.
///</summary>
Expand Down Expand Up @@ -23360,11 +23360,11 @@ public class FulfillmentEvent : GraphQLObject<FulfillmentEvent>, INode
///<summary>
///The latitude where this fulfillment event occurred.
///</summary>
public float? latitude { get; set; }
public decimal? latitude { get; set; }
///<summary>
///The longitude where this fulfillment event occurred.
///</summary>
public float? longitude { get; set; }
public decimal? longitude { get; set; }
///<summary>
///A message associated with this fulfillment event.
///</summary>
Expand Down Expand Up @@ -29654,11 +29654,11 @@ public class LocationAddress : GraphQLObject<LocationAddress>
///<summary>
///The approximate latitude coordinates of the location.
///</summary>
public float? latitude { get; set; }
public decimal? latitude { get; set; }
///<summary>
///The approximate longitude coordinates of the location.
///</summary>
public float? longitude { get; set; }
public decimal? longitude { get; set; }
///<summary>
///The phone number of the location.
///</summary>
Expand Down Expand Up @@ -30151,11 +30151,11 @@ public class MailingAddress : GraphQLObject<MailingAddress>, INode
///<summary>
///The latitude coordinate of the customer address.
///</summary>
public float? latitude { get; set; }
public decimal? latitude { get; set; }
///<summary>
///The longitude coordinate of the customer address.
///</summary>
public float? longitude { get; set; }
public decimal? longitude { get; set; }
///<summary>
///The full name of the customer, based on firstName and lastName.
///</summary>
Expand Down Expand Up @@ -42970,7 +42970,7 @@ public class PriceListAdjustment : GraphQLObject<PriceListAdjustment>
///The value of price adjustment, where positive numbers reduce the prices and negative numbers
///increase them.
///</summary>
public float? value { get; set; }
public decimal? value { get; set; }
}

///<summary>
Expand Down Expand Up @@ -43917,7 +43917,7 @@ public class PriceRulePercentValue : GraphQLObject<PriceRulePercentValue>, IPric
///<summary>
///The percent value of the price rule.
///</summary>
public float? percentage { get; set; }
public decimal? percentage { get; set; }
}

///<summary>
Expand Down Expand Up @@ -44116,7 +44116,7 @@ public class PricingPercentageValue : GraphQLObject<PricingPercentageValue>, IPr
///<summary>
///The percentage value of the object. This is a number between -100 (free) and 0 (no discount).
///</summary>
public float? percentage { get; set; }
public decimal? percentage { get; set; }
}

///<summary>
Expand Down Expand Up @@ -50696,7 +50696,7 @@ public class RestockingFee : GraphQLObject<RestockingFee>, IFee
///<summary>
///The value of the fee as a percentage.
///</summary>
public float? percentage { get; set; }
public decimal? percentage { get; set; }
}

///<summary>
Expand Down Expand Up @@ -52780,11 +52780,11 @@ public class SegmentAttributeStatistics : GraphQLObject<SegmentAttributeStatisti
///<summary>
///The average of a given attribute.
///</summary>
public float? average { get; set; }
public decimal? average { get; set; }
///<summary>
///The sum of a given attribute.
///</summary>
public float? sum { get; set; }
public decimal? sum { get; set; }
}

///<summary>
Expand Down Expand Up @@ -53513,7 +53513,7 @@ public class SellingPlanCheckoutChargePercentageValue : GraphQLObject<SellingPla
///<summary>
///The percentage value of the price used for checkout charge.
///</summary>
public float? percentage { get; set; }
public decimal? percentage { get; set; }
}

///<summary>
Expand Down Expand Up @@ -54383,7 +54383,7 @@ public class SellingPlanPricingPolicyPercentageValue : GraphQLObject<SellingPlan
///<summary>
///The percentage value.
///</summary>
public float? percentage { get; set; }
public decimal? percentage { get; set; }
}

///<summary>
Expand Down Expand Up @@ -55429,11 +55429,11 @@ public class ShopAddress : GraphQLObject<ShopAddress>, INode
///<summary>
///The latitude coordinate of the address.
///</summary>
public float? latitude { get; set; }
public decimal? latitude { get; set; }
///<summary>
///The longitude coordinate of the address.
///</summary>
public float? longitude { get; set; }
public decimal? longitude { get; set; }

///<summary>
///The full name, based on firstName and lastName.
Expand Down Expand Up @@ -62187,11 +62187,11 @@ public class TaxLine : GraphQLObject<TaxLine>
///<summary>
///The proportion of the line item price that the tax represents as a decimal.
///</summary>
public float? rate { get; set; }
public decimal? rate { get; set; }
///<summary>
///The proportion of the line item price that the tax represents as a percentage.
///</summary>
public float? ratePercentage { get; set; }
public decimal? ratePercentage { get; set; }
///<summary>
///The source of the tax.
///</summary>
Expand Down Expand Up @@ -63450,7 +63450,7 @@ public class UnitPriceMeasurement : GraphQLObject<UnitPriceMeasurement>
///<summary>
///The quantity value for the unit price measurement.
///</summary>
public float? quantityValue { get; set; }
public decimal? quantityValue { get; set; }
///<summary>
///The reference unit for the unit price measurement.
///</summary>
Expand Down Expand Up @@ -64418,15 +64418,15 @@ public class Vector3 : GraphQLObject<Vector3>
///<summary>
///The x coordinate of Vector3.
///</summary>
public float? x { get; set; }
public decimal? x { get; set; }
///<summary>
///The y coordinate of Vector3.
///</summary>
public float? y { get; set; }
public decimal? y { get; set; }
///<summary>
///The z coordinate of Vector3.
///</summary>
public float? z { get; set; }
public decimal? z { get; set; }
}

///<summary>
Expand Down Expand Up @@ -65638,7 +65638,7 @@ public class Weight : GraphQLObject<Weight>, IDeliveryConditionCriteria
///<summary>
///The weight value using the unit system specified with `unit`.
///</summary>
public float? value { get; set; }
public decimal? value { get; set; }
}

///<summary>
Expand Down
2 changes: 1 addition & 1 deletion ShopifySharp/ShopifySharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFrameworks>net6.0;netstandard2.0;net8.0</TargetFrameworks>
<AssemblyName>ShopifySharp</AssemblyName>
<RootNamespace>ShopifySharp</RootNamespace>
<VersionPrefix>6.20.0</VersionPrefix>
<VersionPrefix>6.21.0</VersionPrefix>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<LangVersion>Latest</LangVersion>
Expand Down

0 comments on commit c8950e2

Please sign in to comment.