# `JSONAPIPlug.QueryParser.Ecto.Include`
[🔗](https://github.com/lucacorti/jsonapi_plug/blob/main/lib/jsonapi_plug/query_parser/ecto/include.ex#L1)

JSON:API `include` query parameter parser implementation for Ecto

Parses a comma-separated [JSON:API include](https://jsonapi.org/format/#fetching-includes)
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.topPosts

is 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.

# `check_relationship_include`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
