Search code examples
javascriptgraphqlapollostrapi

Can I create multiple elements of the same type using Strapi and GraphQL?


Can I create multiple elements of the same type using Strapi and GraphQL? For example -

createMultipleFoo mutation(data: [
    nameOfFoo: "ooaoaoa",
    weightOfFoo: "aododo"
    ], ....)

Solution

  • It's in the roadmap.

    What you can do for now is create a custom endpoint ie. "createMulti". Send a json array, and use the "regular" create for each. Check out the discussion here.


    Update Q4 2021:
    Status moved to "In Progress (Development)"


    Update Q2 2022:
    The roadmap site has moved, link to the issue: https://feedback.strapi.io/developer-experience/p/support-bulk-entries-creationupdates-v4

    Status marked as "PLANNED"