Beispiel #1
0
        public async Task <object> QueryAsync(IAppEntity app, GraphQLQuery query)
        {
            Guard.NotNull(app, nameof(app));
            Guard.NotNull(query, nameof(query));

            var modelContext = await GetModelAsync(app);

            var queryContext = new QueryContext(app, contentRepository, assetRepository);

            return(await modelContext.ExecuteAsync(queryContext, query));
        }
Beispiel #2
0
        public async Task <(object Data, object[] Errors)> QueryAsync(IAppEntity app, ClaimsPrincipal user, GraphQLQuery query)
        {
            Guard.NotNull(app, nameof(app));
            Guard.NotNull(query, nameof(query));

            if (string.IsNullOrWhiteSpace(query.Query))
            {
                return(new object(), new object[0]);
            }

            var modelContext = await GetModelAsync(app);

            var queryContext = new GraphQLQueryContext(app, assetRepository, contentQuery, user, urlGenerator);

            return(await modelContext.ExecuteAsync(queryContext, query));
        }