-
Notifications
You must be signed in to change notification settings - Fork 863
Resolver Payload Types #743
Comments
Permissions for querying nodesI think querying nodes should behave the same as all other queries in terms of the permission system. Query arguments for model fieldsIs it possible to include/exclude query arguments for |
A huge 👍 on the proposal for how to return an model Type. I've been thinking about this, because returning the actual object is not feasible because of relations that are not part of the returned data. The solution with the id is a wonderful solution to it! |
@marktani Interesting addition on the permissions. However, that would require the user token, not the PAT, to execute queries inside resolver functions. So you would need both tokens as part of the context. |
no, checking permissions would be handled by the framework that has access to the node token. |
@marktani Can you explain how that would work. I'm especially concerned in what I can do as a developer to influence that behavior. I have the 'freedom' to execute queries using the root token (or whatever it's called now). Then, if I return an Id from such a query, the users' permissions would suddenly be applied automatically? I definitely think that's not something I want. |
That's how I imagine it to work, but I see that this is not necessarily the desired behavior in all cases. On the other hand, exposing all data connected to nodes returned in a resolver is probably also not desired. |
So maybe 'just' returning the Id of a Node is not enough for the 'internals' to know how to deal with this. Maybe we need a different syntax, an object like |
Any updates on this? |
Will this be part of 1.0 (#353)? |
This issue has been moved to graphcool/graphcool-framework. |
@marktani: I think that you could link directly to the issue on graphcool-framework repo on this cases :) |
Here's the issue: Graphcool/graphcool-framework#256. |
Resolvers return a payload that can be constructed in many different ways:
Scalar
#729
proposal/accepted
#742
Return one of the supported scalar types:
Transient
#543
proposal/needs-spec
Return a type that is not stored in the Graphcool database:
Model
Return a type that is stored in the Graphcool database:
Nested Transient
Transient types can be arbitrarily nested:
Combined Transient and Model
Model types can be returned from Transient type:
The text was updated successfully, but these errors were encountered: