mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-09-11 10:46:25 +03:00
Docs: Remove availability admonition
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10696 GitOrigin-RevId: 88c324b36f582bab8ba60148ad5f6b8b44a230de
This commit is contained in:
parent
4f1276dac1
commit
af0a457c0c
@ -22,62 +22,40 @@ will walk you through the process of creating a REST endpoint from a table.
|
||||
To see an alternative method of creating a REST endpoint from an query in the GraphiQL IDE, check out the
|
||||
[Create RESTified endpoints](/restified/create.mdx#create-from-graphiql) page.
|
||||
|
||||
:::info Data source availability
|
||||
|
||||
Available for **Postgres, MS SQL Server, Citus, AlloyDB and CockroachDB** databases.
|
||||
|
||||
:::
|
||||
|
||||
<SampleAppBlock dependent />
|
||||
|
||||
### Step 1: Navigate to the products table.
|
||||
|
||||
Navigate to `Data > default > public > products` and click the "Create REST Endpoints" button.
|
||||
|
||||
|
||||
<Thumbnail
|
||||
src="/img/restified/restified-create-from-table-btn.png"
|
||||
alt="Create RESTified Endpoint"
|
||||
/>
|
||||
<Thumbnail src="/img/restified/restified-create-from-table-btn.png" alt="Create RESTified Endpoint" />
|
||||
|
||||
### Step 2: Choose operations
|
||||
|
||||
After clicking on the "Create REST endpoints" button, you will see a modal list of all REST operations (`READ`, `READ
|
||||
ALL`, `CREATE`, `UPDATE`, `DELETE`) available on the table. Select `READ` and `CREATE` for this demo. Click the
|
||||
After clicking on the "Create REST endpoints" button, you will see a modal list of all REST operations (`READ`,
|
||||
`READ ALL`, `CREATE`, `UPDATE`, `DELETE`) available on the table. Select `READ` and `CREATE` for this demo. Click the
|
||||
"Create" button.
|
||||
|
||||
<Thumbnail
|
||||
src="/img/restified/restified-modal-from-table.png"
|
||||
alt="Create RESTified Endpoint"
|
||||
width="400px"
|
||||
/>
|
||||
<Thumbnail src="/img/restified/restified-modal-from-table.png" alt="Create RESTified Endpoint" width="400px" />
|
||||
|
||||
### Step 3: View all REST endpoints
|
||||
|
||||
You will be able to see the newly created REST endpoints listed in the `API > REST` tab.
|
||||
|
||||
<Thumbnail
|
||||
src="/img/restified/restified-tracked-table-view.png"
|
||||
alt="Create RESTified Endpoint"
|
||||
width="1000px"
|
||||
/>
|
||||
<Thumbnail src="/img/restified/restified-tracked-table-view.png" alt="Create RESTified Endpoint" width="1000px" />
|
||||
|
||||
### Step 4: Test the REST endpoint
|
||||
|
||||
Click on the `products_by_pk` title to get to the details page for that RESTified endpoint. In the "Request
|
||||
Variables" section for `id` enter the value `7992fdfa-65b5-11ed-8612-6a8b11ef7372`, the UUID for one of the products
|
||||
already in the `products` table of the docs sample app. Click "Run Request".
|
||||
Click on the `products_by_pk` title to get to the details page for that RESTified endpoint. In the "Request Variables"
|
||||
section for `id` enter the value `7992fdfa-65b5-11ed-8612-6a8b11ef7372`, the UUID for one of the products already in the
|
||||
`products` table of the docs sample app. Click "Run Request".
|
||||
|
||||
<Thumbnail
|
||||
src="/img/restified/restified-test.png"
|
||||
alt="Create RESTified Endpoint"
|
||||
width="1000px"
|
||||
/>
|
||||
<Thumbnail src="/img/restified/restified-test.png" alt="Create RESTified Endpoint" width="1000px" />
|
||||
|
||||
You will see the result returned next to the query.
|
||||
|
||||
You can test the other `insert_products_one` endpoint that we created in the same way by providing a new product
|
||||
object as the request variable.
|
||||
You can test the other `insert_products_one` endpoint that we created in the same way by providing a new product object
|
||||
as the request variable.
|
||||
|
||||
You can also use your favourite REST client to test the endpoint. For example, using `curl`:
|
||||
|
||||
@ -89,11 +67,11 @@ curl --location --request GET 'https://<your-hasura-project>.hasura.app/api/rest
|
||||
|
||||
## Recap
|
||||
|
||||
What just happened? Well, you just created two REST endpoints for reading a single product and inserting a product,
|
||||
What just happened? Well, you just created two REST endpoints for reading a single product and inserting a product,
|
||||
super fast, and without writing a single line of code 🎉
|
||||
|
||||
This saves you significant time and effort, as you easily enable REST endpoints on your tables or [convert any query
|
||||
or mutation into a REST endpoint](/restified/create.mdx) with just a few clicks.
|
||||
This saves you significant time and effort, as you easily enable REST endpoints on your tables or
|
||||
[convert any query or mutation into a REST endpoint](/restified/create.mdx) with just a few clicks.
|
||||
|
||||
By using RESTified endpoints, you can take advantage of the benefits of both REST and GraphQL, making your Hasura
|
||||
project even more versatile and powerful. For more details, check out the
|
||||
|
Loading…
Reference in New Issue
Block a user