You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, just want to tell you that I really appreciate your work on this library so far, and my experience with is has been very positive. Of course, I'm very new and not fully familiar with it.
However, have come up against a use case recently that I'm not sure is possible to implement in Tartiflette. Specifically, looking to do more complex 'filtering' based on the properties of subfields. Am working on an experiment management platform, where we have a series of experiments and related nucleic acid (DNA) samples; was looking to be able to run a query like this:
Ideally, this structure would filter down to only experiments where the type is "Experiment Type" and which has a related acid who's tissue field is not "Tissue Type". This first level filtering is obviously straightforward, and have solved it with something like the following that would get called at every individual resolver.
defresolve_filters(df, args):
# df is a pandas.DataFrame of the data resultsfilter_fields= {
'eq': lambdacol, value: (col==value),
'neq': lambdacol, value: (col!=value),
'lt': lambdacol, value: (col<value),
'gt': lambdacol, value: (col>value),
'in': lambdacol, value: ([vinvalueforvincol])
}
defresolve(col, filters):
# check if individual col passes all filterspass_filter= (col==col)
forfinfilters:
col=col.astype(type(filters[f]))
pass_filter=pass_filter& (filter_fields[f](col, filters[f]))
returnpass_filterforcinargs:
ifcindf:
df=df[resolve(df[c], args[c])]
returndf
This function only resolves filters at the very top level. In my mind, the complete filtering system would have singular resolvers looking back at previously resolved data and alter those results based on it's own. Of course, this sort of ability doesn't seem to be exposed by Tartiflette. Is this something more realistic to implement as a directive?
This is something that is apparently possible in graphene, as per this issue. Has anyone encountered this use case? Any ideas about the proper way to approach this?
Again, apologies for my unfamiliarity with Tartiflette. Am hoping this is a common roadblock and that a posted issue could help myself and other people get over it.
The text was updated successfully, but these errors were encountered:
First of all, just want to tell you that I really appreciate your work on this library so far, and my experience with is has been very positive. Of course, I'm very new and not fully familiar with it.
However, have come up against a use case recently that I'm not sure is possible to implement in Tartiflette. Specifically, looking to do more complex 'filtering' based on the properties of subfields. Am working on an experiment management platform, where we have a series of experiments and related nucleic acid (DNA) samples; was looking to be able to run a query like this:
Ideally, this structure would filter down to only experiments where the type is "Experiment Type" and which has a related acid who's tissue field is not "Tissue Type". This first level filtering is obviously straightforward, and have solved it with something like the following that would get called at every individual resolver.
This function only resolves filters at the very top level. In my mind, the complete filtering system would have singular resolvers looking back at previously resolved data and alter those results based on it's own. Of course, this sort of ability doesn't seem to be exposed by Tartiflette. Is this something more realistic to implement as a directive?
This is something that is apparently possible in graphene, as per this issue. Has anyone encountered this use case? Any ideas about the proper way to approach this?
Again, apologies for my unfamiliarity with Tartiflette. Am hoping this is a common roadblock and that a posted issue could help myself and other people get over it.
The text was updated successfully, but these errors were encountered: