Hi,
I guess your SiteBasePage is an abstract class and it not exist on our Graph server mapping so you can not query for an inexist type. I'm not really work on GraphQL project but as i understand by default the indexing job will only push mapping for concrete classes neither abstract nor interface unless you update the mapping by API.
Should i only use Custom GraphModels?
Not require but i highly suggest to use Custom GraphModels because it shows exactly which types and fields had indexed to Graph server. You can download our client tool at https://nuget.optimizely.com/package/?id=Optimizely.Graph.Client.Tools for generate the indexed models to your project by just few commands.
I don't get the concept yet, Is not compat with IContent?
Once your Graph models has been generated, you should see the Content type in the models and it should be parent of all content types as IContent. Content is implemented from IContent, of course.
Example:
var query = _client
.OperationName("Sample_Query")
.ForType<ProxyModels.Content>()
.Where(x=> x.ExistingLanguages().Name.Eq("en"))
.Skip(0)
.Limit(10)
.Fields(x => x.Name, x => x.Url, x=> x.ContentType)
.Total()
.InlineFragment<ProxyModels.ArticlePage>(x => x.MetaDescription, x => x.MetaTitle)
.Search(q)
.Facet(x => x.ContentType.FacetFilters(t))
.ToQuery()
.BuildQueries();
Please take a quick look at https://docs.developers.optimizely.com/platform-optimizely/v1.4.0-optimizely-graph/docs/introduction-optimizely-graph for more details of concept.
Im evaluating the optimizely.graph.client ... version 1.2, Optimizely.ContentGraph.Cms 3.11, CMS 12.31.1
How do i perform a search with GraphQueryBuilder on ALL IContent, and i want to map the result to our SiteBasePage... Is this even possible?
Something like this:
But i get
Cannot query field \"SiteBasePage\" on type \"Query\
also
_.Url and _.ContentType does not exists
I don't get the concept yet, Is not compat with IContent?
Should i only use Custom GraphModels?