@@ -68,13 +68,15 @@ Execute GraphQL statements
68
68
69
69
````
70
70
USAGE
71
- $ sf api request graphql -o <value> --body file [--json] [--flags-dir <value>] [-S Example: report.xlsx | -i]
71
+ $ sf api request graphql -o <value> --body file [--json] [--flags-dir <value>] [--api-version <value>] [-S Example:
72
+ report.xlsx | -i]
72
73
73
74
FLAGS
74
75
-S, --stream-to-file=Example: report.xlsx Stream responses to a file.
75
76
-i, --include Include the HTTP response status and headers in the output.
76
77
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the
77
78
`target-org` configuration variable is already set.
79
+ --api-version=<value> Override the api version used for api requests made by this command
78
80
--body=file (required) File or content with GraphQL statement. Specify "-" to read from
79
81
standard input.
80
82
@@ -90,7 +92,7 @@ DESCRIPTION
90
92
91
93
EXAMPLES
92
94
- Runs the graphql query directly via the command line
93
- sf api request graphql --body '{ "query": "query accounts { uiapi { query { Account { edges { node { Id \n Name { value } } } } } } }" }'
95
+ sf api request graphql --body "query accounts { uiapi { query { Account { edges { node { Id \n Name { value } } } } } } }"
94
96
- Runs a mutation to create an Account, with an `example.txt` file, containing
95
97
```text
96
98
mutation AccountExample{
@@ -116,7 +118,7 @@ will create a new account returning specified fields (Id, Name)
116
118
117
119
```
118
120
119
- _See code: [src/commands/api/request/graphql.ts](https://github.com/salesforcecli/plugin-api/blob/v1.1 .0/src/commands/api/request/graphql.ts)_
121
+ _See code: [src/commands/api/request/graphql.ts](https://github.com/salesforcecli/plugin-api/blob/1.2 .0/src/commands/api/request/graphql.ts)_
120
122
121
123
## `sf api request rest ENDPOINT`
122
124
@@ -172,6 +174,6 @@ $ sf api request rest 'sobjects/account' --body info.json --method POST
172
174
173
175
```
174
176
175
- _See code: [src/commands/api/request/rest.ts](https://github.com/salesforcecli/plugin-api/blob/v1.1 .0/src/commands/api/request/rest.ts)_
177
+ _See code: [src/commands/api/request/rest.ts](https://github.com/salesforcecli/plugin-api/blob/1.2 .0/src/commands/api/request/rest.ts)_
176
178
<!-- commandsstop -->
177
179
```
0 commit comments