Esempio n. 1
0
        public async Task <ExecutionResult> Process(GraphqlQuery query)
        {
            if (query == null)
            {
                throw new ArgumentNullException(nameof(query));
            }

            var executionOptions = new ExecutionOptions
            {
                Query  = query.Query,
                Inputs = query.Variables.ToInputs(),
            };

            return(await SetParamsAndExecute(executionOptions));
        }
        public async Task <ExecutionResult> Process(GraphqlQuery query, ClaimsPrincipal user, params UserAuthRole[] roles)
        {
            if (query == null)
            {
                throw new ArgumentNullException(nameof(query));
            }

            var executionOptions = new ExecutionOptions
            {
                Query  = query.Query,
                Inputs = query.Variables.ToInputs(),
            };

            return(await SetParamsAndExecute(executionOptions, user, roles));
        }
        protected async Task <IActionResult> ProcessQuery(GraphqlQuery query)
        {
            var result = await Gql.Process(query);

            return(TransformResult(result) ?? Ok(result.Data));
        }
        protected async Task <IActionResult> ProcessQuery(GraphqlQuery query, params UserAuthRole[] roles)
        {
            var result = await Gql.Process(query, User, roles);

            return(TransformResult(result) ?? Ok(result.Data));
        }