create

This method can be used to update nodes, and maps to the underlying Create Mutation.

Returns a Promise that resolves to the equivalent of the Mutation response for this operation.

Example

To create a Movie with title "The Matrix":

const Movie = ogm.model("Movie");

await Movie.create({ input: [{ title: "The Matrix" }] })

Arguments

Name and Type Description

input

Type: any

JavaScript object representation of the GraphQL input input type used for Create mutations.

selectionSet

Type: string or DocumentNode or SelectionSetNode

Selection set for the Mutation, see Selection Set for more information.

args

Type: any

The args value for the GraphQL Mutation.

context

Type: any

The context value for the GraphQL Mutation.

rootValue

Type: any

The rootValue value for the GraphQL Mutation.