Closed (fixed)
Project:
JSON:API Extras
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 May 2017 at 15:53 UTC
Updated:
7 Jul 2017 at 13:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
tormiComment #3
e0ipsoThis is related to #2746939: [FEATURE] Add pagination metadata.
Comment #4
dawehnerThe query count totally can be helpful, but I suggest to not expose it by default. Counting all elements can be a huge performance loss.
Comment #5
e0ipsoLike @dawehner suggested, we should make sure this behavior is opt-in.
I see this as a global configuration. You either add counts everywhere or nowhere.
Comment #6
sluceroIt doesn't account for the configuration options being discussed here, but for anyone using already using the work in #2746939: [FEATURE] Add pagination metadata as well, I've shared an updated patch to include the total result count in the meta section as described here.
See #2746939-49: [FEATURE] Add pagination metadata for the patch and interdiff specifically adding this to the meta section.
Comment #7
dpolant commentedThis patch adds an include_count config value to the schema and adds a form element on the settings form for setting it. Configurable resource types then look at this global value when deciding the result of their includeCount method.
For more background, see https://www.drupal.org/node/2746939#comment-12136652
Comment #8
e0ipsoI made two minor changes on commit.
We need the FQN.
The docblock for the new parameter is missing.