-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't figure out how to use field_name/2 for sparse fieldsets #156
Comments
Oh, I see. That said, I still don't see how to truncate the list of fields based on the request. I don't want |
@jeregrine is this your intention in #120? |
Whilst the `QueryParser` was correctly identifying requested fieldsets, nothing was done to actually support this. This change prunes returned fields to those requested should it be the case. Note that this change also includes a few more typespecs for functions I touched or read. Resolves beam-community#120 Closes beam-community#156
Whilst the `QueryParser` was correctly identifying requested fieldsets, nothing was done to actually support this. This change prunes returned fields to those requested should it be the case. Note that this change also includes a few more typespecs for functions I touched or read. Resolves beam-community#120 Closes beam-community#156
Whilst the `QueryParser` was correctly identifying requested fieldsets, nothing was done to actually support this. This change prunes returned fields to those requested should it be the case. Note that this change also includes a few more typespecs for functions I touched or read. Resolves beam-community#120 Closes beam-community#156
Whilst the `QueryParser` was correctly identifying requested fieldsets, nothing was done to actually support this. This change prunes returned fields to those requested should it be the case. Note that this change also includes a few more typespecs for functions I touched or read. Resolves beam-community#120 Closes beam-community#156
Whilst the `QueryParser` was correctly identifying requested fieldsets, nothing was done to actually support this. This change prunes returned fields to those requested should it be the case. Note that this change also includes a few more typespecs for functions I touched or read. Resolves beam-community#120 Closes beam-community#156
Whilst the `QueryParser` was correctly identifying requested fieldsets, nothing was done to actually support this. This change prunes returned fields to those requested should it be the case. Note that this change also includes a few more typespecs for functions I touched or read. Resolves beam-community#120 Closes beam-community#156
Whilst the `QueryParser` was correctly identifying requested fieldsets, nothing was done to actually support this. This change prunes returned fields to those requested should it be the case. Note that this change also includes a few more typespecs for functions I touched or read. Resolves beam-community#120 Closes beam-community#156
Whilst the `QueryParser` was correctly identifying requested fieldsets, nothing was done to actually support this. This change prunes returned fields to those requested should it be the case. Note that this change also includes a few more typespecs for functions I touched or read. Resolves beam-community#120 Closes beam-community#156
Whilst the `QueryParser` was correctly identifying requested fieldsets, nothing was done to actually support this. This change prunes returned fields to those requested should it be the case. Note that this change also includes a few more typespecs for functions I touched or read. Resolves beam-community#120 Closes beam-community#156
Whilst the `QueryParser` was correctly identifying requested fieldsets, nothing was done to actually support this. This change prunes returned fields to those requested should it be the case. Note that this change also includes a few more typespecs for functions I touched or read. Resolves beam-community#120 Closes beam-community#156
Whilst the `QueryParser` was correctly identifying requested fieldsets, nothing was done to actually support this. This change prunes returned fields to those requested should it be the case. Note that this change also includes a few more typespecs for functions I touched or read. Resolves beam-community#120 Closes beam-community#156
Whilst the `QueryParser` was correctly identifying requested fieldsets, nothing was done to actually support this. This change prunes returned fields to those requested should it be the case. Note that this change also includes a few more typespecs for functions I touched or read. Resolves beam-community#120 Closes beam-community#156
I've been reading the docs, and found
You can define custom fields or override current fields by defining inside the view function field_name/2 that takes data and conn as arguments.
at https://hexdocs.pm/jsonapi/JSONAPI.View.html#module-fieldsI've tried defining
field_name/2
on my pertinent view module, but it seems to be ignored whenfields/0
is present, andfields/0
being absent produces the error from https://github.com/jeregrine/jsonapi/blob/master/lib/jsonapi/view.ex#L138.Is there any guidance I'm missing on how to comply with https://jsonapi.org/format/#fetching-sparse-fieldsets?
The text was updated successfully, but these errors were encountered: