diff --git a/_site/cookbooks/without-activerecord.html b/_site/cookbooks/without-activerecord.html index 57afd7c..f8a4d3d 100644 --- a/_site/cookbooks/without-activerecord.html +++ b/_site/cookbooks/without-activerecord.html @@ -171,7 +171,7 @@

mind the premise of building a hash of options and passing it off to a client can apply to any datastore).

-

Finally, we’re resolving that scope, +

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.

+Persistence Lifecycle Hooks.

diff --git a/_site/feed.xml b/_site/feed.xml index 3c70792..c9b8319 100644 --- a/_site/feed.xml +++ b/_site/feed.xml @@ -1,5 +1,5 @@ -Jekyll2020-05-29T10:03:07-04:00/GraphitiStylish Graph APIs -Tutorial Write-Ups Are Out!2019-10-14T00:00:00-04:002019-10-14T00:00:00-04:00/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> +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 they’ll also give helpful context around the decisions Graphiti makes. @@ -15,7 +15,7 @@ Even if you’re already a Graphiti user, I suggest checking it out!</p> <br /> <br /> <br /> -<br /></p>Lee RichmondThough we’ve long had a sample application with step-by-step diffs, we’ve been missing a full walkthrough. That now exists! Start with Step 0: Bootstrapping.Graphiti 1.2 Released2019-05-20T00:00:00-04:002019-05-20T00:00:00-04:00/2019/05/20/graphiti-1-2<p>I’m thrilled to announce much-needed, much-improved Rails integration, +<br /></p>Lee RichmondThough we’ve long had a sample application with step-by-step diffs, we’ve been missing a full walkthrough. That now exists! Start with Step 0: Bootstrapping.Graphiti 1.2 Released2019-05-20T00:00:00-03:002019-05-20T00:00:00-03:00http://localhost:4000/2019/05/20/graphiti-1-2<p>I’m thrilled to announce much-needed, much-improved Rails integration, courtesy of the amazing <a href="https://github.com/wagenet">Peter Wagenet</a> and the new <a href="https://github.com/graphiti-api/graphiti-rails">graphiti-rails</a> gem. This gives us better error handling, tighter controllers, and a solid @@ -48,7 +48,7 @@ channels in our <a href="https://join.slack.com/t/graphiti-api/shared_in <br /> <br /> <br /> -<br /></p>Lee RichmondI’m thrilled to announce much-needed, much-improved Rails integration, courtesy of the amazing Peter Wagenet and the new graphiti-rails gem. This gives us better error handling, tighter controllers, and a solid foundation for the codebase moving forward.Graphiti 1.1 Released2019-05-08T00:00:00-04:002019-05-08T00:00:00-04:00/2019/05/08/graphiti-1-1<p>Our first minor version bump centers around an important update: +<br /></p>Lee RichmondI’m thrilled to announce much-needed, much-improved Rails integration, courtesy of the amazing Peter Wagenet and the new graphiti-rails gem. This gives us better error handling, tighter controllers, and a solid foundation for the codebase moving forward.Graphiti 1.1 Released2019-05-08T00:00:00-03:002019-05-08T00:00:00-03:00http://localhost:4000/2019/05/08/graphiti-1-1<p>Our first minor version bump centers around an important update: <strong>better errors for clients</strong>. This is the first phase of work to allow us to provide more actionable errors to API users who might not also be developers of the API itself. This was brought to us by Graphiti maintainer <a href="https://github.com/wadetandy">Wade Tandy</a>.</p> <p>Previously, when a client sent a bad write request to the server - @@ -79,7 +79,7 @@ will be extendable to reads as well.</p> <br /> <br /> <br /> -<br /></p>Lee RichmondOur first minor version bump centers around an important update: better errors for clients. This is the first phase of work to allow us to provide more actionable errors to API users who might not also be developers of the API itself. This was brought to us by Graphiti maintainer Wade Tandy.Graphiti 1.0 Released 🎉2019-03-31T00:00:00-04:002019-03-31T00:00:00-04:00/2019/03/31/graphiti-1-0<p>This project has gone through a number of iterations over the past three years. I’m happy to say we’ve now released 1.0, committing to semantic versioning. Graphiti has now seen enough use, across a wide variety of scenarios, that we can commit to no backwards-incompatible changes for a long while, and a changelog for future releases.</p> +<br /></p>Lee RichmondOur first minor version bump centers around an important update: better errors for clients. This is the first phase of work to allow us to provide more actionable errors to API users who might not also be developers of the API itself. This was brought to us by Graphiti maintainer Wade Tandy.Graphiti 1.0 Released 🎉2019-03-31T00:00:00-03:002019-03-31T00:00:00-03:00http://localhost:4000/2019/03/31/graphiti-1-0<p>This project has gone through a number of iterations over the past three years. I’m happy to say we’ve now released 1.0, committing to semantic versioning. Graphiti has now seen enough use, across a wide variety of scenarios, that we can commit to no backwards-incompatible changes for a long while, and a changelog for future releases.</p> <p>We’ll be writing more in this blog about our future roadmap. Stay tuned!</p> diff --git a/_site/guides/concepts/links.html b/_site/guides/concepts/links.html index 8ebc68a..b89809e 100644 --- a/_site/guides/concepts/links.html +++ b/_site/guides/concepts/links.html @@ -99,6 +99,7 @@

Links

  • Autolinking
  • Endpoint Validation
  • Links-On-Demand
  • +
  • Pagination Links
  • Custom Endpoint URLs
  • @@ -333,10 +334,47 @@

    c.links_on_demand = true end + + +

    + 3.4 Pagination Links +

    +
    + +

    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:

    + + + +

    + 3.4.1 Showing by default +

    +
    + +

    With this configuration, all the responses will return the pagination links

    + +
    Graphiti.configure do |c|
    +  c.pagination_links = true
    +end
    + + + +

    + 3.4.2 When requested +

    +
    + +

    You can showing the pagination links when it was requested in the URL with ?pagination_links=true

    + +
    Graphiti.configure do |c|
    +  c.pagination_links_on_demand = true
    +end
    + +

    Pagination links won’t show up for #show actions.

    +

    - 3.4 Custom Endpoint URLs + 3.5 Custom Endpoint URLs

    diff --git a/_site/guides/concepts/resources.html b/_site/guides/concepts/resources.html index d207fce..57e9f9d 100644 --- a/_site/guides/concepts/resources.html +++ b/_site/guides/concepts/resources.html @@ -216,7 +216,7 @@

    attribute :name, :string, only: [:sortable]
     attribute :name, :string, except: [:writable]
    -

    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

    @@ -1264,7 +1264,7 @@
    # app/models/employee.rb
     has_many :positions
    -has_one :current_position, -> { where(created_at: :desc) }
    +has_one :current_position, -> { where(created_at: :desc) }, class_name: 'Position'
     
     Employee.includes('current_position').to_a
     
    @@ -1279,7 +1279,7 @@ 
    # app/resources/employee_resource.rb
     has_many :positions
    -has_one :current_position do
    +has_one :current_position, resource: PositionResource do
       params do |hash|
         hash[:sort] = '-created_at'
       end
    @@ -1302,7 +1302,7 @@ 
    # app/models/employee.rb
     has_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..98556a4 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,33 @@ 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" %}
    +
    +Requesting big collections can result into slow responses sometimes. In order to avoid this, you could use [pagination](https://jsonapi.org/format/#fetching-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:
    +
    +{% include h.html tag="h4" text="3.4.1 Showing by default" a="pagination-links-showing-by-default" %}
    +
    +With this configuration, all the responses will return the pagination links
    +
    +{% highlight ruby %}
    +Graphiti.configure do |c|
    +  c.pagination_links = true
    +end
    +{% endhighlight %}
    +
    +{% include h.html tag="h4" text="3.4.2 When requested" a="pagination-links-when-requested" %}
    +
    +You can showing the pagination links when it was requested in the URL with `?pagination_links=true`
    +
    +{% highlight ruby %}
    +Graphiti.configure do |c|
    +  c.pagination_links_on_demand = true
    +end
    +{% endhighlight %}
    +
    +Pagination links won't show up for *#show* actions.
    +
    +{% include h.html tag="h3" text="3.5 Custom Endpoint URLs" a="custom-endpoint-urls" %}
     
     To change the URL associated with a Resource: