I use graphql-query-generator to create queries more easily in my graphql requests.
link: https://github.com/IBM/graphql-query-generator
I have a mutation that deletes all users.
deleteAllUsers: Boolean
Type Details
The Boolean scalar type represents true or false.
scalar Boolean
I wrote a code like this by reading the graphql-query-generator document.
const { getRandomMutation } = require('ibm-graphql-query-generator');
const { buildSchema, print } = require('graphql');
const schema = `
type Query {
deleteAllUsers()
}
`;
const configuration = {
depthProbability: 0.5,
breadthProbability: 0.5,
};
const { queryDocument } = getRandomMutation(buildSchema(schema), configuration);
const query = print(queryDocument);
After this line, it does not go to the bottom line and does not give an error.
const { queryDocument } = getRandomMutation(buildSchema(schema), configuration);
How do I create the deleteAllUsers mutation