Replies: 1 comment 3 replies
-
|
I'm not sure what you mean by "proxy" here. You can use Apollo Federation for this, having a subgraph's url field using |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We have setup a Apollo server to act as a primary endpoint to (for now) our Contentful GraphQL endpoint.
This proxy is aware of the calling user's role (Auth0 authorizer).
We'd like the modify / limit the
VideoPostreturned based on that role. Effectively to return anullfor theVideoPost.urlfrom non-premium (not logged in users) (Paywalled) We still want anonymous users to be able to query all videos... just not be able to view the video itself. Hence the idea to just returnVideoPost.url = null.Perhaps there is a better way to do this altogether, but right now we we're just trying to proxy the resolver for
urlfield like this..However,
parentonly includes what was asked for in the query.... so if the query didn't ask forparent.restrictToRolesthen we're unable to modify things cause we don't know therestrictToRolesdata on that VideoPost.Is there a better way to do this?
Been reading a lot about “delegateSchema” and “transforms”, however, I think I’m unsure as to if these ONLY deal with the “schema” and not the actual data results.
What we we’re hoping to do was to remove the Video.url from all requests or from the response if the user’s role/identity is not “premium” and the “Video.allowedRole” doesnt match.
Gist Here
Beta Was this translation helpful? Give feedback.
All reactions