+++-+-Before, struggle with SQL+type User struct { gorm.Model Profile Profile @@ -50,8 +50,9 @@ db.Model(&user). and more ...-With Super Graph, just ask.+ ++With Super Graph, just ask.query { user(id: 5) { @@ -59,26 +60,24 @@ query { first_name last_name picture_url - } - posts(first: 20, order_by: { score: desc }) { - slug - title - created_at - cached_votes_total - vote(where: { user_id: { eq: $user_id } }) { - id + posts(first: 20, order_by: { score: desc }) { + slug + title + created_at + votes_total + votes { created_at } + author { id name } + tags { id name } } - author { id name } - tags { id name } + posts_cursor } - posts_cursor }+--{{ feature.title }}
-{{ feature.details }}
+{{ feature.title }}
+{{ feature.details }}-++---- -- -- -- --+Try Super Graph @@ -133,20 +119,18 @@ query {
Deploy as a service using docker
-+-- -$ git clone https://github.com/dosco/super-graph && cd super-graph && make install$ super-graph new blog; cd blog$ docker-compose run blog_api ./super-graph db:setup$ docker-compose upOr use it with your own code
-+package main import ( @@ -194,7 +178,7 @@ func main() {+--> -The story of {{ data.heroText }} @@ -245,7 +229,7 @@ func main() {
+-@@ -267,7 +251,101 @@ func main() {+++ +++++ +No more joins joins, json, orms, just use GraphQL. Fetch all the data want in the structure you need.++query { + thread { + slug + title + published + createdAt : created_at + totalVotes : cached_votes_total + totalPosts : cached_posts_total + vote : thread_vote(where: { user_id: { eq: $user_id } }) { + created_at + } + topics { + slug + name + } + author : me { + slug + } + posts(first: 1, order_by: { score: desc }) { + slug + body + published + createdAt : created_at + totalVotes : cached_votes_total + totalComments : cached_comments_total + vote { + created_at + } + author : user { + slug + firstName : first_name + lastName : last_name + } + } + posts_cursor + } +} ++++Instant results using a single highly optimized SQL. It's just that simple.++{ + "data": { + "thread": { + "slug": "eveniet-ex-24", + "vote": null, + "posts": [ + { + "body": "Dolor laborum harum sed sit est ducimus temporibus velit non nobis repudiandae nobis suscipit commodi voluptatem debitis sed voluptas sequi officia.", + "slug": "illum-in-voluptas-1418", + "vote": null, + "author": { + "slug": "sigurd-kemmer", + "lastName": "Effertz", + "firstName": "Brandt" + }, + "createdAt": "2020-04-07T04:22:42.115874+00:00", + "published": true, + "totalVotes": 0, + "totalComments": 2 + } + ], + "title": "In aut qui deleniti quia dolore quasi porro tenetur voluptatem ut adita alias fugit explicabo.", + "author": null, + "topics": [ + { + "name": "CloudRun", + "slug": "cloud-run" + }, + { + "name": "Postgres", + "slug": "postgres" + } + ], + "createdAt": "2020-04-07T04:22:38.099482+00:00", + "published": true, + "totalPosts": 24, + "totalVotes": 0, + "posts_cursor": "mpeBl6L+QfJHc3cmLkLDj9pOdEZYTt5KQtLsazG3TLITB3hJhg==" + } + } +} ++-Build Secure Apps @@ -292,8 +370,8 @@ func main() {
-++More Features
diff --git a/docs/guide/.vuepress/styles/index.styl b/docs/guide/.vuepress/styles/index.styl index b91bea9..16b3ff0 100644 --- a/docs/guide/.vuepress/styles/index.styl +++ b/docs/guide/.vuepress/styles/index.styl @@ -1,6 +1,9 @@ @tailwind base; @css { + body, .navbar, .navbar .links { + @apply bg-white text-black border-0 !important; + } h1 { @apply font-semibold text-3xl border-0 py-4 }