1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Fix inconsistent alerts by using the markdown notation - part 2 (#35221)

Co-authored-by: Alex Nguyen <150945400+nguyenalex836@users.noreply.github.com>
This commit is contained in:
Artur Kordowski
2024-11-08 18:20:31 +01:00
committed by GitHub
parent 0208d54f08
commit b1a68cb155
292 changed files with 1230 additions and 2749 deletions

View File

@@ -63,11 +63,8 @@ curl -H "Authorization: bearer TOKEN" -X POST -d " \
" {% data variables.product.graphql_url %}
```
{% tip %}
**Note**: The string value of `"query"` must escape newline characters or the schema will not parse it correctly. For the `POST` body, use outer double quotes and escaped inner double quotes.
{% endtip %}
> [!NOTE]
> The string value of `"query"` must escape newline characters or the schema will not parse it correctly. For the `POST` body, use outer double quotes and escaped inner double quotes.
### About query and mutation operations
@@ -115,11 +112,8 @@ For a real-world example, see "[Example mutation](#example-mutation)."
[Variables](https://graphql.org/learn/queries/#variables) can make queries more dynamic and powerful, and they can reduce complexity when passing mutation input objects.
{% note %}
**Note**: If you're using the Explorer, make sure to enter variables in the separate [Query Variables pane](/graphql/guides/using-the-explorer#using-the-variable-pane), and do not include the word `variables` before the JSON object.
{% endnote %}
> [!NOTE]
> If you're using the Explorer, make sure to enter variables in the separate [Query Variables pane](/graphql/guides/using-the-explorer#using-the-variable-pane), and do not include the word `variables` before the JSON object.
Here's an example query with a single variable:
@@ -319,11 +313,8 @@ Let's examine the query line by line:
When we run the query, we get the `id`: `MDU6SXNzdWUyMzEzOTE1NTE=`
{% tip %}
**Note**: The `id` returned in the query is the value we'll pass as the `subjectID` in the mutation. Neither the docs nor schema introspection will indicate this relationship; you'll need to understand the concepts behind the names to figure this out.
{% endtip %}
> [!NOTE]
> The `id` returned in the query is the value we'll pass as the `subjectID` in the mutation. Neither the docs nor schema introspection will indicate this relationship; you'll need to understand the concepts behind the names to figure this out.
With the ID known, we can proceed with the mutation:

View File

@@ -118,11 +118,9 @@ GraphQL is [introspective](https://graphql.org/learn/introspection/). This means
curl -H "Authorization: bearer TOKEN" {% data variables.product.graphql_url %}
```
{% note %}
**Note**: If you get the response `"message": "Bad credentials"` or `401 Unauthorized`, check that you are using a valid token. If you receive a `403` error with `Resource not accessible by {% data variables.product.pat_generic %}`, ensure that your {% data variables.product.pat_v2 %} is targeted to the correct resource owner. For example, it must target the organization that owns the repository you are trying to access.
{% endnote %}
> [!NOTE]
> If you get the response `"message": "Bad credentials"` or `401 Unauthorized`, check that you are using a valid token. If you receive a `403` error with `Resource not accessible by {% data variables.product.pat_generic %}`, ensure that your {% data variables.product.pat_v2 %} is targeted to the correct resource owner. For example, it must target the organization that owns the repository you are trying to access.
The results are in JSON, so we recommend pretty-printing them for easier reading and searching. You can use a command-line tool like [jq](https://stedolan.github.io/jq/) or pipe the results into `python -m json.tool` for this purpose.
Alternatively, you can pass the `idl` media type to return the results in IDL format, which is a condensed version of the schema:
@@ -132,10 +130,7 @@ GraphQL is [introspective](https://graphql.org/learn/introspection/). This means
{% data variables.product.graphql_url %}
```
{% note %}
**Note**: The introspection query is probably the only `GET` request you'll run in GraphQL. If you're passing a body, the GraphQL request method is `POST`, whether it's a query or a mutation.
{% endnote %}
> [!NOTE]
> The introspection query is probably the only `GET` request you'll run in GraphQL. If you're passing a body, the GraphQL request method is `POST`, whether it's a query or a mutation.
For more information about performing queries, see "[AUTOTITLE](/graphql/guides/forming-calls-with-graphql)."

View File

@@ -13,11 +13,8 @@ topics:
You can access most objects in GitHub (users, issues, pull requests, etc.) using either the REST API or the GraphQL API. You can find the **global node ID** of many objects from within the REST API and use these IDs in your GraphQL operations. For more information, see "[Preview GraphQL API Node IDs in REST API resources](https://developer.github.com/changes/2017-12-19-graphql-node-id/)."
{% note %}
**Note:** In REST, the global node ID field is named `node_id`. In GraphQL, it's an `id` field on the `node` interface. For a refresher on what "node" means in GraphQL, see "[AUTOTITLE](/graphql/guides/introduction-to-graphql#node)."
{% endnote %}
> [!NOTE]
> In REST, the global node ID field is named `node_id`. In GraphQL, it's an `id` field on the `node` interface. For a refresher on what "node" means in GraphQL, see "[AUTOTITLE](/graphql/guides/introduction-to-graphql#node)."
## Putting global node IDs to use

View File

@@ -14,11 +14,10 @@ topics:
## About the GraphQL Explorer
{% ifversion ghec %}
{% note %}
**Note**: If your {% data variables.product.prodname_ghe_cloud %} organization uses {% data variables.product.prodname_dotcom %}'s IP allow list, you won't be able to use the GraphQL Explorer. Instead, we recommend using an alternative GraphQL client IDE.
> [!NOTE]
> If your {% data variables.product.prodname_ghe_cloud %} organization uses {% data variables.product.prodname_dotcom %}'s IP allow list, you won't be able to use the GraphQL Explorer. Instead, we recommend using an alternative GraphQL client IDE.
{% endnote %}
{% endif %}
{% ifversion fpt or ghec %}
@@ -92,11 +91,8 @@ There are many open source GraphQL client IDEs. For example, you can use Altair
1. In Altair, click on **Docs** on the top right, then the three dots and **Load Schema...**
1. Select the file public schema that you downloaded in an earlier step.
{% note %}
**Note**: For more information about why `POST` is the method, see "[AUTOTITLE](/graphql/guides/forming-calls-with-graphql#communicating-with-graphql)."
{% endnote %}
> [!NOTE]
> For more information about why `POST` is the method, see "[AUTOTITLE](/graphql/guides/forming-calls-with-graphql#communicating-with-graphql)."
You can test your access by querying yourself:
@@ -155,8 +151,5 @@ It's possible you might run into an unexpected error that is not related to the
}
```
{% note %}
**Note:** {% data variables.product.prodname_dotcom %} recommends checking for errors before using data in a production environment. In GraphQL, failure is not total: portions of GraphQL queries may succeed while others fail.
{% endnote %}
> [!NOTE]
> {% data variables.product.prodname_dotcom %} recommends checking for errors before using data in a production environment. In GraphQL, failure is not total: portions of GraphQL queries may succeed while others fail.

View File

@@ -16,11 +16,10 @@ autogenerated: graphql
For more information about how to use the explorer, see "[AUTOTITLE](/graphql/guides/using-the-explorer)."
{% ifversion ghec %}
{% note %}
**Note**: If your {% data variables.product.prodname_ghe_cloud %} organization uses {% data variables.product.prodname_dotcom %}'s IP allow list, you won't be able to use the GraphQL Explorer. Instead, we recommend using an alternative GraphQL client IDE.
> [!NOTE]
> If your {% data variables.product.prodname_ghe_cloud %} organization uses {% data variables.product.prodname_dotcom %}'s IP allow list, you won't be able to use the GraphQL Explorer. Instead, we recommend using an alternative GraphQL client IDE.
{% endnote %}
{% endif %}
<!-- Content after this section is automatically generated -->

View File

@@ -212,11 +212,8 @@ You can also roughly calculate the point value of a query before you make the qu
1. Add up the number of requests needed to fulfill each unique connection in the call. Assume every request will reach the `first` or `last` argument limits.
1. Divide the number by **100** and round the result to the nearest whole number to get the final aggregate point value. This step normalizes large numbers.
{% note %}
**Note**: The minimum point value of a call to the GraphQL API is **1**.
{% endnote %}
> [!NOTE]
> The minimum point value of a call to the GraphQL API is **1**.
Here's an example query and score calculation:

View File

@@ -16,10 +16,7 @@ During the preview period, we may change some features based on developer feedba
To access a schema preview, you'll need to provide a custom [media type](/rest/overview/media-types) in the `Accept` header for your requests. Feature documentation for each preview specifies which custom media type to provide.
{% note %}
> [!NOTE]
> The GraphQL schema members under preview cannot be accessed via the Explorer at this time.
**Note:** The GraphQL schema members under preview cannot be accessed via the Explorer at this time.
{% endnote %}
<!-- Content after this section is automatically generated -->
<!-- Content after this section is automatically generated -->

View File

@@ -19,10 +19,7 @@ Every GraphQL schema has a root type for both queries and mutations. The [query
For more information, see "[AUTOTITLE](/graphql/guides/forming-calls-with-graphql#about-queries)."
{% note %}
**Note:** For {% data variables.product.prodname_github_app %} requests made with user access tokens, you should use separate queries for issues and pull requests. For example, use the `is:issue` or `is:pull-request` filters and their equivalents. Using the `search` connection to return a combination of issues and pull requests in a single query will result in an empty set of nodes.
{% endnote %}
> [!NOTE]
> For {% data variables.product.prodname_github_app %} requests made with user access tokens, you should use separate queries for issues and pull requests. For example, use the `is:issue` or `is:pull-request` filters and their equivalents. Using the `search` connection to return a combination of issues and pull requests in a single query will result in an empty set of nodes.
<!-- Content after this section is automatically generated -->