/// <inheritdoc />
        public IGraphQLQuery <T> CreateMutation <T>(string url, HttpMethod httpMethod, string authorizationToken = null,
                                                    string authorizationMethod = "Bearer", params GraphQLQueryArgument[] arguments) where T : class
        {
            var query = _queryGenerator.GetMutation(_fieldBuilder.GetFields(typeof(T)), arguments);

            return(GetGraphQLQuery <T>(query, url, httpMethod, authorizationToken, authorizationMethod));
        }
        /// <summary>
        /// Builds a GraphQL mutation from the specified <see cref="Type"/> and the <see cref="GraphQLQueryArgument"/>s
        /// </summary>
        /// <typeparam name="T">The type to generate the mutation from</typeparam>
        /// <param name="queryGenerator">The queryGenerator used to generate the query</param>
        /// <param name="fieldBuilder">The fieldBuilder used for examining the type</param>
        /// <param name="arguments">The argument values which is inserted using a variable on specified arguments with the <see cref="GraphQLArgumentsAttribute"/></param>
        /// <returns>The generated mutation</returns>
        public static string GetMutation <T>(this IGraphQLQueryGeneratorFromFields queryGenerator, IGraphQLFieldBuilder fieldBuilder,
                                             params GraphQLQueryArgument[] arguments)
        {
            if (queryGenerator == null)
            {
                throw new ArgumentNullException(nameof(queryGenerator));
            }
            if (fieldBuilder == null)
            {
                throw new ArgumentNullException(nameof(fieldBuilder));
            }
            var fields = fieldBuilder.GetFields(typeof(T));

            return(queryGenerator.GetMutation(fields, arguments));
        }
Exemplo n.º 3
0
 public override void RunBenchmark <T>()
 {
     _fieldBuilder.GetFields(typeof(T));
 }