it("Handles float arguments as strings", () => {
const query = `
query {
viewer {
products(rating: 4.5, price: 99.99) {
name
}
}
}
`
expect(graphQlQueryToJson(query)).toEqual({
query: {
viewer: {
products: {
__args: {
rating: "4.5",
price: "99.99",
},
name: true,
},
},
},
})
})
Given the input query contains an argument of type float
When
graphQlQueryToJsonis calledThen the return JSON should use a float number
But it currently uses an intenger which is a bug
See example below from
src/test/full_functionality.spec.ts(taken from #50 ) which highlights the current bug: