Skip to content

Commit

Permalink
Merge pull request #447 from supabase/docs_primary_key
Browse files Browse the repository at this point in the history
docs: add primary key requirement in the API section in docs
  • Loading branch information
olirice authored Nov 7, 2023
2 parents c569b7c + 281287e commit e8e87a9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@ By default, PostgreSQL table and column names are not inflected when reflecting

Individual table, column, and relationship names may also be [manually overridden](configuration.md#tables-type).

## Primary Keys (Required)

Every table must have a primary key for it to be exposed in the GraphQL schema. For example, the following `Blog` table will be available in the GraphQL schema as `blogCollection` since it has a primary key named `id`:

```sql
create table "Blog"(
id serial primary key,
name varchar(255) not null,
);
```

But the following table will not be exposed because it doesn't have a primary key:

```sql
create table "Blog"(
id int,
name varchar(255) not null,
);
```


## QueryType

Expand Down

0 comments on commit e8e87a9

Please sign in to comment.