From 97ee31e8986ac151c9f5363f9413e1d1f5d46c8f Mon Sep 17 00:00:00 2001 From: sophiadt Date: Wed, 9 Oct 2024 15:22:08 -0700 Subject: [PATCH] Fix for typos mostly in documentation but also a couple command line arguments and one model-scoped variable that had 'neptume' instead of 'neptune'. --- README.md | 16 ++++++++-------- doc/cdk.md | 2 +- doc/cliReference.md | 8 ++++---- src/help.js | 4 ++-- src/main.js | 4 ++-- src/pipelineResources.js | 8 ++++---- test/TestCases/Case06/case.json | 4 ++-- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 8807842..4d08f5c 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ To rollback, removing all the AWS resources run: `neptune-for-graphql --remove-aws-pipeline-name` <*your-new-GraphQL-API-name*> #### References: -- [here](/doc/routesExample.md) an example using the Air Routes data on Amazon Neptune, showing the outputs of the utility. +- [Here](/doc/routesExample.md) is an example using the Air Routes data on Amazon Neptune, showing the outputs of the utility. - If you are wondering which AWS resources the utility is creating, look at the section below. - To customize the GraphQL schema, look at the section below. @@ -89,7 +89,7 @@ You can start from an empty Neptune database and use a GraphQL API to create the `neptune-for-graphql --input-schema-file `<*your-graphql-schema-file*>` --create-update-aws-pipeline --create-update-aws-pipeline-name` <*your-new-GraphQL-API-name*>` --create-update-aws-pipeline-neptune-endpoint` <*your-neptune-database-endpoint:port*> ` --output-resolver-query-https` #### References: -- [here](https://github.com/aws/amazon-neptune-for-graphql/blob/main/doc/todoExample.md) an example using a TODO GraphQL schema, showing the outputs of the utility. +- [Here](https://github.com/aws/amazon-neptune-for-graphql/blob/main/doc/todoExample.md) is an example using a TODO GraphQL schema, showing the outputs of the utility. - If you are wondering which AWS resources the utility is creating, look at the section below. - To customize the GraphQL schema, look at the section below. @@ -113,7 +113,7 @@ In case you don't want your Graph API having the option of updating your databas ### @alias -This directive can be applied to GraphQL schema types or fields. It maps different names between the graph database and the GraphQL schema. The syntax is *@alias(property: your-name)*. In the example below *airport* is the graph database node label mapped to the *Airport* GraphQL type, and *desc* is the property of the graph database node mapped to the field *description*. See the [Air Routes Example](https://github.com/aws/amazon-neptune-for-graphql/blob/main/doc/routesExample.md). The GraphQL guidence is pascal case for types and camel case for fields. +This directive can be applied to GraphQL schema types or fields. It maps different names between the graph database and the GraphQL schema. The syntax is *@alias(property: your-name)*. In the example below *airport* is the graph database node label mapped to the *Airport* GraphQL type, and *desc* is the property of the graph database node mapped to the field *description*. See the [Air Routes Example](https://github.com/aws/amazon-neptune-for-graphql/blob/main/doc/routesExample.md). The GraphQL guidance is pascal case for types and camel case for fields. ```graphql type Airport @alias(property: "airport") { @@ -160,7 +160,7 @@ type Mutation { } ``` -You can add query or mututation using a Gremlin query. At this time Gremlin queries are limited to return *scalar* values, or *elementMap()* for a single node, or *elementMap().fold()* for a list of nodes. +You can add a query or mutation using a Gremlin query. At this time Gremlin queries are limited to return *scalar* values, or *elementMap()* for a single node, or *elementMap().fold()* for a list of nodes. ```graphql type Query { getAirportWithGremlin(code:String): Airport @graphQuery(statement: "g.V().has('airport', 'code', '$code').elementMap()") # single node @@ -215,7 +215,7 @@ type Mutation { ``` ### Re-apply your changes with --input-schema-changes-file -You might want to modify the GraphQL source schema and run the utility again getting the latest schema from your Neptune database. Every time the utility discover the a new graphdb schema it generates a new GraphQL schema. To inject your changes, you can manually edit the GraphQL source schema, and run the utility again using it as input instead of the Neptune database endpoint, or write your changes the file format below. As you run the utility with the option `--input-schema-changes-file `, your changes will be applied at once. +You might want to modify the GraphQL source schema and run the utility again to get the latest schema from your Neptune database. Every time the utility discovers a new graphdb schema, it generates a new GraphQL schema. To inject your changes, you can manually edit the GraphQL source schema and run the utility again, using it as input instead of the Neptune database endpoint, or write your changes in the format below. As you run the utility with the added option `--input-schema-changes-file `, your changes will be applied at once. ```json [ { "type": "graphQLTypeName", @@ -260,7 +260,7 @@ Independently of the method you or the utility will need to create the following With the CLI option `--create-update-aws-pipeline`, and its accesory options ([see the commands reference](https://github.com/aws/amazon-neptune-for-graphql/blob/main/doc/cliReference.md)), the utility automatically creates the resources.
You need to run the utility from a shell in which you installed the AWS CLI, and it is configured for a user with the permission of creating AWS resources.
The utility creates a file with the list of resources named *pipeline-name.resources.json*. Then it uses the file to modify the existing resources when the user runs the command again, or when the user wants to delete the AWS resources with the command option `--remove-aws-pipeline-name `. -The code of the utiliy uses the JavaScript AWS sdk v3, if you'd like to review the code is only in [this file](https://github.com/aws/amazon-neptune-for-graphql/blob/main/src/pipelineResources.js). +The code of the utility uses the JavaScript AWS sdk v3, if you'd like to review the code is only in [this file](https://github.com/aws/amazon-neptune-for-graphql/blob/main/src/pipelineResources.js). ### I prefer a CDK file To option to trigger the creation of the CDK file starts with `--output-aws-pipeline-cdk`, and its accessory options ([see the commands reference](https://github.com/aws/amazon-neptune-for-graphql/blob/main/doc/cliReference.md)).
@@ -268,7 +268,7 @@ After you ran it, you will find in the *output* folder the file *CDK-pipeline-na See CDK end to end example [here](https://github.com/aws/amazon-neptune-for-graphql/blob/main/doc/cdk.md). ### Let me setup the resources manually or with my favorite DevOps toolchain -[Here](https://github.com/aws/amazon-neptune-for-graphql/blob/main/doc/resources.md) the detailed list of resorces needed to configure the GraphQL API pipeline. +[Here](https://github.com/aws/amazon-neptune-for-graphql/blob/main/doc/resources.md) the detailed list of resources needed to configure the GraphQL API pipeline.
# Known limitations @@ -290,7 +290,7 @@ A copy of the License is located at http://www.apache.org/licenses/LICENSE-2.0 or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing -permissions and limitations under the License. [Full licence page](/LICENSE.txt). +permissions and limitations under the License. [Full license page](/LICENSE.txt).
# Contributing diff --git a/doc/cdk.md b/doc/cdk.md index e68d9ea..b80e2d0 100644 --- a/doc/cdk.md +++ b/doc/cdk.md @@ -11,7 +11,7 @@ Example starting from an Amazon Neptune database endpoint. In this case the util Example starting from a GraphQL schema. -`neptune-for-graphql --input-schema-file `<*your-graphql-schema-file*>` --output-aws-pipeline-cdk --output-aws-pipeline-cdk-name` <*your-new-GraphQL-API-name*>` --output-aws-pipeline-cdk-neptume-endpoint` <*your-neptune-database-endpoint:port*>` --output-resolver-query-https` +`neptune-for-graphql --input-schema-file `<*your-graphql-schema-file*>` --output-aws-pipeline-cdk --output-aws-pipeline-cdk-name` <*your-new-GraphQL-API-name*>` --output-aws-pipeline-cdk-neptune-endpoint` <*your-neptune-database-endpoint:port*>` --output-resolver-query-https` diff --git a/doc/cliReference.md b/doc/cliReference.md index 35e9080..bb45a23 100644 --- a/doc/cliReference.md +++ b/doc/cliReference.md @@ -20,7 +20,7 @@ The GraphQL schema with or without directives as data or file name. `--input-schema-changes-file , -isc `
-The file that contains your GraphQL schema changes to be applied when you run the utility multiple time. When you run the utility poiniting to a database multiple times, and you manually changed the GraphQL source schema, maybe adding a custom query, your chnages will be lost. To avoid it, add your changes to the a json file and pass it to this option. See section [*Re-apply your changes*](#re-apply-your-changes-with---input-schema-changes-file) for the file format. +The file that contains your GraphQL schema changes to be applied when you run the utility multiple time. When you run the utility pointing to a database multiple times, and you manually changed the GraphQL source schema, maybe adding a custom query, your changes will be lost. To avoid it, add your changes to the a json file and pass it to this option. See section [*Re-apply your changes*](#re-apply-your-changes-with---input-schema-changes-file) for the file format. ```json [ @@ -64,7 +64,7 @@ The graphdb schema as data or file name. Instead of pointing to a Neptune databa `--input-graphdb-schema-neptune-endpoint , -ie `
-The Neptune database enpoint from which the utility extract the graphdb schema. Format: `host:port` +The Neptune database endpoint from which the utility extract the graphdb schema. Format: `host:port` ## Output options `--output-folder-path , -o ` @@ -81,7 +81,7 @@ The file name output for the GraphQL schema with directives. If not specified th `--output-schema-no-mutations, -onm`
-The inferred GraphQL schema will not have mutuations, just queries. +The inferred GraphQL schema will not have mutations, just queries. `--output-neptune-schema-file , -og `
@@ -135,7 +135,7 @@ It removes the pipeline created with `--create-update-aws-pipeline`. The resourc
This trigger the creation of a CDK file to be use to create the AWS resources for the GraphQL API, including the AppSync GraphQL API and the Lambda that run the resolver. -`--output-aws-pipeline-cdk-neptume-endpoint , -ce ` +`--output-aws-pipeline-cdk-neptune-endpoint , -ce `
This set the Neptune database endpoint used by the Lambda function to query the Neptune database. If not set it used the endpoint set with `--input-graphdb-schema-neptune-endpoint`. diff --git a/src/help.js b/src/help.js index a450d70..3c564a7 100644 --- a/src/help.js +++ b/src/help.js @@ -141,8 +141,8 @@ Parameters [--output-aws-pipeline-cdk -c ] [--output-aws-pipeline-cdk-name -cn ] default: Neptune DB name from --input-graphdb-schema-neptune-endpoint if exists -[--output-aws-pipeline-cdk-neptume-endpoint -ce ] default: --input-graphdb-schema-neptune-endpoint if exists -[--output-aws-pipeline-cdk-neptume-database-name -cd ] +[--output-aws-pipeline-cdk-neptune-endpoint -ce ] default: --input-graphdb-schema-neptune-endpoint if exists +[--output-aws-pipeline-cdk-neptune-database-name -cd ] [--output-aws-pipeline-cdk-region -cr ] default: us-east-1 or from --input-graphdb-schema-neptune-endpoint if exists [--output-aws-pipeline-cdk-file -cf ] default: --output-aws-pipeline-cdk-name -cdk.js [--output-aws-pipeline-cdk-neptune-IAM -ci ] default: is Neptune VPC diff --git a/src/main.js b/src/main.js index 346d5a3..9838c4b 100644 --- a/src/main.js +++ b/src/main.js @@ -202,11 +202,11 @@ function processArgs() { inputCDKpipeline = true; break; case '-ce': - case '--output-aws-pipeline-cdk-neptume-endpoint': + case '--output-aws-pipeline-cdk-neptune-endpoint': inputCDKpipelineEnpoint = array[index + 1]; break; case '-cd': - case '--output-aws-pipeline-cdk-neptume-database-name': + case '--output-aws-pipeline-cdk-neptune-database-name': inputCDKpipelineDatabaseName = array[index + 1]; break; case '-cn': diff --git a/src/pipelineResources.js b/src/pipelineResources.js index 9e28b30..7c75140 100644 --- a/src/pipelineResources.js +++ b/src/pipelineResources.js @@ -66,7 +66,7 @@ let NEPTUNE_PORT = null; let NEPTUNE_DBSubnetGroup = null; let NEPTUNE_DBSubnetIds = []; let NEPTUNE_VpcSecurityGroupId = null; -let NEPTUME_IAM_AUTH = false; +let NEPTUNE_IAM_AUTH = false; let NEPTUNE_CURRENT_VERSION = ''; let NEPTUNE_CURRENT_IAM = false; let NEPTUNE_IAM_POLICY_RESOURCE = '*'; @@ -235,7 +235,7 @@ async function createLambdaRole() { if (!quiet) spinner.succeed(`Attached ${yellow('AWSLambdaBasicExecutionRole')} to Lambda Role`); - if (NEPTUME_IAM_AUTH) { + if (NEPTUNE_IAM_AUTH) { // Create Neptune query policy if (!quiet) spinner = ora('Creating policy for Neptune queries ...').start(); let command = new CreatePolicyCommand({ @@ -313,7 +313,7 @@ async function createLambdaFunction() { if (!quiet) spinner = ora('Creating Lambda function ...').start(); let params; - if (NEPTUME_IAM_AUTH) { + if (NEPTUNE_IAM_AUTH) { params = { Code: { ZipFile: ZIP @@ -805,7 +805,7 @@ async function createUpdateAWSpipeline (pipelineName, neptuneDBName, neptuneDBre RESOURCES_FILE = `${outputFolderPath}/${NAME}-resources.json`; ADD_MUTATIONS = addMutations; quiet = quietI; - NEPTUME_IAM_AUTH = isNeptuneIAMAuth; + NEPTUNE_IAM_AUTH = isNeptuneIAMAuth; NEPTUNE_HOST = neptuneHost; NEPTUNE_PORT = neptunePort; thisOutputFolderPath = outputFolderPath; diff --git a/test/TestCases/Case06/case.json b/test/TestCases/Case06/case.json index b6e9287..91f2ee4 100644 --- a/test/TestCases/Case06/case.json +++ b/test/TestCases/Case06/case.json @@ -6,9 +6,9 @@ "--output-folder-path", "./test/TestCases/Case06/output", "--output-aws-pipeline-cdk", "--output-aws-pipeline-cdk-name", "AirportCDKTestJest", - "--output-aws-pipeline-cdk-neptume-database-name", "airport00", + "--output-aws-pipeline-cdk-neptune-database-name", "airport00", "--output-aws-pipeline-cdk-region", "us-east-1", - "--output-aws-pipeline-cdk-neptume-endpoint", ":", + "--output-aws-pipeline-cdk-neptune-endpoint", ":", "--output-resolver-query-https"], "host": "", "port": "",