Learn best practices and considerations for migrating from Scope's REST API to Scope's GraphQL API.
In this article
Differences in API logic
Migrating from REST to GraphQL represents a significant shift in API logic. The differences between REST as a style and GraphQL as a specification make it difficult—and often undesirable—to replace REST API calls with GraphQL API queries on a one-to-one basis. We've included specific examples of migration below.
...
Significant advantages of GraphQL include:
Here are examples of each.
...
Code Block |
---|
curl -v https://cms.scopear.com/api/v3v2/:scenarios/:id curl -v https://cms.scopear.com/api/v3v2/:scenarios/:id/attachments curl -v https://cms.scopear.com/api/v3v2/:scenarios/:id/authoring_groups curl -v https://cms.scopear.com/api/v3v2/:scenarios/:id/groups |
Using the GraphQL API, you can retrieve the data with a single query using nested fields:
...