-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pagination #3
Comments
Hi, I think pagination and skipping is achievable using grapql. The problem that I've encountered is that I don't know how to have an input type of dynamic object, we can use that in where field of filter, since where should be dynamic. Is it possible to have Dynamic object type on this point of time? I did not go on that deeply. Leave your comments below @jmaicaaan @isotopeee |
Hmm, how do you define the dynamic input object? I think the GraphQL input type is strictly typed to its schema. Moving forward, the where property in the filter should also the same as the fields in its schema too.
The where filter should also based from it. I think having a dynamic input object breaks the power of a strongly typed schema provided by GraphQL. Here is the sample of how I changed your
|
If the comment above confused you, I pushed those changes into another branch just to show it to you https://github.com/UltraRangers/graphql-playground/tree/hotfix/pagination-v2. |
That is probably strongly typed, I dont think Input shouldn't be always strongly typed, well it is good and safe if on mutation, but not on querying. Or maybe I didn't know it yet. But how can we use a complex object filter that does have include property or an { eq: } value. I anticipate that we will use ORM and they probably have different implementation of querying so I think we should go on dynamically typed rather than pure strongly typed |
But but those filter are already defined. I think what will satisfy the filter of the ORM will be created in the schema of graphql. I dont think the graphql is a dynamic driven schema. |
Hi @cedrickmandocdoc, you might want to take a look at the Variables, Fragment and Directives section of the docs. I think it's the mechanisms for dynamic queries while still getting the benefits of a strongly typed schema. @jmaicaaan correct me if I'm wrong. |
Hmm i'm not really sure about that. Havent used those things yet. But after taking a quick look, it is still using the same exact fields which are defined in the schema. If I understand @cedrickmandocdoc 's situation, he needs to have a dynamic fields of inq, gte, lte, includes (loopback) without having to define in the schema. Just pass it to the orm's function. So he doesn't have to construct those fields in the schema. |
@cedrickmandocdoc , @jmaicaaan , check out this thread. |
Ability to filter, sort, offset or order by a collection
The text was updated successfully, but these errors were encountered: