mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.3 KiB
36 lines
1.3 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Squidex.Domain.Apps.Core;
|
|
using Squidex.Domain.Apps.Entities.Contents.GraphQL;
|
|
using Squidex.Domain.Apps.Entities.Contents.GraphQL.Types;
|
|
using Squidex.Web.Services;
|
|
|
|
namespace Squidex.Config.Domain
|
|
{
|
|
public static class QueryServices
|
|
{
|
|
public static void AddSquidexQueries(this IServiceCollection services, IConfiguration config)
|
|
{
|
|
var exposeSourceUrl = config.GetOptionalValue("assetStore:exposeSourceUrl", true);
|
|
|
|
services.Configure<GraphQLOptions>(config,
|
|
"graphql");
|
|
|
|
services.AddSingletonAs(c => ActivatorUtilities.CreateInstance<UrlGenerator>(c, exposeSourceUrl))
|
|
.As<IUrlGenerator>();
|
|
|
|
services.AddSingletonAs<SharedTypes>()
|
|
.AsSelf();
|
|
|
|
services.AddSingletonAs<CachingGraphQLService>()
|
|
.As<IGraphQLService>();
|
|
}
|
|
}
|
|
}
|