Bulk Object Creation in GraphQL IDE

Hi community, I am trying to to create bulk objects in a single Graphql Mutation.I have a question is it possible to do that in Appfarms built in GraphQL IDE?

Thanks.

Hello,

Certainly, you can achieve this through the “persist” endpoint. Ensure that GraphQL is enabled for your object class and that the create option is also enabled. Once these prerequisites are met, the “persist” endpoint will become accessible. Here’s an example where multiple cars with the property “brand” are created simultaneously:

mutation{
	persistCar(
		objects: [
			{
				brand: "WV"
            },
			{
				brand: "Honda"
            },
			{
				brand: "Ferrari"
            },
			{
				brand: "Jeep"
            },
			{
				brand: "Mercedes"
			}
		]
    )
}

You can find relevant documentation here: Mutations - Appfarm Documentation

Hope this was helpful!

2 Likes