コード例 #1
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.Validate(config.Query, config.Schema, document, config.Rules, userContext, config.Inputs));
        }
コード例 #2
0
        private static 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.Schema, document, document.Operations.First().Variables, config.Rules, userContext, config.Inputs).GetAwaiter().GetResult().validationResult);
        }