Logo-amall

Is there possibility to add computed field function to auth schema? its not failing on local, but deployment has `permission denied for schema auth`

Last active 4 months ago

6 replies

10 views

  • NE

    Is there possibility to add computed field function to auth schema?
    its not failing on local, but deployment has permission denied for schema auth

  • EL

    No it’s not possible via our git integration with migrations and it’s not recommended generally.

  • EL

    https://docs.nhost.io/authentication/users#:~:text=the%20auth%20schema.-,you're%20allowed%20to%3A,-Add%20and%20remove "You're allowed to:"

  • NE

    user has avatarUrl where i replace it with file id
    i have relation set to storage -> files
    if avatarUrl is null (empty uuid) upon creation -> fail because it tries to find related field with empty uuid

  • NE
    query getUserProfile($userId: uuid!) {
      user(id: $userId) {
        id
        displayName
        metadata
        avatarUrl # if this empty
        email
        avatar { # failed
          shadow {
            color
          }
        }
      }
    }
    

    i countered this with generated field

    CREATE OR REPLACE FUNCTION xy
        RETURNS text <- this prevent the error
        LANGUAGE 'sql'
        COST 100
        IMMUTABLE PARALLEL UNSAFE
    AS $BODY$
    
  • NE

    solved by putting it to public schema

Last active 4 months ago

6 replies

10 views