Skip to content

Commit

Permalink
docs: add consistency param to command examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanharris committed Sep 2, 2024
1 parent af9652d commit 75912c4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/query/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func check(
var checkCmd = &cobra.Command{
Use: "check",
Short: "Check",
Example: `fga query check --store-id="01H4P8Z95KTXXEP6Z03T75Q984" user:anne can_view document:roadmap --context '{"ip_address":"127.0.0.1"}'`, //nolint:lll
Example: `fga query check --store-id="01H4P8Z95KTXXEP6Z03T75Q984" user:anne can_view document:roadmap --context '{"ip_address":"127.0.0.1"}' --consistency "HIGHER_CONSISTENCY"`, //nolint:lll
Long: "Check if a user has a particular relation with an object.",
Args: cobra.ExactArgs(3), //nolint:mnd
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
4 changes: 2 additions & 2 deletions cmd/query/expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ var expandCmd = &cobra.Command{
Use: "expand",
Short: "Expand",
Long: "Expands the relationships in userset tree format.",
Example: `fga query expand --store-id="01H4P8Z95KTXXEP6Z03T75Q984" can_view document:roadmap`,
Args: cobra.ExactArgs(2), //nolint:mnd
Example: `fga query expand --store-id="01H4P8Z95KTXXEP6Z03T75Q984" can_view document:roadmap --consistency "HIGHER_CONSISTENCY"`, //nolint:lll
Args: cobra.ExactArgs(2), //nolint:mnd,lll
RunE: func(cmd *cobra.Command, args []string) error {
clientConfig := cmdutils.GetClientConfig(cmd)

Expand Down
4 changes: 2 additions & 2 deletions cmd/query/list-objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ var listObjectsCmd = &cobra.Command{
Use: "list-objects",
Short: "List Objects",
Long: "List the objects of a certain type that a user has a particular relation to.",
Example: `fga query list-objects --store-id=01H0H015178Y2V4CX10C2KGHF4 user:anne can_view document --contextual-tuple "user:anne can_view folder:product" --contextual-tuple "folder:product parent document:roadmap"`, //nolint:lll
Args: cobra.ExactArgs(3), //nolint:mnd,lll
Example: `fga query list-objects --store-id=01H0H015178Y2V4CX10C2KGHF4 user:anne can_view document --contextual-tuple "user:anne can_view folder:product" --contextual-tuple "folder:product parent document:roadmap" --consistency "HIGHER_CONSISTENCY"`, //nolint:lll
Args: cobra.ExactArgs(3), //nolint:mnd,lll
RunE: func(cmd *cobra.Command, args []string) error {
clientConfig := cmdutils.GetClientConfig(cmd)

Expand Down
4 changes: 2 additions & 2 deletions cmd/query/list-relations.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ var listRelationsCmd = &cobra.Command{
Use: "list-relations",
Short: "List Relations",
Long: "List relations that a user has with an object.",
Example: `fga query list-relations --store-id=01H0H015178Y2V4CX10C2KGHF4 user:anne document:roadmap --relation can_view`, //nolint:lll
Args: cobra.ExactArgs(2), //nolint:mnd,lll
Example: `fga query list-relations --store-id=01H0H015178Y2V4CX10C2KGHF4 user:anne document:roadmap --relation can_view --consistency "HIGHER_CONSISTENCY"`, //nolint:lll
Args: cobra.ExactArgs(2), //nolint:mnd,lll
RunE: func(cmd *cobra.Command, args []string) error {
clientConfig := cmdutils.GetClientConfig(cmd)
fgaClient, err := clientConfig.GetFgaClient()
Expand Down
2 changes: 1 addition & 1 deletion cmd/query/list-users.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ var listUsersCmd = &cobra.Command{
Use: "list-users",
Short: "List users",
Long: "List all users that have a certain relation with a particular object",
Example: `fga query list-users --store-id=01H0H015178Y2V4CX10C2KGHF4 --object document:roadmap --relation can_view`,
Example: `fga query list-users --store-id=01H0H015178Y2V4CX10C2KGHF4 --object document:roadmap --relation can_view --consistency "HIGHER_CONSISTENCY"`, //nolint:lll
RunE: func(cmd *cobra.Command, _ []string) error {
clientConfig := cmdutils.GetClientConfig(cmd)
fgaClient, err := clientConfig.GetFgaClient()
Expand Down

0 comments on commit 75912c4

Please sign in to comment.