GraphQL mutations
You can create and update instances using GraphQL. The mutation capabilities available from the GraphQL API represent a subset of the capabilities of the ingestion REST API endpoints. The GraphQL interface for data modeling doesn't anticipate receiving significant data ingestion traffic. For that, please use the DMS REST API, or the CDF Transformations service.
For a data model like the example below, mutations are generated for each type, except types annotated with the @edge
directive:
type Movie {
title: String
actors: [Person]
@relation(
edgeSource: "ActedIn"
type: { space: "imdb", externalId: "HAS_ACTOR" }
direction: OUTWARDS
)
director: Person
}
type Person {
name: String!
}
type ActedIn @edge {
role: String
compensation: Float
metadata: JSONObject
lines: [String]
}
upsert
mutations
The mutations receive a list of instances you want to create for a specific type. For example:
mutation CreateMovie {
upsertMovie(
items: [
{ space: "imdb", externalId: "the-prestige", title: "The Prestige" }
{ space: "imdb", externalId: "the-titanic", title: "The Titanic" }
]
) {
externalId
space
createdTime
}
}