docs(graphql): create graphql best practices (#12229)

This commit is contained in:
david-leifker 2024-12-30 21:04:17 -06:00 committed by GitHub
parent ee54f1fb61
commit 96c60580a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 1054 additions and 0 deletions

View File

@ -780,6 +780,11 @@ module.exports = {
label: "Getting Started With GraphQL",
id: "docs/api/graphql/getting-started",
},
{
type: "doc",
label: "GraphQL Best Practices",
id: "docs/api/graphql/graphql-best-practices",
},
{
type: "doc",
label: "Access Token Management",

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,6 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# How To Set Up GraphQL
## Preparing Local Datahub Deployment
@ -29,6 +32,7 @@ DataHub provides a browser-based GraphQL Explorer Tool ([GraphiQL](https://githu
This interface allows you to easily craft queries and mutations against real metadata stored in your live DataHub deployment.
To experiment with GraphiQL before deploying it in your live DataHub deployment, you can access a demo site provided by DataHub at https://demo.datahubproject.io/api/graphiql.
For instance, you can create a tag by posting the following query:
```json
@ -43,6 +47,29 @@ mutation createTag {
For a detailed usage guide, check out [How to use GraphiQL](https://www.gatsbyjs.com/docs/how-to/querying-data/running-queries-with-graphiql/).
To navigate to `GraphiQL` on the demo site or your local instance, select `GraphiQL` from the user profile drop-down menu as
shown below.
<Tab>
<TabItem value="DataHub" label="DataHub" default>
<p align="center">
<img width="90%" src="https://raw.githubusercontent.com/datahub-project/static-assets/main/imgs/api/graphql/how-to-set-up-graphql/datahub_graphiql_link.png"/>
</p>
![graphiql_link.png](../../../../../Desktop/datahub_graphiql_link.png)
</TabItem>
<TabItem value="DataHubCloud" label="DataHub Cloud">
<p align="center">
<img width="90%" src="https://raw.githubusercontent.com/datahub-project/static-assets/main/imgs/api/graphql/how-to-set-up-graphql/datahubcloud_graphiql_link.png"/>
</p>
</TabItem>
</Tab>
This link will then display the following interface for exploring GraphQL queries.
<p align="center">
<img width="90%" src="https://raw.githubusercontent.com/datahub-project/static-assets/main/imgs/api/graphql/how-to-set-up-graphql/datahub_graphiql.png"/>
</p>
### CURL
CURL is a command-line tool used for transferring data using various protocols including HTTP, HTTPS, and others.