Replies: 2 comments 7 replies
-
@Piedone do you have any idea of what could be the best solution? 😊 Thank you |
Beta Was this translation helpful? Give feedback.
0 replies
-
I don't think there's a built-in way to expose content fields in GraphQL for filtering automatically. We could perhaps extend Content Fields Indexing (SQL) with this, since it allows you to filter on content fields from SQL queries. That can also be used in the Queries module, so another workaround would be to expose SQL Queries in GraphQL, what's not available now, only for Lucene and Elasticsearch queries. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
I already read a similar topic here, but my question is a bit different. I'm working on several headless Orchard Core 1.8.3 microservices, and I want to be able to query the different Content Items I created, using GraphQL with a
where
clause on a "UserId"Text field
that all the Content Items I created have.I followed the learning path about GraphQL, and here it explains how to implement a
WhereInputObjectGraphType
.The problem is, I want to avoid defining n
Models
and nWhereInputObjectGraphType
for each Content Item because the WhereInputObjectGraphType requires a model.Is there a way to apply the
where
clause on a "UserId"Text field
, across all the Content Items without defining n models?Otherwise, do you think that the best way to achieve this is to create my custom
SQL Query
and use it through GraphQL?Or is better to implement an ApiController and use the ISession? But I would lose the advantage of having GraphQL.
Perhaps I should use a
Common
part (*) to have only one model? I think that in this case the problem becomes filtering using the correctType
, because there isn't aContentItemType
in thewhere
clause.Thank you
Beta Was this translation helpful? Give feedback.
All reactions