fieldPresets doesn't work properly #10653
Replies: 2 comments
-
| 
         @socheatleang — thanks for starting this discussion! I've run into a similar issue — though with  First, I created a native query: INSERT INTO public."registrations" ("user_id", "ip_address", "lat", "long") VALUES (
  {{user_id}},
  {{ip_address}},
  {{lat}},
  {{long}}
)
RETURNING *Then, generated the metadata for it and — as part of the  ---
kind: CommandPermissions
version: v1
definition:
  commandName: insert_registration
  permissions:
    - role: admin
      allowExecution: true
    - role: user
      allowExecution: true
      argumentPresets:
        - argument: user_id
          value:
            sessionVariable: x-hasura-user-idThis then allows for a mutation such as: mutation INSERT_REGISTRATION($ip_address: text!, $lat: text!, $long: text!) {
    insert_registration(ip_address: $ip_address, lat: $lat, long: $long) {
      affected_rows
    }
  }IIRC, there's some issue with passing non-array values to an autogenerated mutation. @danieljharvey — is there anything you'd add or change from what I shared above?  | 
  
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            -
| 
         Closing this due to inactivity.  | 
  
Beta Was this translation helpful? Give feedback.
                  
                    0 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.
-
I am working with insert mutation which require the fieldPresets.
So far, I would love to have fieldPresets with profile_id from the session variable.
neither literal value inside the fieldPresets. I am sure that the x-hasura-profile-id has value.
Suprisely, which that data were insert into db is null instead of the id of profile.
Anyone meet this issue before, I am using hasura ddn v3.
Beta Was this translation helpful? Give feedback.
All reactions