public void Should_build_dynamic_content_query_model() { var languagesConfig = LanguagesConfig.English.Set(Language.DE); var queryModel = ContentQueryModel.Build(null, languagesConfig.ToResolver(), ResolvedComponents.Empty); Assert.NotNull(queryModel); }
public async Task <IActionResult> GetFilters(string app, string schema) { var components = await appProvider.GetComponentsAsync(Schema, HttpContext.RequestAborted); var filters = ContentQueryModel.Build(Schema.SchemaDef, App.PartitionResolver(), components).Flatten(); return(Ok(filters)); }
public void Should_build_content_query_model() { var languagesConfig = LanguagesConfig.English.Set(Language.DE); var(schema, components) = TestUtils.MixedSchema(); var queryModel = ContentQueryModel.Build(schema, languagesConfig.ToResolver(), components); CheckFields(queryModel.Schema, schema); }
private QueryModel BuildQueryModel(Context context, ISchemaEntity?schema, ResolvedComponents components) { var cacheKey = BuildJsonCacheKey(context.App, schema, context.IsFrontendClient); var result = cache.GetOrCreate(cacheKey, entry => { entry.AbsoluteExpirationRelativeToNow = CacheTime; return(ContentQueryModel.Build(schema?.SchemaDef, context.App.PartitionResolver(), components)); }); return(result); }