Skip to content

Commit

Permalink
fix cli apply:introspection-query-policy (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
thewizarodofoz authored Aug 4, 2021
1 parent 006708d commit 8e0fae6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 184 deletions.
20 changes: 9 additions & 11 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@ args:
## Commands

<!-- commands -->

- [`stitch apply:base-policy RESOURCEPATH`](#stitch-applybase-policy-resourcepath)
- [`stitch apply:introspection-query-policy RESOURCEPATH`](#stitch-applyintrospection-query-policy-resourcepath)
- [`stitch apply:resources RESOURCESPATH`](#stitch-applyresources-resourcespath)
- [`stitch help [COMMAND]`](#stitch-help-command)
- [`stitch refresh:remote-schema REMOTESERVERURL`](#stitch-refreshremote-schema-remoteserverurl)
* [`stitch apply:base-policy RESOURCEPATH`](#stitch-applybase-policy-resourcepath)
* [`stitch apply:introspection-query-policy RESOURCEPATH`](#stitch-applyintrospection-query-policy-resourcepath)
* [`stitch apply:resources RESOURCESPATH`](#stitch-applyresources-resourcespath)
* [`stitch help [COMMAND]`](#stitch-help-command)
* [`stitch refresh:remote-schema REMOTESERVERURL`](#stitch-refreshremote-schema-remoteserverurl)

## `stitch apply:base-policy RESOURCEPATH`

Expand All @@ -99,7 +98,7 @@ EXAMPLE
Uploaded successfully!
```
_See code: [src/commands/apply/base-policy.ts](https://github.com/Soluto/stitch/blob/v0.0.17/src/commands/apply/base-policy.ts)_
_See code: [src/commands/apply/base-policy.ts](https://github.com/Soluto/stitch/blob/v0.0.18/src/commands/apply/base-policy.ts)_
## `stitch apply:introspection-query-policy RESOURCEPATH`
Expand All @@ -121,7 +120,7 @@ EXAMPLE
Uploaded successfully!
```
_See code: [src/commands/apply/introspection-query-policy.ts](https://github.com/Soluto/stitch/blob/v0.0.17/src/commands/apply/introspection-query-policy.ts)_
_See code: [src/commands/apply/introspection-query-policy.ts](https://github.com/Soluto/stitch/blob/v0.0.18/src/commands/apply/introspection-query-policy.ts)_
## `stitch apply:resources RESOURCESPATH`
Expand All @@ -144,7 +143,7 @@ EXAMPLE
Uploaded successfully!
```
_See code: [src/commands/apply/resources.ts](https://github.com/Soluto/stitch/blob/v0.0.17/src/commands/apply/resources.ts)_
_See code: [src/commands/apply/resources.ts](https://github.com/Soluto/stitch/blob/v0.0.18/src/commands/apply/resources.ts)_
## `stitch help [COMMAND]`
Expand Down Expand Up @@ -182,6 +181,5 @@ EXAMPLE
Remote schema refreshed successfully!
```
_See code: [src/commands/refresh/remote-schema.ts](https://github.com/Soluto/stitch/blob/v0.0.17/src/commands/refresh/remote-schema.ts)_
_See code: [src/commands/refresh/remote-schema.ts](https://github.com/Soluto/stitch/blob/v0.0.18/src/commands/refresh/remote-schema.ts)_
<!-- commandsstop -->
171 changes: 1 addition & 170 deletions cli/oclif.manifest.json
Original file line number Diff line number Diff line change
@@ -1,170 +1 @@
{
"version": "0.0.17",
"commands": {
"apply:base-policy": {
"id": "apply:base-policy",
"description": "Apply base policy",
"pluginName": "stitch-cli",
"pluginType": "core",
"aliases": [],
"examples": ["\n $ stitch apply:base-policy base-policy.yaml\n Uploaded successfully!\n "],
"flags": {
"registry-url": {
"name": "registry-url",
"type": "option",
"description": "Url of the registry",
"required": true
},
"dry-run": {
"name": "dry-run",
"type": "boolean",
"description": "Should perform a dry run",
"required": false,
"allowNo": false
},
"authorization-header": {
"name": "authorization-header",
"type": "option",
"description": "Custom authorization header",
"required": false
},
"timeout": {
"name": "timeout",
"type": "option",
"description": "Request timeout",
"required": false,
"default": 10000
}
},
"args": [{ "name": "resourcePath", "required": true }]
},
"apply:introspection-query-policy": {
"id": "apply:introspection-query-policy",
"description": "Apply introspection query policy",
"pluginName": "stitch-cli",
"pluginType": "core",
"aliases": [],
"examples": [
"\n $ stitch apply:introspection-query-policy introspection-query-policy.yaml\n Uploaded successfully!\n "
],
"flags": {
"registry-url": {
"name": "registry-url",
"type": "option",
"description": "Url of the registry",
"required": true
},
"dry-run": {
"name": "dry-run",
"type": "boolean",
"description": "Should perform a dry run",
"required": false,
"allowNo": false
},
"authorization-header": {
"name": "authorization-header",
"type": "option",
"description": "Custom authorization header",
"required": false
},
"timeout": {
"name": "timeout",
"type": "option",
"description": "Request timeout",
"required": false,
"default": 10000
}
},
"args": [{ "name": "resourcePath", "required": true }]
},
"apply:resources": {
"id": "apply:resources",
"description": "Apply resources",
"pluginName": "stitch-cli",
"pluginType": "core",
"aliases": [],
"examples": ["$ stitch apply:resources schema.gql\nUploaded successfully!\n"],
"flags": {
"registry-url": {
"name": "registry-url",
"type": "option",
"description": "Url of the registry",
"required": true
},
"dry-run": {
"name": "dry-run",
"type": "boolean",
"description": "Should perform a dry run",
"required": false,
"allowNo": false
},
"authorization-header": {
"name": "authorization-header",
"type": "option",
"description": "Custom authorization header",
"required": false
},
"skip-resource-types": {
"name": "skip-resource-types",
"type": "option",
"description": "Resource types to skip",
"required": false
},
"timeout": {
"name": "timeout",
"type": "option",
"description": "Request timeout",
"required": false,
"default": 10000
},
"verbose": {
"name": "verbose",
"type": "boolean",
"description": "Verbose mode",
"required": false,
"allowNo": false
}
},
"args": [{ "name": "resourcesPath", "required": true }]
},
"refresh:remote-schema": {
"id": "refresh:remote-schema",
"description": "Refresh remote schema",
"pluginName": "stitch-cli",
"pluginType": "core",
"aliases": [],
"examples": [
"$ stitch refresh:remote-schema http://remote-graphql-server/graphql\nRemote schema refreshed successfully!\n"
],
"flags": {
"registry-url": {
"name": "registry-url",
"type": "option",
"description": "Url of the registry",
"required": true
},
"authorization-header": {
"name": "authorization-header",
"type": "option",
"description": "Custom authorization header",
"required": false
},
"timeout": {
"name": "timeout",
"type": "option",
"description": "Request timeout",
"required": false,
"default": 10000
},
"verbose": {
"name": "verbose",
"type": "boolean",
"description": "Verbose mode",
"required": false,
"allowNo": false
}
},
"args": [{ "name": "remoteServerUrl", "required": true }]
}
}
}
{"version":"0.0.18","commands":{"apply:base-policy":{"id":"apply:base-policy","description":"Apply base policy","pluginName":"stitch-cli","pluginType":"core","aliases":[],"examples":["\n $ stitch apply:base-policy base-policy.yaml\n Uploaded successfully!\n "],"flags":{"registry-url":{"name":"registry-url","type":"option","description":"Url of the registry","required":true},"dry-run":{"name":"dry-run","type":"boolean","description":"Should perform a dry run","required":false,"allowNo":false},"authorization-header":{"name":"authorization-header","type":"option","description":"Custom authorization header","required":false},"timeout":{"name":"timeout","type":"option","description":"Request timeout","required":false,"default":10000}},"args":[{"name":"resourcePath","required":true}]},"apply:introspection-query-policy":{"id":"apply:introspection-query-policy","description":"Apply introspection query policy","pluginName":"stitch-cli","pluginType":"core","aliases":[],"examples":["\n $ stitch apply:introspection-query-policy introspection-query-policy.yaml\n Uploaded successfully!\n "],"flags":{"registry-url":{"name":"registry-url","type":"option","description":"Url of the registry","required":true},"dry-run":{"name":"dry-run","type":"boolean","description":"Should perform a dry run","required":false,"allowNo":false},"authorization-header":{"name":"authorization-header","type":"option","description":"Custom authorization header","required":false},"timeout":{"name":"timeout","type":"option","description":"Request timeout","required":false,"default":10000}},"args":[{"name":"resourcePath","required":true}]},"apply:resources":{"id":"apply:resources","description":"Apply resources","pluginName":"stitch-cli","pluginType":"core","aliases":[],"examples":["$ stitch apply:resources schema.gql\nUploaded successfully!\n"],"flags":{"registry-url":{"name":"registry-url","type":"option","description":"Url of the registry","required":true},"dry-run":{"name":"dry-run","type":"boolean","description":"Should perform a dry run","required":false,"allowNo":false},"authorization-header":{"name":"authorization-header","type":"option","description":"Custom authorization header","required":false},"skip-resource-types":{"name":"skip-resource-types","type":"option","description":"Resource types to skip","required":false},"timeout":{"name":"timeout","type":"option","description":"Request timeout","required":false,"default":10000},"verbose":{"name":"verbose","type":"boolean","description":"Verbose mode","required":false,"allowNo":false}},"args":[{"name":"resourcesPath","required":true}]},"refresh:remote-schema":{"id":"refresh:remote-schema","description":"Refresh remote schema","pluginName":"stitch-cli","pluginType":"core","aliases":[],"examples":["$ stitch refresh:remote-schema http://remote-graphql-server/graphql\nRemote schema refreshed successfully!\n"],"flags":{"registry-url":{"name":"registry-url","type":"option","description":"Url of the registry","required":true},"authorization-header":{"name":"authorization-header","type":"option","description":"Custom authorization header","required":false},"timeout":{"name":"timeout","type":"option","description":"Request timeout","required":false,"default":10000},"verbose":{"name":"verbose","type":"boolean","description":"Verbose mode","required":false,"allowNo":false}},"args":[{"name":"remoteServerUrl","required":true}]}}}
2 changes: 1 addition & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stitch-cli",
"version": "0.0.17",
"version": "0.0.18",
"author": "Aviv Rozenboim @AvivRubys",
"repository": "Soluto/stitch",
"homepage": "https://github.com/Soluto/stitch",
Expand Down
4 changes: 2 additions & 2 deletions cli/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export async function uploadBasePolicy(
}

export async function uploadIntrospectionQueryPolicy(
introspectionQuery: IntrospectionQueryPolicyInput,
introspectionQueryPolicy: IntrospectionQueryPolicyInput,
options: {
registryUrl: string;
dryRun?: boolean;
Expand All @@ -134,7 +134,7 @@ export async function uploadIntrospectionQueryPolicy(

const query = options.dryRun ? ValidateIntrospectionQueryPolicyQuery : UploadIntrospectionQueryPolicyMutation;

return registryClient.request<{ result: { success: boolean } }>(query, { introspectionQuery });
return registryClient.request<{ result: { success: boolean } }>(query, { introspectionQueryPolicy });
}

export async function refreshRemoteSchema(
Expand Down

0 comments on commit 8e0fae6

Please sign in to comment.