Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: update images for blog post

Jonathan Summers-Muirbe4b9e063547
diff --git a/www/_blog/2022-03-29-graphql-now-available.mdx b/www/_blog/2022-03-29-graphql-now-available.mdx
index e1174363528..98cbdcebd65 100644
--- a/www/_blog/2022-03-29-graphql-now-available.mdx
+++ b/www/_blog/2022-03-29-graphql-now-available.mdx
@@ -2,8 +2,8 @@
title: 'GraphQL is now available in Supabase'
description: GraphQL support is now in general availability on the Supabase platform via our open source PostgreSQL extension, pg_graphql (beta).
author: oli_rice,dthyresson
-image: launch-week-4/community-day/community-day-thumb.png
-thumb: launch-week-4/community-day/community-day-thumb.png
+image: launch-week-4/tuesday-graphql/graphql-thumb.png
+thumb: launch-week-4/tuesday-graphql/graphql-thumb.png
tags:
- launch-week
- graphql
@@ -11,10 +11,10 @@ date: '2022-03-29'
toc_depth: 3
---
-GraphQL support is now in general availability on the Supabase platform via our [open source](https://github.com/supabase/pg_graphql/) PostgreSQL extension,
+GraphQL support is now in general availability on the Supabase platform via our [open source](https://github.com/supabase/pg_graphql/) PostgreSQL extension,
[`pg_graphql](https://supabase.github.io/pg_graphql/) (beta)`.
-![supameme.png](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/37484f92-884a-4690-8dbd-c878106faad4/supameme.png)
+![supameme.png](/images/blog/launch-week-4/tuesday-graphql/supameme.png)
`pg_graphql` enables you to query existing PostgreSQL databases using GraphQL, either from within SQL or over HTTP:
@@ -122,27 +122,27 @@ An advantage to embedding GraphQL directly in the database is that we can lean o
### Authentication
-The GraphQL types exposed by `pg_graphql` are filtered according to the SQL role's [INSERT/UPDATE/DELETE permissions](https://www.postgresql.org/docs/current/sql-grant.html).
-At Supabase, each API request is resolved in the database using the role in the request's JWT.
+The GraphQL types exposed by `pg_graphql` are filtered according to the SQL role's [INSERT/UPDATE/DELETE permissions](https://www.postgresql.org/docs/current/sql-grant.html).
+At Supabase, each API request is resolved in the database using the role in the request's JWT.
-Anonymous users receive the `anon` role, and logged in users get the `authenticated` role. In either case, pg_graphql resolves requests according to the SQL permissions.
-The [introspection schema](https://graphql.org/learn/introspection/) is similarly filtered to limit exposed types and fields to those that the user has permission to access.
+Anonymous users receive the `anon` role, and logged in users get the `authenticated` role. In either case, pg_graphql resolves requests according to the SQL permissions.
+The [introspection schema](https://graphql.org/learn/introspection/) is similarly filtered to limit exposed types and fields to those that the user has permission to access.
That means we can serve multiple GraphQL schemas for users of differing privilege levels from a single endpoint!
### Authorization
-Another nice side effect of making PostgreSQL do the heavy lifting is that GraphQL queries respect your existing
+Another nice side effect of making PostgreSQL do the heavy lifting is that GraphQL queries respect your existing
[row level security policies](https://www.postgresql.org/docs/current/ddl-rowsecurity.html) right out-of-the-box. No additional configuration required.
## Performance
-Each [free tier database](https://supabase.com/pricing) on the Supabase platform runs on a dedicated AWS t4g.micro instance with 2 vCPUs and 1 GB of memory.
+Each [free tier database](https://supabase.com/pricing) on the Supabase platform runs on a dedicated AWS t4g.micro instance with 2 vCPUs and 1 GB of memory.
To squeeze the most out of that limited hardware we had to make a few significant optimizations:
**GraphQL queries are always transpiled into exactly one SQL query**
-The SQL queries select and aggregate requested data into the shape of the GraphQL JSON response.
-In addition to solving the [N+1 query problem](https://medium.com/the-marcy-lab-school/what-is-the-n-1-problem-in-graphql-dd4921cb3c1a), a common issue with GraphQL resolvers,
+The SQL queries select and aggregate requested data into the shape of the GraphQL JSON response.
+In addition to solving the [N+1 query problem](https://medium.com/the-marcy-lab-school/what-is-the-n-1-problem-in-graphql-dd4921cb3c1a), a common issue with GraphQL resolvers,
GraphQL queries requiring multiple joins typically produce significantly less IO due to reduced data duplication.
For example, when selecting all comments for a blog post:
@@ -153,18 +153,18 @@ select
comments.body as comment_body
from
blog_posts
-join
+join
comments on blog_posts.id = comments.blog_post_id
```
a SQL response would duplicate all data from the `blog_posts` table (title).
```markdown
-| title | comment_body |
-|-----------|--------------------------------|
-|F1sRt P0$T | this guy gets it! |
-|F1sRt P0$T | you should re-write it in rust |
-|F1sRt P0$T | 10% off daily vitamin http:... |
+| title | comment_body |
+| ---------- | ------------------------------ |
+| F1sRt P0$T | this guy gets it! |
+| F1sRt P0$T | you should re-write it in rust |
+| F1sRt P0$T | 10% off daily vitamin http:... |
```
Compared to the equivalent GraphQL response.
@@ -173,7 +173,7 @@ Compared to the equivalent GraphQL response.
{
"blogPostCollection": {
"edges": {
- "node":
+ "node":
"title": "F1sRt P0$T"
"commentCollection": {
"edges": [
@@ -202,12 +202,12 @@ The difference in payload size is negligible in this case, but as the number of
After a GraphQL query is transpiled to SQL, it is added to the prepared statement cache so subsequent requests with the same structure (think pagination) can skip the transpilation step.
-Using prepared statements also allows PostgreSQL to skip the overhead of computing a query plan. For small, on-index, queries,
+Using prepared statements also allows PostgreSQL to skip the overhead of computing a query plan. For small, on-index, queries,
the query planning step can take several times as long as the query's execution time, so the saving is significant at scale.
**All operations are bulk**
-Finally, all reflected query and mutation fields support bulk operations to nudge users towards consuming the API efficiently.
+Finally, all reflected query and mutation fields support bulk operations to nudge users towards consuming the API efficiently.
Batching similar operations reduces network round-trips and time spent in the database.
**Result**
@@ -228,7 +228,7 @@ To enable GraphQL in your Supabase instance, enable `pg_graphql` from the dashbo
[api-enable-graphql.mp4](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/d83930c3-53c0-4b7a-9f65-6ded53f072b7/api-enable-graphql.mp4)
-Or create the extension in your database
+Or create the extension in your database
```sql
create extension pg_graphql;
@@ -240,27 +240,27 @@ The GraphQL endpoint is available at: `https://<project_ref>.supabase.co/graphql
## Example app: Build a HN clone with Postgres and GraphQL
-![Untitled](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/f07c93ed-3200-423c-bb49-d751c776c75f/Untitled.png)
+![graph-ql-example-app.png](/images/blog/launch-week-4/tuesday-graphql/graph-ql-example-app.png)
-We're excited to have worked with [The Guild](https://www.the-guild.dev) to show you [how to use](https://supabase-graphql-example.vercel.app/about) `pg_graphql`
+We're excited to have worked with [The Guild](https://www.the-guild.dev) to show you [how to use](https://supabase-graphql-example.vercel.app/about) `pg_graphql`
and their tools to build a [HackerNews clone](https://supabase-graphql-example.vercel.app/).
The [demo application](https://supabase-graphql-example.vercel.app/) showcases:
-- **CRUD (Query + Mutation Operations).**
-Data is fetched from the GraphQL layer auto-generated via `pg_graphql`.
-- **Cursor Based Pagination.**
-`pg_graphql` generates standardized pagination types and fields as defined by the GraphQL Cursor Connections Specification.
-- **Authorization / RLS.**
-GraphQL requests made include Supabase authorization headers so that Row Level Security on the Postgres layer ensures that viewers can only access what they are allowed to — and authenticated users can only update what they should.
-- **Code generation.**
-Introspect your GraphQL schema and operations to generates the types for full backend to frontend type-safety.
-- **Postgres Triggers and Functions.**
-Recalculate the feed scoring each time someone votes.
-- **Supabase UI.**
-Use Auth widget straight out the box to handle logins and access tokens.
-
-![Untitled](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/531ecdd3-9039-414f-8097-6b9b41c95eb1/Untitled.png)
+- **CRUD (Query + Mutation Operations).**
+ Data is fetched from the GraphQL layer auto-generated via `pg_graphql`.
+- **Cursor Based Pagination.**
+ `pg_graphql` generates standardized pagination types and fields as defined by the GraphQL Cursor Connections Specification.
+- **Authorization / RLS.**
+ GraphQL requests made include Supabase authorization headers so that Row Level Security on the Postgres layer ensures that viewers can only access what they are allowed to — and authenticated users can only update what they should.
+- **Code generation.**
+ Introspect your GraphQL schema and operations to generates the types for full backend to frontend type-safety.
+- **Postgres Triggers and Functions.**
+ Recalculate the feed scoring each time someone votes.
+- **Supabase UI.**
+ Use Auth widget straight out the box to handle logins and access tokens.
+
+![graph-ql-example-app-2.png](/images/blog/launch-week-4/tuesday-graphql/graph-ql-example-app-2.png)
Now instead of using the Supabase PostgREST API to query your database ...
@@ -296,12 +296,12 @@ query ProfilesQuery {
## Supabase + The Guild
-Image
+![graphql-supabase-guild.png](/images/blog/launch-week-4/tuesday-graphql/graphql-supabase-guild.png)
This is just the start of what we hope to be a close collaboration with the Guild, whose expertise of the GraphQL ecosystem will guide the development of Supabase's GraphQL features.
- The Guild and Supabase share a similar approach to open source - we both favor collaboration and composability, making collaboration easy and productive.
+The Guild and Supabase share a similar approach to open source - we both favor collaboration and composability, making collaboration easy and productive.
-Be sure to visit [The Guild](https://www.the-guild.dev) and [follow them](https://twitter.com/TheGuildDev) to stay informed of the latest developments in GraphQL.
+Be sure to visit [The Guild](https://www.the-guild.dev) and [follow them](https://twitter.com/TheGuildDev) to stay informed of the latest developments in GraphQL.
## Limitations & Roadmap
@@ -314,4 +314,4 @@ Our first general availability release of `pg_graphql` supports:
In the near term, we plan to fully support array and json/b types. Longer term, we intend to support views and custom mutations from user defined functions.
-Didn't see the feature you're interested in? [Let us know](https://github.com/supabase/pg_graphql/issues)
\ No newline at end of file
+Didn't see the feature you're interested in? [Let us know](https://github.com/supabase/pg_graphql/issues)
diff --git a/www/pages/blog.tsx b/www/pages/blog.tsx
index f11fc03261a..6f844a88c52 100644
--- a/www/pages/blog.tsx
+++ b/www/pages/blog.tsx
@@ -168,26 +168,28 @@ function FeaturedThumb(blog: PostTypes) {
<p className="p text-xl">{blog.description}</p>
</div>
- {author.map((author: any) => {
- return (
- <div className="flex space-x-3 items-center">
- {author.author_image_url && (
- <div className="relative overflow-auto w-10 h-10">
- <Image
- src={author.author_image_url}
- className="rounded-full"
- layout="fill"
- objectFit="cover"
- />
+ <div className="flex flex-col gap-4">
+ {author.map((author: any) => {
+ return (
+ <div className="flex space-x-3 items-center">
+ {author.author_image_url && (
+ <div className="relative overflow-auto w-10 h-10">
+ <Image
+ src={author.author_image_url}
+ className="rounded-full"
+ layout="fill"
+ objectFit="cover"
+ />
+ </div>
+ )}
+ <div className="flex flex-col">
+ <span className="m-0 text-sm text-scale-1200">{author.author}</span>
+ <span className="m-0 text-xs text-scale-900">{author.position}</span>
</div>
- )}
- <div className="flex flex-col">
- <span className="m-0 text-sm text-scale-1200">{author.author}</span>
- <span className="m-0 text-xs text-scale-900">{author.position}</span>
</div>
- </div>
- )
- })}
+ )
+ })}
+ </div>
</div>
</a>
</a>
diff --git a/www/pages/blog/[year]/[month]/[day]/[slug].tsx b/www/pages/blog/[year]/[month]/[day]/[slug].tsx
index bacfd356040..e5070c4ab0f 100644
--- a/www/pages/blog/[year]/[month]/[day]/[slug].tsx
+++ b/www/pages/blog/[year]/[month]/[day]/[slug].tsx
@@ -215,7 +215,7 @@ function BlogPostPage(props: any) {
<p>•</p>
<p>{generateReadingTime(props.blog.content.renderedOutput)}</p>
</div>
- <div className="flex">
+ <div className="flex gap-3">
{author.map((author: any) => {
return (
<div className="mt-6 mb-8 mr-4 lg:mb-0 w-max">
diff --git a/www/public/images/blog/launch-week-4/tuesday-graphql/graph-ql-example-app-2.png b/www/public/images/blog/launch-week-4/tuesday-graphql/graph-ql-example-app-2.png
new file mode 100644
index 00000000000..48135bd5ad3
Binary files /dev/null and b/www/public/images/blog/launch-week-4/tuesday-graphql/graph-ql-example-app-2.png differ
diff --git a/www/public/images/blog/launch-week-4/tuesday-graphql/graph-ql-example-app.png b/www/public/images/blog/launch-week-4/tuesday-graphql/graph-ql-example-app.png
new file mode 100644
index 00000000000..a2b4123bbdb
Binary files /dev/null and b/www/public/images/blog/launch-week-4/tuesday-graphql/graph-ql-example-app.png differ
diff --git a/www/public/images/blog/launch-week-4/tuesday-graphql/graphql-supabase-guild.png b/www/public/images/blog/launch-week-4/tuesday-graphql/graphql-supabase-guild.png
new file mode 100644
index 00000000000..68639a1180a
Binary files /dev/null and b/www/public/images/blog/launch-week-4/tuesday-graphql/graphql-supabase-guild.png differ
diff --git a/www/public/images/blog/launch-week-4/tuesday-graphql/graphql-thumb.png b/www/public/images/blog/launch-week-4/tuesday-graphql/graphql-thumb.png
new file mode 100644
index 00000000000..692659a0ed6
Binary files /dev/null and b/www/public/images/blog/launch-week-4/tuesday-graphql/graphql-thumb.png differ
diff --git a/www/public/images/blog/launch-week-4/tuesday-graphql/supameme.png b/www/public/images/blog/launch-week-4/tuesday-graphql/supameme.png
new file mode 100644
index 00000000000..2d912cbccc3
Binary files /dev/null and b/www/public/images/blog/launch-week-4/tuesday-graphql/supameme.png differ
diff --git a/www/public/rss.xml b/www/public/rss.xml
index 41057c7bce5..67966f0f188 100644
--- a/www/public/rss.xml
+++ b/www/public/rss.xml
@@ -5,9 +5,17 @@
<link>https://supabase.com</link>
<description>Latest news from Supabase</description>
<language>en</language>
- <lastBuildDate>Sun, 27 Mar 2022 22:00:00 GMT</lastBuildDate>
+ <lastBuildDate>Mon, 28 Mar 2022 22:00:00 GMT</lastBuildDate>
<atom:link href="https://supabase.com/blog/rss.xml" rel="self" type="application/rss+xml"/>
+<item>
+ <guid>https://supabase.com/blog/2022/03/29/graphql-now-available</guid>
+ <title>GraphQL is now available in Supabase</title>
+ <link>https://supabase.com/blog/2022/03/29/graphql-now-available</link>
+ <description>GraphQL support is now in general availability on the Supabase platform via our open source PostgreSQL extension, pg_graphql (beta).</description>
+ <pubDate>Mon, 28 Mar 2022 22:00:00 GMT</pubDate>
+</item>
+
<item>
<guid>https://supabase.com/blog/2022/03/28/community-day</guid>
<title>Community Day</title>
diff --git a/www/tailwind.config.js b/www/tailwind.config.js
index a17c3249073..1806eb442ee 100644
--- a/www/tailwind.config.js
+++ b/www/tailwind.config.js
@@ -82,6 +82,10 @@ module.exports = ui({
padding: 0,
marginBottom: '32px',
},
+ img: {
+ borderRadius: '4px',
+ overflow: 'hidden',
+ },
},
},