-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decimal and NSDecimal #121
Comments
Hi @ZirgVoice, could you provide a code snippet that demonstrates how you're using Thanks! |
I will use this type as an input argument to create the transaction. struct CreateTransaction: Codable {
var fee: Decimal
var userID: ID?
...
}
class TransactionSchema: PartialSchema<GraphQLResolver, Context> {
@TypeDefinitions
override var types: Types {
Scalar(Decimal.self)
}
} Since I'm using gateway and federation, I add to the sdl scalar Decimal
extend type Mutation {
createTransaction(
fee: Decimal!
userID: ID
...
): Transaction!
...
} If we don't use the gateway, |
Hmm, the short-term workaround is probably to use a Double in place of Decimal, which is definitely the more typical usage (and built-in for GraphQL Float type). Another alternative could be to write custom |
I use Decimal type, on Linux it is Decimal in the schema, but when running on macOS it is NSDecimal in the schema. Is it possible to fix this so that it would be Decimal regardless of the operating system?
The text was updated successfully, but these errors were encountered: