Can't get filtering working with dynamic schemas #6975
Replies: 8 comments 22 replies
-
Here's a minimal reproduction that @pblasucci put together. |
Beta Was this translation helpful? Give feedback.
-
@jimitndiaye I saw on #6272 that you appear to have gotten this working. Could you share any insights here? |
Beta Was this translation helpful? Give feedback.
-
Our startup is as follows:
The AddDataverse*** functions are custom extension methods that do same as the equivalent In the type module we have sections of code like:
That For the actual query fields we register them as such:
You'll notice the use of custom FilterInputType for each entity type. Basically we inherit from
Ultimately, I recommend you look at the MongoDb code within Hotchocolate and see about replacing the mongodb-specific implementations with custom code that talks to your own datasource. |
Beta Was this translation helpful? Give feedback.
-
If I understand what @jimitndiaye did. And what the MongoDB does, this appears to set up an alternate filtering system separate from the one that comes from I have some indications I could make that work. I also have some indications that there's a bug with making When trying to make
Where I already have:
At minimum, there's a misleading error message. Or perhaps there's a HC bug. Or I am missing something that is "obvious" in its non-obviousness. I would be happy to explore further with an HC maintainer should they take notice of this. Otherwise, it seems like creating a full set of custom filters etc from scratch is probably going to be more fruitful. |
Beta Was this translation helpful? Give feedback.
-
After additional debugging, we believe this to be a bug and have opened #6983 |
Beta Was this translation helpful? Give feedback.
-
It basically calls |
Beta Was this translation helpful? Give feedback.
-
@jimitndiaye Thanks for all your assistance. I was able to figure out from your work what was causing the error we were encountering and make a small fix in Hot Chocolate Data to address the problem. I'll be opening a PR for that in the not so distant future. Understanding what you were doing with your custom middleware was key to figuring out what we needed to do for our use case of "just needing filtering to work with dynamic schema types". |
Beta Was this translation helpful? Give feedback.
-
For folks who see this in the future, we have a PR open to facilitate the approach we took: I will be creating an example "how to" repository and adding that to this discussion thread before closing this. |
Beta Was this translation helpful? Give feedback.
-
We have been trying to get this to work for several days. No luck so far. We are starting to think perhaps there is a bug.
We are creating types using an
ITypeModule
that adds types and add fields to query those types to Query root. Everything with this works fine and we can query fine. When trying to add filtering, we get an error.It very much appears to be the same issue as detailed in this StackOverflow question. However, I tried following the "I seemed to make it work" answer and was unable to do so.
It also appears that it might be the same issue as found in this discussion. I didn't want to add on to that discussion in case it merely looks the same from outward symptoms.
We are using HotChocolate from F#. Here is extracted code. I am putting together a self contained minimal reproduction that hopefully doesn't end up being "too minimal".
Initially I only had
UseFiltering()
but added a filter convention based on the stackoverflow answer.That code adds:
The setup for our app is:
We've tried a number of approaches to fix and in almost all cases we end up with a stacktrace like:
Any assistance would be appreciated. I should be able to have a self-contained reproduction sometime tomorrow.
Beta Was this translation helpful? Give feedback.
All reactions