Skip to content
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

[Docs]: Confusion around Validator Directives vs. Service Validation #8996

Open
1 task done
JoshFerge opened this issue Aug 1, 2023 · 1 comment
Open
1 task done
Assignees
Labels
p3 Low priority. The Core team will not prioritize this for now topic/docs

Comments

@JoshFerge
Copy link

JoshFerge commented Aug 1, 2023

Summary and description

my docs version: Redwood 6.0

I'd like to have my services validate that the logged in user can only edit the data that they own. I'm trying to figure out in the docs the most ergonomic way to do this.

On this page: https://redwoodjs.com/docs/directives#when-should-i-use-a-redwood-directive
Screenshot 2023-07-30 at 5 40 04 PM

the docs say to do the check in your service instead.

On the service docs: https://redwoodjs.com/docs/services#service-validations it says you should do this in a validator directive. Is there a contradiction here, or what am I missing?
Screenshot 2023-07-30 at 5 40 24 PM

Are you interested in working on this?

  • I'm interested in working on this
@Tobbe
Copy link
Member

Tobbe commented Aug 1, 2023

I agree. That does sound contradictory 🧐 I think the Service Validations docs are wrong, and personally I'd implement the check you're asking about inside my services. Especially as you then also get the check whenever you call your services from other places and not just directly from graphql.

But @dthyresson is our resident expert on these things, so hopefully he can provide some guidance here 🗺️

@dthyresson dthyresson added the p3 Low priority. The Core team will not prioritize this for now label Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3 Low priority. The Core team will not prioritize this for now topic/docs
Projects
None yet
Development

No branches or pull requests

3 participants