Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add syntax highting and formatting to code #18955

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,18 @@ To create multiple keys (user key or license key) in a single mutation, for mult

Example of creating a key:

```
```graphql
mutation {
apiAccessCreateKeys(keys: {ingest: {accountId: YOUR_ACCOUNT_ID, ingestType:
BROWSER, name: "Browser Key", notes: "A note."}}) {
apiAccessCreateKeys(
keys: {
ingest: {
accountId: YOUR_ACCOUNT_ID
ingestType: BROWSER
name: "Browser Key"
notes: "A note."
}
}
) {
createdKeys {
id
key
Expand Down Expand Up @@ -91,9 +99,16 @@ Here's an example of using this query to create a [user key](/docs/apis/get-star
>
To create a [user key](/docs/apis/get-started/intro-apis/types-new-relic-api-keys#user-api-key), you'd change the above query slightly, in the `keys` section:

```
```graphql
mutation {
apiAccessCreateKeys(keys: {user: {accountId: YOUR_ACCOUNT_ID, userId: YOUR_USER_ID}}) {
apiAccessCreateKeys(
keys: {
user: {
accountId: YOUR_ACCOUNT_ID,
userId: YOUR_USER_ID
}
}
) {
createdKeys {
id
key
Expand Down Expand Up @@ -123,10 +138,17 @@ Here's an example of using this query to create a [user key](/docs/apis/get-star

The update mutation takes the key ID, not the key string, to identify keys.

```
```graphql
mutation {
apiAccessUpdateKeys(keys: {ingest: {keyId: KEY_ID, name: "Updated name", notes:
"A new note!"}}) {
apiAccessUpdateKeys(
keys: {
ingest: {
keyId: KEY_ID,
name: "Updated name",
notes: "A new note!"
}
}
) {
updatedKeys {
id
key
Expand All @@ -147,9 +169,9 @@ Results will vary depending on your data. Use the [GraphiQL explorer](https://ap

The delete mutation takes the key ID, not the key string, to identify keys. Deleted keys will no longer grant access to New Relic systems and will no longer be returned by queries to the API access GraphQL API.

```
```graphql
mutation {
apiAccessDeleteKeys(keys: {ingestKeyIds: INGEST_KEY_ID}) {
apiAccessDeleteKeys(keys: { ingestKeyIds: INGEST_KEY_ID }) {
deletedKeys {
id
}
Expand All @@ -168,7 +190,7 @@ You can access ingest and user keys by querying a single key or all keys, scoped

Single key example query:

```
```graphql
query {
actor {
apiAccess {
Expand All @@ -187,11 +209,16 @@ query {

Key search example query:

```
```graphql
query {
actor {
apiAccess {
keySearch(query: {types: INGEST, scope: {ingestTypes: BROWSER}}) {
keySearch(query: {
types: INGEST,
scope: {
ingestTypes: BROWSER
}
}) {
keys {
name
key
Expand Down
Loading