Skip to content

Commit

Permalink
wp-graphql#156-options-queries
Browse files Browse the repository at this point in the history
Updates to tests and making sure the option is cast as the proper type when it's returned
  • Loading branch information
jasonbahl committed Oct 27, 2017
1 parent 1195c90 commit 7bdc36a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Type/Setting/SettingType.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ private static function fields( $setting_fields, $group ) {
$option = (boolean) $option;
break;
case 'float':
case 'number':
$option = (float) $option;
break;
default:
Expand Down
2 changes: 2 additions & 0 deletions src/Types.php
Original file line number Diff line number Diff line change
Expand Up @@ -692,12 +692,14 @@ public static function get_type( $type ) {
case 'integer':
$type = self::int();
break;
case 'float':
case 'number':
$type = self::float();
break;
case 'boolean':
$type = self::boolean();
break;
case 'string':
default:
$type = self::string();
}
Expand Down

0 comments on commit 7bdc36a

Please sign in to comment.