carstenbaumhoegger
05/28/2018, 9:35 AMseed.graphql
file to do so. I’ve defined 3 mutations to add dummy users and named them differently. When executing I’m getting the following error:
ERROR: Must provide operation name if query contains multiple operations
{
"data": null,
"errors": [
{
"message": "Must provide operation name if query contains multiple operations"
}
],
"status": 200
}
The used seed.graphql
works if I copy it into GraphqL Playground. Can the seed file only contain one mutation?
Here’s the `seed.graphql`:
mutation addUserA {
createUser(data: {
email: "<mailto:usera@example.de|usera@example.de>"
password: "$2a$10$hACwQ5/HQI6FhbIISOUVeusy3sKyUDhSq36fF5d/54aAdiygJPFzm"
firstname: "User"
lastname: "A"
}) {
id
}
}
mutation addUserB {
createUser(data: {
email: "<mailto:userb@example.de|userb@example.de>"
password: "$2a$10$hACwQ5/HQI6FhbIISOUVeusy3sKyUDhSq36fF5d/54aAdiygJPFzm"
firstname: "User"
lastname: "B"
}) {
id
}
}
mutation addUserC {
createUser(data: {
email: "<mailto:userc@example.de|userc@example.de>"
password: "$2a$10$hACwQ5/HQI6FhbIISOUVeusy3sKyUDhSq36fF5d/54aAdiygJPFzm"
firstname: "User"
lastname: "C"
}) {
id
}
}
nilan
05/28/2018, 9:36 AMCan the seed file only contain one mutation?yes.
nilan
05/28/2018, 9:36 AMcarstenbaumhoegger
05/28/2018, 9:37 AM.zip
?nilan
05/28/2018, 9:37 AMrun
script optionnilan
05/28/2018, 9:38 AMcarstenbaumhoegger
05/28/2018, 9:38 AMnilan
05/28/2018, 9:39 AMstephen
05/28/2018, 11:00 AMmutation {
addUserA: createUser(data: {
email: "<mailto:usera@example.de|usera@example.de>"
password: "$2a$10$hACwQ5/HQI6FhbIISOUVeusy3sKyUDhSq36fF5d/54aAdiygJPFzm"
firstname: "User"
lastname: "A"
}) {
id
}
addUserB: createUser(data: {
email: "<mailto:userb@example.de|userb@example.de>"
password: "$2a$10$hACwQ5/HQI6FhbIISOUVeusy3sKyUDhSq36fF5d/54aAdiygJPFzm"
firstname: "User"
lastname: "B"
}) {
id
}
addUserC: createUser(data: {
email: "<mailto:userc@example.de|userc@example.de>"
password: "$2a$10$hACwQ5/HQI6FhbIISOUVeusy3sKyUDhSq36fF5d/54aAdiygJPFzm"
firstname: "User"
lastname: "C"
}) {
id
}
}
ie. a single mutation with named transactions.nilan
05/28/2018, 11:23 AMcarstenbaumhoegger
05/28/2018, 11:24 AM