Replies: 1 comment 3 replies
-
Edit: @john2094 I found a solution! You can use the [UseFiltering(typeof(Sample))] // This sets up the filtering
public async Task<IUpdateSamplesResult?> UpdateSamples(Guid id,
UpdateSampleInput input,
IResolverContext resolverContext, // Required to read filter context
[Service] DbShardingManager dbShardingManager)
{
await using var dbContext = dbShardingManager.ResolveDbContext(id);
var query = await dbContext.Samples.Filter(resolverContext).ToListAsync(); // This applies the filter from the resolverContext
// rest of resolver code here
} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It's posible use a where input as argument of query/mutation?. I need apply this filter before resolvers done.
Something like this:
Another example is how the @neo4j/graphql library does it with its mutations to update, they accept where as a parameter.
https://neo4j.com/docs/graphql-manual/current/mutations/update/
cheers
Beta Was this translation helpful? Give feedback.
All reactions