File tree Expand file tree Collapse file tree 5 files changed +46
-8
lines changed Expand file tree Collapse file tree 5 files changed +46
-8
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ yarn workspace app dev
8585
8686### Synchronize the GraphQL schema
8787
88- Note: You need to call ` graphql.rebuild_schema() ` manually to synchronize the GraphQL schema with the SQL schema after altering the SQL schema.
88+ Note: You need to call ` select graphql.rebuild_schema()` manually to synchronize the GraphQL schema with the SQL schema after altering the SQL schema.
8989
9090#### Manage Schema with dbmate
9191
@@ -132,9 +132,9 @@ See: [`./graphql/schema/schema.graphql`](./graphql/schema/schema.graphql)
132132
133133See: [ ` ./graphql/queries/ ` ] ( ./graphql/queries/ )
134134
135- Use: ` https://mvrfvzcivgabojxddwtk.supabase.co/rest /v1/rpc/graphql `
135+ Use: ` https://mvrfvzcivgabojxddwtk.supabase.co/graphql /v1 `
136136
137- Note: Needs headers
137+ > Note: Needs headers
138138
139139```
140140
@@ -143,6 +143,28 @@ apiKey: <supabase_anon_key>
143143
144144```
145145
146+ ## GraphiQL
147+
148+ GraphiQL is an in-browser IDE for writing, validating, and testing GraphQL queries.
149+
150+ Visit ` http://localhost:3000/api/graphiql ` for the [ Yoga GraphiQL Playground] ( https://www.graphql-yoga.com/docs/features/graphiql ) where you can experiment with queries and mutations.
151+
152+ > Note: Needs headers
153+
154+ ```
155+
156+ Content-Type: application/json
157+ apiKey: <supabase_anon_key>
158+
159+ ```
160+
161+ > Note: In order for the RLS policies authenticate you. you've have to pass an authorization header:
162+
163+ ```
164+ authorization: Bearker <access_token>
165+
166+ ```
167+
146168### Ranked Feed
147169
148170``` gql
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { useMutation } from "urql";
66
77import { Auth } from "@supabase/ui" ;
88import { TrashIcon } from "@heroicons/react/outline" ;
9-
9+ import { CalendarIcon , UserIcon } from "./icons" ;
1010import { DocumentType , gql } from "../gql" ;
1111import { timeAgo } from "./time-ago" ;
1212
@@ -16,6 +16,7 @@ const CommentItem_CommentFragment = gql(/* GraphQL */ `
1616 message
1717 createdAt
1818 post {
19+ id
1920 title
2021 }
2122 profile {
@@ -63,10 +64,19 @@ export function CommentItem(props: {
6364 < div className = "flex items-center justify-between" >
6465 < h3 className = "text-sm font-medium" >
6566 < Link href = { `/profile/${ props . comment . profile ?. id } ` } >
66- < a className = "text-gray-800" > { props . comment . profile ?. username } </ a >
67+ < a className = "text-gray-800 hover:text-green-500" >
68+ { props . comment . profile ?. username }
69+ </ a >
6770 </ Link >
6871 </ h3 >
69- < p className = "text-sm text-gray-500" > { createdAt } </ p >
72+ < p className = "text-sm text-gray-500" >
73+ < Link href = { `/item/${ props . comment . post ?. id } ` } >
74+ < a className = "text-gray-800 hover:text-green-500 inline-flex items-center text-sm" >
75+ < CalendarIcon className = "w-4 h-4 mr-1" />
76+ { createdAt }
77+ </ a >
78+ </ Link >
79+ </ p >
7080 </ div >
7181 < p className = "text-sm text-gray-500" >
7282 { props . comment . message }
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export function UrqlProvider(props: { children: React.ReactNode }) {
2020
2121 const [ client ] = React . useState ( function createUrqlClient ( ) {
2222 return createClient ( {
23- url : `${ process . env . NEXT_PUBLIC_SUPABASE_URL ! } /rest /v1/rpc/graphql ` ,
23+ url : `${ process . env . NEXT_PUBLIC_SUPABASE_URL ! } /graphql /v1` ,
2424 fetchOptions : function createFetchOptions ( ) {
2525 return { headers : getHeaders ( ) } ;
2626 } ,
Original file line number Diff line number Diff line change 11import React from "react" ;
22import type { NextPage } from "next" ;
3+ import Head from "next/head" ;
34import { Auth } from "@supabase/ui" ;
45import { useSupabaseClient } from "../lib/supabase" ;
56import { useRouter } from "next/router" ;
@@ -23,6 +24,11 @@ const LogIn: NextPage = () => {
2324
2425 return (
2526 < Container >
27+ < Head >
28+ < title > supanews | Login</ title >
29+ < meta name = "description" content = "Sign in to submit posts and vote." />
30+ < link rel = "icon" href = "/favicon.ico" />
31+ </ Head >
2632 < MainSection >
2733 < div className = "m-width-md mx-auto" >
2834 < h1 className = "font-semibold text-xl tracking-tight mb-5" > Login</ h1 >
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ console.log(
5858 )
5959) ;
6060
61- fetchGraphQLSchema ( `${ process . env . SUPABASE_URL } /rest /v1/rpc/graphql ` , {
61+ fetchGraphQLSchema ( `${ process . env . SUPABASE_URL } /graphql /v1` , {
6262 readable : true ,
6363} ) . then ( ( schema ) => {
6464 fs . writeFileSync ( filePath , schema , "utf-8" ) ;
You can’t perform that action at this time.
0 commit comments