Skip to content
Open
Show file tree
Hide file tree
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
53 changes: 53 additions & 0 deletions snippets/graphql/get-scorecard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# How to use this

This query will retrieve all specified information for a given scorecard.

Replace `scorecardARI` below in the variables section with a valid Compass component ARI in your site and execute the query. You can use [the GraphQL explorer](https://developer.atlassian.com/cloud/compass/graphql/explorer/) to run this query and explore [the Compass API](https://developer.atlassian.com/cloud/compass/graphql/) further.

### Query

```graphql
query getScorecard($scorecardARI: ID!) {
compass {
scorecard(id: $scorecardARI) {
__typename
... on CompassScorecard {
id
name
description
ownerId
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got an error when running this query in the explorer. Does the latest version still use ownerId? It worked with the following, though:

owner {
    id
}

importance
componentType
criterias {
id
weight
}
}
... on QueryError {
message
extensions {
statusCode
errorType
}
}
}
}
}
```

### Query Headers

```
{
"X-ExperimentalApi": ["compass-beta","compass-prototype"]
}
```

### Query Variables

```
{
"scorecardARI": "your-scorecard-ari"
# "scorecardARI": "ari:cloud:compass:8c9fa0a4-58bf-4a52-a1c2-fb9d071abcbd:scorecard/b17a5c71-52a9-4a98-a1a1-d3bdaba73178/01a7bf71-4cc2-4ab0-ad03-6aab38ec92ea"
}
```
26 changes: 26 additions & 0 deletions snippets/graphql/get-scorecard/getScorecard.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
query getScorecard($scorecardARI: ID!) {
compass {
scorecard(id: $scorecardARI) {
__typename
... on CompassScorecard {
id
name
description
ownerId
importance
componentType
criterias {
id
weight
}
}
... on QueryError {
message
extensions {
statusCode
errorType
}
}
}
}
}