private IValidationResult Validate(GraphQLDocument document) => _validator.ValidateAsync( new ValidationOptions { Schema = _schema, Document = document, Operation = document.Definitions.OfType <GraphQLOperationDefinition>().First() }).GetAwaiter().GetResult().validationResult;
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); }
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); }
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); }
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());; }
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); }
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); }
internal Task <IValidationResult> ValidateAsync(string queryString) { var document = _documentBuilder.Build(queryString); return(_documentValidator.ValidateAsync(queryString, _schema, document)); }
private IValidationResult Validate(Document document) => _validator.ValidateAsync(null, _schema, document).GetAwaiter().GetResult();
private IValidationResult Validate(Document document) => _validator.ValidateAsync(_schema, document, document.Operations.First().Variables).GetAwaiter().GetResult().validationResult;