Learn useful terminology and concepts for related to using the Scope GraphQL API.
For more information, visit https://graphql.org/.
In this article
...
A specification. The spec determines the validity of the schema on the API server. The schema determines the validity of client calls.
Strongly typed. The schema defines an API's type system and all object relationships. See “Schema”.
Introspective. A client can query the schema for details about the schema.
Hierarchical. The shape of a GraphQL call mirrors the shape of the JSON data it returns. Nested fields let you query for and receive only the data you specify in a single round trip.
An application layer. GraphQL is not a storage model or a database query language. The graph refers to graph structures defined in the schema, where nodes define where nodes define objects and edges define relationships between objects. The API traverses and returns application data based on the schema definitions, independent of how the data is stored. See “Using Global Node IDs”.
Why Scope is using GraphQL
...
All calls are validated and executed against the Scope GraphQL public schema:
Allowed operations: queries and mutations.
Schema-defined types: scalars, objects, enums, interfaces, unions, and input objects.
...
Query
__schema
to list all types defined in the schema and get details about each:Code Block query { __schema { types { name kind description fields { name } } } }
Query
__type
to get details about any type:Code Block query { __type(name: "RepositoryUser") { name kind description fields { name } } }
You can also run an introspection query of the schema via a
GET
request:Code Block $ curl -H "Authorization: Token token" https://cms.scopear.com/api/v3/graphql
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 or pipe the results into
python -m json.tool
for this purpose.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 isPOST
, whether it's a query or a mutation.
...