-
-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build inputs with auth #1260
Comments
The problem with inputFields is that the types for inputs are inferred from their definition. If you tack on additional fields after definition it can't change the types, so fields using that input wouldn't know that those additional fields exist. Can you elaborate on the use case for this? We could potentially add something like Auth scopes on inputs is interesting. I want to say that it's possible, but it's complicated. The biggest issue is that arguments might be used before the resolver/auth checks are run leading to inconsistent behavior. Specifically, inputs are processed by the Prisma plugin for all nested selections, if one of those nested selections has an input with an auth scopes, either the Prisma plugin has access to that value (maybe fine) or we throw that auth error on the root field instead I think it might be okay, as long as we are explicit that the scope protects the resolver, not the argument itself |
Right now I'm able to work around the inability to extend input fields so perhaps it's not that important - I mostly just expected it to exist because I define/extend objects like this on the query side (ie not the mutation side). For the input auth scopes I think it would be fine to protect the resolver, ideally there might be a way to protect specific args/fields and enable the rest of the mutation to run (similar to how queries are protected) but in reality this could be difficult to reason with and perhaps it's best to go with 'atomic' updates (not too clear on my usage of this term :) |
Hi,
Just updated to Pothos 4.0, very smooth - great work :)
Could it be possible to implement the
builder.objectField()
method for inputs? ie.Also I would like to define
authScopes
on input fields ie.Thanks!
The text was updated successfully, but these errors were encountered: