예제 #1
0
 private IValidationResult Validate(GraphQLDocument document) => _validator.ValidateAsync(
     new ValidationOptions
 {
     Schema    = _schema,
     Document  = document,
     Operation = document.Definitions.OfType <GraphQLOperationDefinition>().First()
 }).GetAwaiter().GetResult().validationResult;
예제 #2
0
        private IValidationResult Validate(string query, ISchema schema, IEnumerable <IValidationRule> rules)
        {
            var documentBuilder = new GraphQLDocumentBuilder();
            var document        = documentBuilder.Build(query);
            var validator       = new DocumentValidator();

            return(validator.ValidateAsync(query, schema, document, rules).Result);
        }
예제 #3
0
        private IValidationResult Validate(string query, ISchema schema, IEnumerable <IValidationRule> rules, Inputs inputs)
        {
            var documentBuilder = new GraphQLDocumentBuilder();
            var document        = documentBuilder.Build(query);
            var validator       = new DocumentValidator();

            return(validator.ValidateAsync(schema, document, document.Operations.FirstOrDefault()?.Variables, rules, inputs: inputs).Result.validationResult);
        }
 public IValidationResult Validate()
 {
     return(_documentValidator.ValidateAsync(
                Schema,
                Document,
                null,
                null,
                Inputs).Result.validationResult);
 }
 public IValidationResult Validate()
 {
     return(_documentValidator.ValidateAsync(new ValidationOptions
     {
         Schema = Schema,
         Document = Document,
         Variables = Inputs ?? Inputs.Empty,
     }).Result.validationResult);
 }
예제 #6
0
        private IValidationResult Validate(ValidationTestConfig config)
        {
            HttpContext.User = config.User;
            var documentBuilder = new GraphQLDocumentBuilder();
            var document        = documentBuilder.Build(config.Query);
            var validator       = new DocumentValidator();

            return(validator.ValidateAsync(config.Schema, document, document.Operations.First().Variables, config.Rules, null, config.Inputs).GetAwaiter().GetResult().validationResult);
        }
예제 #7
0
        private IValidationResult Validate(ValidationTestConfig config)
        {
            var userContext = new GraphQLUserContext {
                User = config.User
            };
            var documentBuilder = new GraphQLDocumentBuilder();
            var document        = documentBuilder.Build(config.Query);
            var validator       = new DocumentValidator();

            return(validator.ValidateAsync(config.Query, config.Schema, document, config.Rules, userContext, config.Inputs).GetAwaiter().GetResult());;
        }
예제 #8
0
    private IValidationResult Validate(string query, ISchema schema, IEnumerable <IValidationRule> rules, Inputs variables)
    {
        var documentBuilder = new GraphQLDocumentBuilder();
        var document        = documentBuilder.Build(query);
        var validator       = new DocumentValidator();

        return(validator.ValidateAsync(new ValidationOptions
        {
            Schema = schema,
            Document = document,
            Rules = rules,
            Operation = document.Definitions.OfType <GraphQLOperationDefinition>().FirstOrDefault(),
            Variables = variables
        }).Result.validationResult);
    }
예제 #9
0
    private IValidationResult Validate(ValidationTestConfig config)
    {
        HttpContext.User = config.User;
        var documentBuilder = new GraphQLDocumentBuilder();
        var document        = documentBuilder.Build(config.Query);
        var validator       = new DocumentValidator();

        return(validator.ValidateAsync(new ValidationOptions
        {
            Schema = config.Schema,
            Document = document,
            Operation = document.Definitions.OfType <GraphQLOperationDefinition>().First(),
            Rules = config.Rules,
            Variables = config.Variables
        }).GetAwaiter().GetResult().validationResult);
    }
예제 #10
0
        internal Task <IValidationResult> ValidateAsync(string queryString)
        {
            var document = _documentBuilder.Build(queryString);

            return(_documentValidator.ValidateAsync(queryString, _schema, document));
        }
예제 #11
0
 private IValidationResult Validate(Document document) => _validator.ValidateAsync(null, _schema, document).GetAwaiter().GetResult();
예제 #12
0
 private IValidationResult Validate(Document document) => _validator.ValidateAsync(_schema, document, document.Operations.First().Variables).GetAwaiter().GetResult().validationResult;