1
votes

I am trying to understand how to filter the results of the below graphQL query after the array of assignments has completely resolved.

Specifically there is a nullable subfield and I would like to remove results from for which this nullable subfield is in-fact null.

type Query { assignments_by_teacher_id(teacher_id: ID!): [Assignment] }

type Assignment implements Viewable { view_type : ViewType! content : Content # nullable # other fields.. }

I traced the execution path and see that as expected the resolution follows a breadth first traversal with the nested fields resolving after the root object. What I'm looking for is a post resolver hook that can condition the resulting array of Assignments based on the fully resolved query response and possibly some argument to the query.

1

1 Answers

0
votes

Maybe this is what you are looking for prisma/graphql-middleware

Allows complete control over your resolvers (Before, After).