maple v0.1.1 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
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
Joins key-value pairs of a map in the GraphQL syntax
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.
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_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
join_params(map, map) :: String.t
Joins key-value pairs of a map in the GraphQL syntax