// Path: src/main/java/com/nfl/glitr/registry/mutation/RelayMutation.java
// public interface RelayMutation<I extends RelayMutationType, R extends RelayMutationType> {
// 
//     R call(I input, DataFetchingEnvironment env);
// }
// 
// Path: src/main/java/com/nfl/glitr/registry/mutation/RelayMutationDataFetcher.java
// public class RelayMutationDataFetcher implements DataFetcher {
// 
//     @SuppressWarnings("unused")
//     private static final Logger logger = LoggerFactory.getLogger(RelayMutationDataFetcher.class);
// 
//     private final Class mutationInputClass;
//     private final Validator validator;
//     private final RelayMutation mutationFunc;
// 
// 
//     public RelayMutationDataFetcher(Class mutationInputClass, RelayMutation mutationFunc) {
//         this(mutationInputClass, mutationFunc, null);
//     }
// 
// 
//     public RelayMutationDataFetcher(Class mutationInputClass, RelayMutation mutationFunc, @Nullable Validator validator) {
//         this.mutationInputClass = mutationInputClass;
//         this.validator = validator;
//         this.mutationFunc = mutationFunc;
//     }
// 
//     @Override
//     @SuppressWarnings("unchecked")
//     public Object get(DataFetchingEnvironment env) {
//         Map<String, Object> inputMap = env.getArgument("input");
// 
//         // map fields from input map to mutationInputClass
//         Object inputPayloadMtn = Glitr.getObjectMapper().convertValue(inputMap, mutationInputClass);
//         // apply some validation on inputPayloadMtn (should validation be in the mutationFunc instead?)
//         validate(inputPayloadMtn);
//         // mutate and return output
//         RelayMutationType mutationOutput = mutationFunc.call((RelayMutationType) inputPayloadMtn, env);
//         // set the client mutation id
//         mutationOutput.setClientMutationId((String) inputMap.get("clientMutationId"));
// 
//         return mutationOutput;
//     }
// 
//     private void validate(Object inputPayloadMtn) {
//         if (validator == null) {
//             return;
//         }
// 
//         Set<ConstraintViolation<Object>> errors = validator.validate(inputPayloadMtn);
//         if (!errors.isEmpty()) {
//             throw new GlitrValidationException("Error validating input mutation.", errors);
//         }
//     }
// }


import com.nfl.glitr.annotation.GlitrArgument;
import com.nfl.glitr.annotation.GlitrArguments;
import com.nfl.glitr.annotation.GlitrDescription;
import com.nfl.glitr.registry.mutation.RelayMutation;
import com.nfl.glitr.registry.mutation.RelayMutationDataFetcher;
import graphql.schema.DataFetchingEnvironment;
package com.nfl.glitr.data.mutation;


public class MutationType {

    @GlitrDescription("Saves Info related to a video")
    @GlitrArguments({@GlitrArgument(name = "input", type = VideoMutationInput.class, required = true, defaultValue = "{default input}")})
    public VideoMutationPayload getSaveVideoInfoMutation(DataFetchingEnvironment env) {
        SaveVideoInfo saveVideoInfo = new SaveVideoInfo();
// Path: src/main/java/com/nfl/glitr/registry/mutation/RelayMutation.java
// public interface RelayMutation<I extends RelayMutationType, R extends RelayMutationType> {
// 
//     R call(I input, DataFetchingEnvironment env);
// }
// 
// Path: src/main/java/com/nfl/glitr/registry/mutation/RelayMutationDataFetcher.java
// public class RelayMutationDataFetcher implements DataFetcher {
// 
//     @SuppressWarnings("unused")
//     private static final Logger logger = LoggerFactory.getLogger(RelayMutationDataFetcher.class);
// 
//     private final Class mutationInputClass;
//     private final Validator validator;
//     private final RelayMutation mutationFunc;
// 
// 
//     public RelayMutationDataFetcher(Class mutationInputClass, RelayMutation mutationFunc) {
//         this(mutationInputClass, mutationFunc, null);
//     }
// 
// 
//     public RelayMutationDataFetcher(Class mutationInputClass, RelayMutation mutationFunc, @Nullable Validator validator) {
//         this.mutationInputClass = mutationInputClass;
//         this.validator = validator;
//         this.mutationFunc = mutationFunc;
//     }
// 
//     @Override
//     @SuppressWarnings("unchecked")
//     public Object get(DataFetchingEnvironment env) {
//         Map<String, Object> inputMap = env.getArgument("input");
// 
//         // map fields from input map to mutationInputClass
//         Object inputPayloadMtn = Glitr.getObjectMapper().convertValue(inputMap, mutationInputClass);
//         // apply some validation on inputPayloadMtn (should validation be in the mutationFunc instead?)
//         validate(inputPayloadMtn);
//         // mutate and return output
//         RelayMutationType mutationOutput = mutationFunc.call((RelayMutationType) inputPayloadMtn, env);
//         // set the client mutation id
//         mutationOutput.setClientMutationId((String) inputMap.get("clientMutationId"));
// 
//         return mutationOutput;
//     }
// 
//     private void validate(Object inputPayloadMtn) {
//         if (validator == null) {
//             return;
//         }
// 
//         Set<ConstraintViolation<Object>> errors = validator.validate(inputPayloadMtn);
//         if (!errors.isEmpty()) {
//             throw new GlitrValidationException("Error validating input mutation.", errors);
//         }
//     }
// }


// Path: src/test/groovy/com/nfl/glitr/data/mutation/MutationType.java
import com.nfl.glitr.annotation.GlitrArgument;
import com.nfl.glitr.annotation.GlitrArguments;
import com.nfl.glitr.annotation.GlitrDescription;
import com.nfl.glitr.registry.mutation.RelayMutation;
import com.nfl.glitr.registry.mutation.RelayMutationDataFetcher;
import graphql.schema.DataFetchingEnvironment;

package com.nfl.glitr.data.mutation;


public class MutationType {

    @GlitrDescription("Saves Info related to a video")
    @GlitrArguments({@GlitrArgument(name = "input", type = VideoMutationInput.class, required = true, defaultValue = "{default input}")})
    public VideoMutationPayload getSaveVideoInfoMutation(DataFetchingEnvironment env) {
        SaveVideoInfo saveVideoInfo = new SaveVideoInfo();
        RelayMutationDataFetcher relayMutationDataFetcher = new RelayMutationDataFetcher(VideoMutationInput.class, saveVideoInfo);