graphile / graphile/graphile.github.io

Add a note in make-extend-schema-plugin docs - JS doesn't bypass security.

Open
#101 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
SCSS
Stars
27
Forks
126
PR merge metrics
No merged PRs in 30d

Description

See discord chat

"Hi, I'm trying to implement a register form, users should only can see their user by calling userById() query.

but in my custom mutation registerUser I need to know if user already registered or not.
[default-role](https://www.graphile.org/postgraphile/default-role/) states:

> So the default_role should have restricted privileges to only your data that is publicly accessible.

as my users table is not public, how can I implimnet my mutation?"

**"The JS is not permitted to bypass the security (that's why PostGraphile can be so secure); so you'll need to call a small security definer function from your schema extension."**

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the make-extend-schema-plugin documentation and locate the section covering schema extensions and security. Add a note explaining that JavaScript does not bypass database security and that a small security definer function is needed for this use case. Done means the guidance clearly addresses the register mutation scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation, security
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.