Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can run queries on real Scope data using any HTTP compliant client (HTTP Client) or GraphQL integrated development environment (GraphQL IDE). GraphQL IDEs are typically easier to work with because they include docs, syntax highlighting, and validation errors.

...

Scope GraphQL Explorer is an instance of GraphiQL (a GraphQL IDE) that is available in-browser at https://cms.scopear.com/api/v3/graphql/explorer.

Note

Note: The Scope GraphQL Explorer has been temporarily disabled, but you can still explore the graph using a local GraphiQL client, or any other similar client (see below).

Using GraphiQL

To use the GraphiQL app, download and install it from https://www.electronjs.org/apps/graphiql.

...

Code Block
{
  "data": null,
  "errors": [
    {
      "message": "Objects must have selections (field 'nodes' returns User but has no selections)",
      "locations": [
        {
          "line": 5,
          "column": 8
        }
      ]
    }
  ]
}

Authorization errors

Authorization errors indicate that the current user does not have sufficient privileges to access a requested node (or nodes).

If you receive an authorization error, contact your internal administrator to request that additional privileges be added to your user account (see “Managing Access Control Rights”).

Currently, no documentation is available which describes the precise rules governing the authorization of each user license type, however Scope intends to add this documentation in the near future.

By way of example, the following query will trigger the following authorization error response when the user executing the query isn’t authorized to read the node identified by id YQLXlUig57gDr1aAak2ojlH98qqDttCUIUwR_Y-MPJRWrdX0sgvvjiOj6fXusYeG:

Code Block
query {
  node(id:"YQLXlUig57gDr1aAak2ojlH98qqDttCUIUwR_Y-MPJRWrdX0sgvvjiOj6fXusYeG") {
   ... on ScenarioSession {
      createdAt
    }
  }
}
Code Block
{
  "data": {
    "node": null
  },
  "errors": [
    {
      "message": "Not authorized to read object",
      "locations": [
        {
          "line": 23,
          "column": 3
        }
      ],
      "path": [
        "node"
      ]
    }
  ]
}

Unauthorized nodes that are part of many-to-one relationships (aka “Connections”) are automatically pruned from the response without triggering an error, whereas unauthorized nodes that belong to one-to-one relationships trigger an error. For example, the node in the previous example will be silently removed from the response to the following query without triggering an error:

Code Block
query {
  viewer {
    organization {
      scenarios {
        nodes {
          sessions {
            nodes {
              id
            }
          }
        }
      }
    }
  }
}  

Unexpected errors

It's possible you might run into an unexpected error that is not related to the schema. If this happens, the message will include a reference code you can use when reporting the issue to support:

Code Block
{
  "data": null,
  "errors": [
    {
      "message": "Something went wrong while executing your query. This is most likely a Scope bug. Please include \"7571:3FF6:552G94B:69F45B7:5913BBEQ\" when reporting this issue."
    }
  ]
}

...

Note

Scope 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.

If you need help, see Requesting support.

...