Skip to content

Float input arguments should be treated as float numbers, not as strings #51

Description

@rickschubert

Given the input query contains an argument of type float
When graphQlQueryToJson is called
Then 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:

   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,
                    },
                },
            },
        })
    })

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions