DATABASE API FOR USER FUNCTIONS: Looks up a UserFunction by name and returns an Invocation.
(ctx context.Context, name string, args map[string]interface{}, mutationAllowed bool)
| 62 | |
| 63 | // Looks up a UserFunction by name and returns an Invocation. |
| 64 | func (db *Database) GetUserFunction(ctx context.Context, name string, args map[string]interface{}, mutationAllowed bool) (UserFunctionInvocation, error) { |
| 65 | if db.Options.UserFunctions != nil { |
| 66 | if fn, found := db.Options.UserFunctions.Definitions[name]; found { |
| 67 | return fn.Invoke(db, args, mutationAllowed, ctx) |
| 68 | } |
| 69 | } |
| 70 | return nil, missingError(db.User(), "function", name) |
| 71 | } |
| 72 | |
| 73 | // Calls a user function by name, returning all the results at once. |
| 74 | func (db *Database) CallUserFunction(ctx context.Context, name string, args map[string]interface{}, mutationAllowed bool) (interface{}, error) { |