public static IDictionary <string, object> Execute <TArgs, TEntity>(GraphQLSchema <TContext> schema, GraphQLQuery <TContext, TArgs, TEntity> gqlQuery, Query query) { var context = schema.ContextCreator(); var results = Execute(context, gqlQuery, query); (context as IDisposable)?.Dispose(); return(results); }
public IDictionary <string, object> ExecuteQuery(string queryStr) { if (_schema.ContextCreator == null) { throw new InvalidOperationException("No context creator specified. Either pass a context " + "creator to the schema's constroctur or call overloaded method 'Execut(string query, TContext context)' " + "and pass a context."); } var context = _schema.ContextCreator(); var result = ExecuteQuery(queryStr, context); (context as IDisposable)?.Dispose(); return(result); }