Finally, we’re resolving that scope,
returning the full dataset for now. The contract of #resolve is to
return an array of model instances, hence DATA.map { |d| Post.new(d)
}.
@@ -298,7 +298,7 @@
These are the overrides for persistence operations. You are encouraged
not to override create/update/destroy directly and instead use
-Persistence Lifecycle Hooks.
The schema flag is not affected by only/except options.
+
The schema flag is not affected by only/except options.
This option determines if the attribute is exported to the schema.json.
You might want to allow behavior only if a certain condition is met.
@@ -771,7 +771,7 @@
If a filter is marked single: true, we’ll avoid any array parsing and
escape the value for you, filtering on the string as given.
-
By default a value that comes in as null is treated as a string "null".
+
By default a value that comes in as null is treated as a string "null".
To coerce null to a Ruby nil mark the filter with allow_nil: true.
This can be changed for all attributes by setting filters_accept_nil_by_default
# app/models/employee.rbhas_many:positions
-has_one:current_position,->{where(historical_index: 1)}
+has_one:current_position,->{where(historical_index: 1)},class_name: 'Position'Employee.includes('current_position').to_a
diff --git a/guides/concepts/links.md b/guides/concepts/links.md
index c73995d..ad0db37 100644
--- a/guides/concepts/links.md
+++ b/guides/concepts/links.md
@@ -14,6 +14,7 @@ Links
* [Autolinking](#autolinking)
* [Endpoint Validation](#endpoint-validation)
* [Links-On-Demand](#links-on-demand)
+ * [Pagination Links](#pagination-links)
* [Custom Endpoint URLs](#custom-endpoint-urls)
@@ -225,7 +226,28 @@ Graphiti.configure do |c|
end
{% endhighlight %}
-{% include h.html tag="h3" text="3.4 Custom Endpoint URLs" a="custom-endpoint-urls" %}
+{% include h.html tag="h3" text="3.4 Pagination Links" a="pagination-links" %}
+
+To only render pagination links when requested in the URL with `?pagination_links=true`:
+
+{% highlight ruby %}
+Graphiti.configure do |c|
+ c.pagination_links_on_demand = true
+end
+{% endhighlight %}
+
+To set pagination links by default:
+
+{% highlight ruby %}
+Graphiti.configure do |c|
+ c.pagination_links_on_demand = false
+ c.pagination_links = true
+end
+{% endhighlight %}
+
+Pagination links doesn't show up for *#show* action, unless you request with `?pagination_links=true`.
+
+{% include h.html tag="h3" text="3.5 Custom Endpoint URLs" a="custom-endpoint-urls" %}
To change the URL associated with a Resource:
From 6c9391964ac8ca68048790b51f01eb2be7825a5b Mon Sep 17 00:00:00 2001
From: Marcelo Barreto
Date: Sat, 15 May 2021 10:03:27 -0300
Subject: [PATCH 2/2] fix: pagination documentation
---
_site/feed.xml | 2 +-
_site/guides/concepts/links.html | 27 +++++++++++++++++++++------
guides/concepts/links.md | 17 +++++++++++------
3 files changed, 33 insertions(+), 13 deletions(-)
diff --git a/_site/feed.xml b/_site/feed.xml
index f89a076..c9b8319 100644
--- a/_site/feed.xml
+++ b/_site/feed.xml
@@ -1,4 +1,4 @@
-Jekyll2021-05-10T09:23:46-03:00http://localhost:4000/feed.xmlGraphitiStylish Graph APIs
+Jekyll2021-05-15T10:00:38-03:00http://localhost:4000/feed.xmlGraphitiStylish Graph APIs
Tutorial Write-Ups Are Out!2019-10-14T00:00:00-03:002019-10-14T00:00:00-03:00http://localhost:4000/2019/10/14/tutorial<p>Though we’ve long had a <a href="https://github.com/graphiti-api/employee_directory">sample application</a> with step-by-step diffs, we’ve been missing a full walkthrough. That now exists! Start with <a href="https://www.graphiti.dev/tutorial/step_0">Step 0: Bootstrapping</a>.</p>
<p>These write-ups will tell you the relevant code and commands, but
diff --git a/_site/guides/concepts/links.html b/_site/guides/concepts/links.html
index aa7d369..b89809e 100644
--- a/_site/guides/concepts/links.html
+++ b/_site/guides/concepts/links.html
@@ -341,20 +341,35 @@
-
To only render pagination links when requested in the URL with ?pagination_links=true:
+
Requesting big collections can result into slow responses sometimes. In order to avoid this, you could use pagination. It’ll break your response into smaller pieces that will make your server responds faster. Paginations links can be present in your response in the following ways: