maple v0.3.0 Maple.Helpers View Source
Helper functions to create the dybamic function in the macro. Helps keep the code somewhat clean and maintainable
Link to this section Summary
Functions
Creates a custom map out of the parsed function data which is easier to work with when creating custom functions
Creates a string to interpolate into the query or mutation that represents the
variables defined in the variables dictionary. Ex. id: $id
Declares all the variables and their types that will be used inside the specific function
Emits a log warning if the function has been marked deprecared
Finds all parameters that are missing from the required parameters list
Takes the data for a mutation function and an adapter and creates the AST that calls the mutation function on the adapter with the passed params and fields
Takes the data for a query function and an adapter and creates the AST that calls the query function on the passed adapter with the passed fields
Takes the data for a query function and an adapter and creates the AST that calls the query function on the passed adapter with the passed parameters and fields
Returns a map of the GraphQL declared types for the arguments
Returns all the parameters flagged as required
Link to this section Functions
Creates a custom map out of the parsed function data which is easier to work with when creating custom functions.
Creates a string to interpolate into the query or mutation that represents the
variables defined in the variables dictionary. Ex. id: $id
declare_variables(map, map) :: String.t
Declares all the variables and their types that will be used inside the specific function
Emits a log warning if the function has been marked deprecared
find_missing(map, list) :: list
Finds all parameters that are missing from the required parameters list
generate_mutation(map, atom) :: tuple
Takes the data for a mutation function and an adapter and creates the AST that calls the mutation function on the adapter with the passed params and fields
generate_one_arity_query(map, atom) :: tuple
Takes the data for a query function and an adapter and creates the AST that calls the query function on the passed adapter with the passed fields
generate_subscription(map, atom) :: tuple
generate_two_arity_query(map, atom) :: tuple
Takes the data for a query function and an adapter and creates the AST that calls the query function on the passed adapter with the passed parameters and fields
Returns a map of the GraphQL declared types for the arguments
Returns all the parameters flagged as required