Skip to content

Commit 9a1ead5

Browse files
committed
Updats for new v1/graphql endpoint
1 parent 0987aca commit 9a1ead5

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff 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

133133
See: [`./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

app/lib/urql.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
},

scripts/fetchGraphQLSchema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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");

0 commit comments

Comments
 (0)