Replies: 1 comment
-
This seems interesting, but would be very hard to do in pothis directly. You'd probably want to build a pothos plugin and an envelop plugin. The issue is that GraphQL in JS operates based on the schema, and you would likely need to regenerate the schema for each request. What I'd do for this would be:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hi hayes, thanks for this awesome library. Im loving v4 very much and would like to add a feature like graphql-ruby's visibility.
Motivation
Pothos currently lacks a granular, field-level access control mechanism. A visibility feature would bridge the gap between the
scope-auth
plugin andsub-graph
plugins, providing fine-grained control over schema element accessibility.Proposal
Introduce a visibility option for: types, fields, enums? and mutation that accepts a function, returning a boolean based on the context
Benefits
Implementation
The
visibility
function/flag would be called during query planning. potentially leveraging Pothos'safterBuild
hook?i would like to spend some time to implement such feature but could use some points on the following:
hasReturnedInterface
from thesub-graph
package to verify all inherited interfaces are present or is this done in a later stage of the builders inner workings.@pothos/core
or do we need a separate check for this as wellBeta Was this translation helpful? Give feedback.
All reactions