-
Notifications
You must be signed in to change notification settings - Fork 150
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
Floats are being converted to String #160
Comments
Same here with int return type
Gets back
Any remedy? P.S. It's because of format https://github.com/yarax/swagger-to-graphql/blob/master/src/typeMap.ts#L52 |
@0xR Any reason to convert Int64 to String https://github.com/yarax/swagger-to-graphql/blob/master/src/typeMap.ts#L52? |
The JavaScript number type doesn't have enough accuracy to represent a 64 bit integer. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER It's safer to stick to a int32 on your backend. In Java an int would be 32 bit and a long would be 64 bit. |
Thanks @0xR for the clarification 👍 |
Floats in swagger spec are being converted to String in graphql.
Steps to reproduce:
npx swagger-to-graphql --swagger-schema=swagger_schema.yaml > ./types.graphql
swagger_schema.yaml
Expected output:
Actual output:
The text was updated successfully, but these errors were encountered: