Type definition for bindings with varying number of arguments

I was trying to implement a custom extender for the graphl_ppx using a functor. Have done this following the documentation.

This is the implementation of the module: https://github.com/pupilfirst/pupilfirst/blob/ad62703e322cdf9e9489945936438dfd4b533e25/app/javascript/shared/utils/ExtendQuery.res

The make function is what I would be using to execute my queries. I am kind of stuck with variables that I pass to the queries. This is how I use the makeVariables binding that the module created by graphql_ppx and pass that to the make function I created in the Extender module.

I want to pass the variables directly as an argument to the make function, without the use of makeVariables. But, I am unable to figure out what would be the type definition of the make function argument in the Extender module when the number of variables varies from query to query.

      module Extender = {
let make = (suggest-type-definition-here) => { ### }
}

At the calling site, I need to have a different number of arguments to make function

1 Like

Reference documentation of extending the graphql_ppx: https://graphql-ppx.com/docs/extending-graphql-ppx