Closed ghiscoding closed 5 months ago
Run & review this pull request in StackBlitz Codeflow.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.8%. Comparing base (
3882ce1
) to head (6092bdd
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@zewa666 so I think I got a similar approach to your OData PR #1536, however 1 major thing that makes it apart is that instead of returning a string, I'm actually asking the user to return an object of the shape { field: string; operator: string; value: any; }
which is what we end up with in the GraphQL query.
However, while doing this PR, I noticed that my GraphqlFilterQueryOverrideArgs
is an exact copy of your OdataFilterQueryOverrideArgs
, so I think it would be best if we merge them both into 1 interface which could maybe be named as BackendServiceFilterQueryOverrideArgs
and because it's generic then I think you should also move it to a backend service interface (or a new file) like backendServiceOption.interface.ts
. So would you mind doing that change in your PR? I can update my PR afterward by simply using that new interface.
I know you're using OData and not GraphQL, but it would still be nice if you could take a look at my PR and tell me if it makes any sense (I don't even have a GraphQL server to test with) but I followed this SO answer that inspired my approach which I think is correct: https://stackoverflow.com/a/37981802/1212166
sure I'll take a look tonight. btw can you target my branch as destination for the merge? I'm genuinly interested if thats possible, but no probs I can move the files around as you mentioned anyways.
with regards to testing perhaps a quick way to ramp up a server with auto graphql features would be to look into Hasura. or if you just want to spin up a demo on top of json files perhaps https://github.com/marmelab/json-graphql-server
filterQueryOverride
which provides a way for the user to override default filter operator and GraphQL query