Skip to main content
Digital Advisor API

Learn about migrating Digital Advisor REST API endpoints to GraphQL

Contributors netapp-aoife

Digital Advisor is transitioning from REST APIs to GraphQL as its primary API platform to improve performance, flexibility, and scalability. Learn why you should migrate your REST API endpoints to GraphQL.

Caution Due to the phased deprecation of Digital Advisor REST APIs, NetApp strongly recommends that all new API integrations use the GraphQL-based API.

Deprecation of REST APIs

Digital Advisor currently supports both GraphQL and REST APIs. However, Digital Advisor is transitioning from REST APIs to GraphQL as its primary API platform to improve performance, flexibility, and scalability. Digital Advisor REST APIs will eventually be deprecated.

The transition will be phased, with a period of overlap between REST APIs and GraphQL APIs. A deprecation notice will be published in the Digital Advisor API catalog for each deprecated REST API endpoint. You need to migrate that specific endpoint to GraphQL within six months. For more information, see Migrate deprecated Digital Advisor REST API endpoints to GraphQL.

Benefits of GraphQL's data query language

The GraphQL data query language allows clients to request exactly the data they need. The benefits of using the GraphQL data query language include:

  • A specification. The specification determines the validity of the schema on the API server. The schema determines the validity of client calls.

  • A strongly typed schema. The schema defines an API's type system and all object relationships.

  • An introspective schema. A client can query the schema for details about the schema.

  • Hierarchical fields. 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 objects and edges define relationships between objects. The API traverses and returns data based on the schema definitions, independent of how the data is stored.

Benefits of GraphQL data object relationships

Compared to REST, GraphQL is organized around objects, not endpoints, which improves predictability and provides the following benefits:

  • Tailored data retrieval: Queries only the required fields, keeping responses concise and relevant. When you create a GraphQL request, you request only the fields you need. This is one of GraphQL's key efficiency benefits.

  • Single endpoint simplicity: Accesses all Digital Advisor intelligence from a unified GraphQL endpoint.

  • Improved efficiency: Reduces the number of API calls in dashboards and automation pipelines.

  • Future-proof flexibility: Seamlessly adopts new insights with zero disruption as GraphQL schemas evolve.

Comparing GraphQL and REST API operations

GraphQL uses two types of operations to fetch data. These are called queries and mutations. Queries operate like GET requests and mutations operate like POST, PATCH, and DELETE requests in REST. The following table shows some differences between REST and GraphQL:

Component REST API example Example GraphQL equivalent

Path parameters

/v1/system/inventory/details/level/customer/id/123

systems(customerId: "123")

Filters

?filterByPlatform=ONTAP

systems(platformType: [ONTAP])

Pagination (cursor)

?start=0&limit=10

systems(after: "0", pageSize: 10)

To learn more about queries and mutations, refer to Digital Advisor GraphQL API data queries and mutations.