Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Support variables in JSON arguments (#235)
  • Loading branch information
a-c-sreedhar-reddy committed Jan 25, 2021
1 parent a81e58f commit da52c7d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/base/rule_no_invalid_input_object_values.re
Expand Up @@ -26,6 +26,23 @@ module Visitor: Traversal_utils.VisitorSig = {
};
};

let enter_fragment_definition = (self, ctx, def: spanning(fragment)) => {
let () = Hashtbl.clear(self.variable_types);
switch (def.item.fg_variable_definitions) {
| None => ()
| Some({item, _}) =>
List.iter(
((name, {vd_type: {item: type_}})) =>
Hashtbl.add(
self.variable_types,
name.item,
type_ |> from_graphql_ast_tr(~schema=ctx.schema),
),
item,
)
};
};

let rec parse_input_object =
(
self,
Expand Down

0 comments on commit da52c7d

Please sign in to comment.