Skip to content

Commit 47786df

Browse files
committed
doc(query): improve variables go doc
1 parent 7a3cf7d commit 47786df

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

axiom/query/options.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ type Options struct {
1515
// IncludeCursor specifies whether the event that matches the cursor should
1616
// be included in the result.
1717
IncludeCursor bool `json:"includeCursor,omitempty"`
18-
// Variables is an optional set of additional variables that are inserted into the APL
18+
// Variables is an optional set of additional variables can be referenced by
19+
// the APL query. Defining variables in APL using the "let" keyword takes
20+
// precedence over variables provided via the query options.
1921
Variables map[string]any `json:"variables,omitempty"`
2022
}
2123

@@ -45,7 +47,9 @@ func SetCursor(cursor string, include bool) Option {
4547

4648
// SetVariable adds a variable that can be referenced by the APL query. This
4749
// option can be called multiple times to add multiple variables. If a variable
48-
// with the same name already exists, it will be overwritten.
50+
// with the same name already exists, it will be overwritten. Defining variables
51+
// in APL using the "let" keyword takes precedence over variables provided via
52+
// the query options.
4953
func SetVariable(name string, value any) Option {
5054
return func(o *Options) {
5155
if o.Variables == nil {
@@ -56,7 +60,8 @@ func SetVariable(name string, value any) Option {
5660
}
5761

5862
// SetVariables sets the variables that can be referenced by the APL query. It
59-
// will overwrite any existing variables.
63+
// will overwrite any existing variables. Defining variables in APL using the
64+
// "let" keyword takes precedence over variables provided via the query options.
6065
func SetVariables(variables map[string]any) Option {
6166
return func(o *Options) { o.Variables = variables }
6267
}

0 commit comments

Comments
 (0)