Skip to content

Commit d831d64

Browse files
author
Lee Richmond
committed
Initial blog + migration guide
1 parent aa17a43 commit d831d64

File tree

7 files changed

+228
-1
lines changed

7 files changed

+228
-1
lines changed

_layouts/blog.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html lang="{{ page.lang | default: site.lang | default: "en" }}">
3+
4+
{% include head.html %}
5+
6+
<body>
7+
<main class="page-content" aria-label="Content">
8+
<div class="wrapper">
9+
{% include header.html %}
10+
<div class="container">
11+
<h1>{{ page.title }}</h1>
12+
{{ content }}
13+
</div>
14+
</div>
15+
</main>
16+
{% include footer.html %}
17+
{% include highlight.html %}
18+
</body>
19+
</html>
20+

_posts/2019-03-31-graphiti-1-0.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
layout: blog
3+
author: Lee Richmond
4+
title: Graphiti 1.0 Released 🎉
5+
---
6+
7+
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.
8+
9+
We'll be writing more in this blog about our future roadmap. Stay tuned!
10+
11+
<br />
12+
<br />
13+
<br />
14+
<br />
15+
<br />
16+
<br />
17+
<br />
18+
<br />
19+
<br />
20+
<br />
21+
<br />
22+
<br />
23+
<br />
24+
<br />
25+
<br />
26+
<br />
27+
<br />
28+
<br />
29+
<br />
30+
<br />
31+
<br />

_posts/2019-05-08-graphiti-1-1.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
layout: blog
3+
author: Lee Richmond
4+
title: Graphiti 1.1 Released
5+
---
6+
7+
Our first minor version bump centers around an important update:
8+
**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](https://github.com/wadetandy).
9+
10+
Previously, when a client sent a bad write request to the server -
11+
unwritable attributes/relationships, or bad types - we would render the
12+
same generic 500 error JSON. We now render helpful error messages, so
13+
third-party clients know how to correct their requests.
14+
15+
This is currently only affecting invalid writes, but the foundation laid
16+
will be extendable to reads as well.
17+
18+
<br />
19+
<br />
20+
<br />
21+
<br />
22+
<br />
23+
<br />
24+
<br />
25+
<br />
26+
<br />
27+
<br />
28+
<br />
29+
<br />
30+
<br />
31+
<br />
32+
<br />
33+
<br />
34+
<br />
35+
<br />
36+
<br />
37+
<br />
38+
<br />

_posts/2019-05-20-graphiti-1-2.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
layout: blog
3+
author: Lee Richmond
4+
title: Graphiti 1.2 Released
5+
---
6+
7+
I'm thrilled to announce much-needed, much-improved Rails integration,
8+
courtesy of the amazing [Peter Wagenet](https://github.com/wagenet) and
9+
the new [graphiti-rails](https://github.com/graphiti-api/graphiti-rails) gem.
10+
This gives us better error handling, tighter controllers, and a solid
11+
foundation for the codebase moving forward.
12+
13+
You'll be especially happy about this release if you've ever tried to
14+
add error-handling middleware. Because prior versions of Graphiti used
15+
`rescue_from` in `ApplicationController`, we intercepted errors before
16+
other middleware had access to them. Now everything just works.
17+
18+
As part of this upgrade, we're switching from `GraphitiErrors` to
19+
[RescueRegistry](https://github.com/wagenet/rescue_registry). Think of
20+
`RescueRegistry` as a well-refactored version of `GraphitiErrors`, available to
21+
even non-Graphiti developers.
22+
23+
Though you don't have to do anything to upgrade to Graphiti 1.2, this release will start throwing deprecation notices around `ApplicationController`. Don't worry, the required changes are quite minor and spelled out in the [graphiti-rails migration guide]({{site.github.url}}/guides/graphiti-rails-migration).
24+
25+
I'm quite happy with how this effort turned out. This release dramatically improves our integration with Rails internals, and I think everyone involved learned a lot. I'm honored to work with such talented developers in our open-source community ❤️
26+
27+
If you have any further questions, check out the `#dev` or `#rails`
28+
channels in our [Slack Chat](https://join.slack.com/t/graphiti-api/shared_invite/enQtMjkyMTA3MDgxNTQzLWVkMDM3NTlmNTIwODY2YWFkMGNiNzUzZGMzOTY3YmNmZjBhYzIyZWZlZTk4YmI1YTI0Y2M0OTZmZGYwN2QxZjg).
29+
30+
<br />
31+
<br />
32+
<br />
33+
<br />
34+
<br />
35+
<br />
36+
<br />
37+
<br />
38+
<br />
39+
<br />
40+
<br />

_sass/theme.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,3 +914,15 @@ img[alt=glimmer_logo] {
914914
}
915915
}
916916
}
917+
918+
.blog {
919+
h2 a {
920+
color: white;
921+
922+
&:hover {
923+
&:before {
924+
display: none;
925+
}
926+
}
927+
}
928+
}

blog.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
layout: page
3+
---
4+
5+
<div markdown="1" class="toc col-md-3">
6+
Blog
7+
====
8+
9+
{% for post in site.posts %}
10+
* [{{post.title}}]({{post.url}})
11+
{% endfor %}
12+
13+
</div>
14+
15+
<div markdown="1" class="blog col-md-8">
16+
17+
> Here you can keep up-to-date with Graphiti, including updates,
18+
> deprecations, and our future roadmap. If there's anything you'd like
19+
> to read about, let us know [on Slack](https://join.slack.com/t/graphiti-api/shared_invite/enQtMjkyMTA3MDgxNTQzLWVkMDM3NTlmNTIwODY2YWFkMGNiNzUzZGMzOTY3YmNmZjBhYzIyZWZlZTk4YmI1YTI0Y2M0OTZmZGYwN2QxZjg).
20+
21+
{% for post in site.posts %}
22+
<h2><a href="{{post.url}}">{{ post.title }}</a></h2>
23+
<blockquote>{{ post.excerpt }}</blockquote>
24+
{% endfor %}
25+
26+
</div>
27+
28+
<br />
29+
<br />
30+
<br />
31+
<br />
32+
<br />
33+
<br />
34+
<br />
35+
<br />
36+
<br />
37+
<br />
38+
<br />
39+
<br />
40+
<br />
41+
<br />
42+
<br />
43+
<br />
44+
<br />
45+
<br />
46+
<br />
47+
<br />
48+
<br />
49+
<br />
50+
<br />
51+
<br />
52+
<br />
53+
<br />
54+
<br />
55+
<br />
56+
<br />
57+
<br />

guides/graphiti-rails-migration.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,33 @@ layout: page
55
Migrating to graphiti-rails
66
===========================
77

8-
Coming Soon
8+
First, bump to Graphiti 1.2 - everything should work as-is, but you'll
9+
start seeing deprecation notices.
10+
11+
Then add `graphiti-rails` to your `Gemfile`:
12+
13+
```ruby
14+
gem 'graphiti-rails', '~> 0.1'
15+
```
16+
17+
You'll see slightly different deprecation notices at this point. To fix:
18+
19+
* Remove `include Graphiti::Rails` from `ApplicationController`
20+
* Remove `include Graphiti::Responders` from `ApplicationController`
21+
* Remove the `register_exception` for `404` errors if you have one.
22+
* Add `include Graphiti::Rails::Responders` from `ApplicationController`
23+
* Remove the `rescue_from` block.
24+
25+
Finally, if you were passing the `show_raw_error` option to
26+
`#handle_exception`, replace this with `#show_detailed_exceptions?`:
27+
28+
```ruby
29+
def show_detailed_exceptions?
30+
current_user.admin?
31+
end
32+
```
33+
34+
> Keep in mind, we'll always show detailed exceptions in development
35+
> mode, per Rails conventions. If this is confusing or not desirable,
36+
> set `config.consider_all_requests_local = false` in
37+
> `config/environments/development.rb`

0 commit comments

Comments
 (0)