From 8e0fae626eeff4b5f9f1960dabe3551c0c8fc0e4 Mon Sep 17 00:00:00 2001 From: Oz Weiss Date: Wed, 4 Aug 2021 13:11:12 +0300 Subject: [PATCH] fix cli apply:introspection-query-policy (#338) --- cli/README.md | 20 +++-- cli/oclif.manifest.json | 171 +--------------------------------------- cli/package.json | 2 +- cli/src/client/index.ts | 4 +- 4 files changed, 13 insertions(+), 184 deletions(-) diff --git a/cli/README.md b/cli/README.md index 136f6135..2dd2f145 100644 --- a/cli/README.md +++ b/cli/README.md @@ -72,12 +72,11 @@ args: ## 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` @@ -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` @@ -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` @@ -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]` @@ -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)_ diff --git a/cli/oclif.manifest.json b/cli/oclif.manifest.json index c125fd7d..c389e887 100644 --- a/cli/oclif.manifest.json +++ b/cli/oclif.manifest.json @@ -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}]}}} \ No newline at end of file diff --git a/cli/package.json b/cli/package.json index e2a2d717..b02cedff 100644 --- a/cli/package.json +++ b/cli/package.json @@ -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", diff --git a/cli/src/client/index.ts b/cli/src/client/index.ts index bc233ec5..64a34335 100644 --- a/cli/src/client/index.ts +++ b/cli/src/client/index.ts @@ -122,7 +122,7 @@ export async function uploadBasePolicy( } export async function uploadIntrospectionQueryPolicy( - introspectionQuery: IntrospectionQueryPolicyInput, + introspectionQueryPolicy: IntrospectionQueryPolicyInput, options: { registryUrl: string; dryRun?: boolean; @@ -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(