Skip to content

Commit 216213b

Browse files
authored
fix: make parse_fieldset more resilient (#502)
Querys with `?fields[model]=` are already handled okay but when omitting `=` it results in an exception. This changes fixes that
1 parent 808bad4 commit 216213b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/graphiti/query.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def parse_fieldset(fieldset)
302302
{}.tap do |hash|
303303
fieldset.each_pair do |type, fields|
304304
type = type.to_sym
305-
fields = fields.split(",") unless fields.is_a?(Array)
305+
fields = fields.to_s.split(",") unless fields.is_a?(Array)
306306
hash[type] = fields.map(&:to_sym)
307307
end
308308
end

0 commit comments

Comments
 (0)