Skip to content
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

Allows numeric values to be parsed as GraphQLBools #156

Merged

Conversation

NeedleInAJayStack
Copy link
Member

@NeedleInAJayStack NeedleInAJayStack commented Oct 24, 2024

This is because MapCoder round-trips of Bools result in Number types. This is hard to avoid since it gets put into an NSObject container and there is no NSBool type.

Note that query validation will still disallow directly passing numeric values into boolean arguments as tested here:

Instead this simply allows numeric Swift map objects to be interpreted as GraphQLBool types.

Fixes #155

This is because MapCoder round-trips of Bools result in Number types. This is hard to avoid since it gets put into an NSObject container and there is no NSBool type.
@NeedleInAJayStack NeedleInAJayStack self-assigned this Oct 24, 2024
@NeedleInAJayStack NeedleInAJayStack changed the title fix: Allows numeric values to be parsed as Bools Allows numeric maps to be parsed as GraphQLBools Oct 24, 2024
@NeedleInAJayStack NeedleInAJayStack changed the title Allows numeric maps to be parsed as GraphQLBools Allows numeric values to be parsed as GraphQLBools Oct 24, 2024
@NeedleInAJayStack NeedleInAJayStack merged commit ec809df into GraphQLSwift:main Oct 24, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Query with default values does not work
2 participants