JSON:API include query parameter parser implementation for Ecto
Parses a comma-separated JSON:API include
string and converts it into a nested keyword list suitable for use as the :preload
option to Ecto.Repo functions.
For example, the query string:
?include=author,bestComments.user.company,bestComments.user.topPostsis parsed into:
[author: [], best_comments: [user: [company: [], top_posts: []]]]Relationship names are converted from camelCase to snake_case. Paths that share an intermediate relationship node are deep-merged so that all leaf preloads are preserved.