hayes/pothos

Support Client Directives in Prisma plugin

Open

#723 opened on Dec 27, 2022

View on GitHub
 (3 comments) (14 reactions) (0 assignees)TypeScript (183 forks)auto 404
enhancementhelp wanted

Repository metrics

Stars
 (2,609 stars)
PR merge metrics
 (PR metrics pending)

Description

The prisma plugin should support the ~@skip! ~@include! and @defer directives.

For skip and include, we can return early to exclude the fields selection if the field will not be resolved here: https://github.com/graphql/graphql-js/blob/main/src/execution/collectFields.ts#L250

For defer, it's slightly more complex because we only want to exclude it during the initial execution phase. I am not yet sure how to determine if a resolver is running deferred or not.

@stream may be useful as well for list or connection fields, but would likely be more complicated to implement

Contributor guide