Delete
class Delete extends MutationScaffolder implements OperationResolver, CRUDInterface (View source)
A generic delete operation.
Traits
Offers a few helper methods for classes that are DataObject subclass bound.
Methods
Gets a map of operation identifiers to their classes
Delete constructor.
No description
Sets descriptions of arguments [ 'Email' => 'The email of the user' ]
Sets a single arg description
Sets argument defaults [ 'Featured' => true ]
Sets a default for a single arg
Sets operation arguments as required or not [ 'ID' => true ]
Sets an operation argument as required or not
No description
Invoked by the Executor class to resolve this mutation / query
Details
$this
setChainableParent(DataObjectScaffolder|SchemaScaffolder $parent)
Set parent
string
getDescription()
OperationScaffolder
setDescription(string $description)
static string|null
getClassFromIdentifier(string $name)
static string|null
getIdentifier(string|OperationScaffolder $instOrClass)
static array
getOperations()
Gets a map of operation identifiers to their classes
__construct(string $dataObjectClass)
Delete constructor.
$this
addArgs(array $argData)
Adds args to the operation
Ex: [ 'MyArg' => 'String!', 'MyOtherArg' => 'Int', 'MyCustomArg' => new InputObjectType([ ]
$this
addArg(string $argName, string $typeStr, string $description = null, mixed $defaultValue = null)
$this
setArgDescriptions(array $argData)
Sets descriptions of arguments [ 'Email' => 'The email of the user' ]
$this
setArgDescription(string $argName, string $description)
Sets a single arg description
$this
setArgDefaults(array $argData)
Sets argument defaults [ 'Featured' => true ]
$this
setArgDefault(string $argName, mixed $default)
Sets a default for a single arg
$this
setArgsRequired(array $argData)
Sets operation arguments as required or not [ 'ID' => true ]
OperationScaffolder
setArgRequired(string $argName, bool $required)
Sets an operation argument as required or not
string
getName()
$this
setName(string $name)
ArrayList
getArgs()
$this
setTypeName(string $typeName)
Type name
string
getTypeName()
$this
removeArg(string $arg)
$this
removeArgs(array $args)
callable|OperationResolver
getResolver()
$this
setResolver(callable|OperationResolver|string $resolver)
applyConfig(array $config)
string
getDataObjectClass()
DataObject
getDataObjectInstance()
$this
setDataObjectClass(string $class)
Sets the DataObject name
addToManager(Manager $manager)
mixed
scaffold(Manager $manager)
mixed
resolve(mixed $object, array $args, mixed $context, ResolveInfo $info)
Invoked by the Executor class to resolve this mutation / query