src/GraphQl/Type/SchemaBuilder.php
private function getMutationField(string $resourceClass, ResourceMetadata $resourceMetadata, string $mutationName): array
    {
        $shortName = $resourceMetadata->getShortName();
        $resourceType = new Type(Type::BUILTIN_TYPE_OBJECT, true, $resourceClass);
        $deprecationReason = $resourceMetadata->getGraphqlAttribute($mutationName, 'deprecation_reason', '', true);

        if ($fieldConfiguration = $this->getResourceFieldConfiguration($resourceClass, $resourceMetadata, ucfirst("{$mutationName}s a $shortName."), $deprecationReason, $resourceType, $resourceClass, false, null, $mutationName)) {
            $fieldConfiguration['args'] += ['input' => $this->getResourceFieldConfiguration($resourceClass, $resourceMetadata, null, $deprecationReason, $resourceType, $resourceClass, true, null, $mutationName)];

            if (!$this->isCollection($resourceType)) {
                $fieldConfiguration['resolve'] = ($this->itemMutationResolverFactory)($resourceClass, null, $mutationName);
            }
        }

        return $fieldConfiguration ?? [];
    }
private function getMutationField(string $resourceClass, ResourceMetadata $resourceMetadata, string $mutationName): array
    {
        $shortName = $resourceMetadata->getShortName();
        $resourceType = new Type(Type::BUILTIN_TYPE_OBJECT, true, $resourceClass);
        $deprecationReason = $resourceMetadata->getGraphqlAttribute($mutationName, 'deprecation_reason', '', true);

        if ($fieldConfiguration = $this->getResourceFieldConfiguration($resourceClass, $resourceMetadata, ucfirst("{$mutationName}s a $shortName."), $deprecationReason, $resourceType, $resourceClass, false, null, $mutationName)) {
            $fieldConfiguration['args'] += ['input' => $this->getResourceFieldConfiguration($resourceClass, $resourceMetadata, null, $deprecationReason, $resourceType, $resourceClass, true, null, $mutationName)];

            if (!$this->isCollection($resourceType)) {
                $fieldConfiguration['resolve'] = ($this->itemMutationResolverFactory)($resourceClass, null, $mutationName);
            }
        }

        return $fieldConfiguration ?? [];
    }
private function getMutationField ( string $ resourceClass , ResourceMetadata $ resourceMetadata , string $ mutationName ) : array { $ shortName = $ resourceMetadata -> getShortName ( ) ; $ resourceType = new Type ( Type :: BUILTIN_TYPE_OBJECT , true , $ resourceClass ) ; $ deprecationReason = $ resourceMetadata -> getGraphqlAttribute ( $ mutationName , 'deprecation_reason' , '' , true ) ; if ( $ fieldConfiguration = $ this -> getResourceFieldConfiguration ( $ resourceClass , $ resourceMetadata , ucfirst ( "{$mutationName}s a $shortName." ) , $ deprecationReason , $ resourceType , $ resourceClass , false , null , $ mutationName ) ) { $ fieldConfiguration [ 'args' ] += [ 'input' => $ this -> getResourceFieldConfiguration ( $ resourceClass , $ resourceMetadata , null , $ deprecationReason , $ resourceType , $ resourceClass , true , null , $ mutationName ) ] ; if ( ! $ this -> isCollection ( $ resourceType ) ) { $ fieldConfiguration [ 'resolve' ] = ( $ this -> itemMutationResolverFactory ) ( $ resourceClass , null , $ mutationName ) ; } } return $ fieldConfiguration ?? [ ] ; }
Gets the mutation field for the given operation name.
Gets the mutation field for the given operation name .