Skip to content

Commit

Permalink
Fix for typos mostly in documentation but also a couple command line …
Browse files Browse the repository at this point in the history
…arguments and one model-scoped variable that had 'neptume' instead of 'neptune'.
  • Loading branch information
sophiadt authored and Cole-Greer committed Oct 15, 2024
1 parent 3e48485 commit fd0a4fc
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.

Expand All @@ -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") {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 <value>`, 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-file>`, your changes will be applied at once.
```json
[
{ "type": "graphQLTypeName",
Expand Down Expand Up @@ -260,15 +260,15 @@ 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.<br>
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. <br>
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 <value>`.
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)). <br>
After you ran it, you will find in the *output* folder the file *CDK-pipeline-name-cdk.js* and *CDK-pipeline-name.zip*. The ZIP file is the code for the Lambda function.
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.
<br>

# Known limitations
Expand All @@ -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).
<br>

# Contributing
Expand Down
2 changes: 1 addition & 1 deletion doc/cdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`



Expand Down
8 changes: 4 additions & 4 deletions doc/cliReference.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The GraphQL schema with or without directives as data or file name.

`--input-schema-changes-file <value>, -isc <value>`
<br>
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
[
Expand Down Expand Up @@ -64,7 +64,7 @@ The graphdb schema as data or file name. Instead of pointing to a Neptune databa

`--input-graphdb-schema-neptune-endpoint <value>, -ie <value>`
<br>
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 <value>, -o <value>`
Expand All @@ -81,7 +81,7 @@ The file name output for the GraphQL schema with directives. If not specified th

`--output-schema-no-mutations, -onm`
<br>
The inferred GraphQL schema will not have mutuations, just queries.
The inferred GraphQL schema will not have mutations, just queries.

`--output-neptune-schema-file <value>, -og <value>`
<br>
Expand Down Expand Up @@ -135,7 +135,7 @@ It removes the pipeline created with `--create-update-aws-pipeline`. The resourc
<br>
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 <value>, -ce <value>`
`--output-aws-pipeline-cdk-neptune-endpoint <value>, -ce <value>`
<br>
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`.

Expand Down
4 changes: 2 additions & 2 deletions src/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ Parameters
[--output-aws-pipeline-cdk -c ]
[--output-aws-pipeline-cdk-name <value> -cn ] default: Neptune DB name from --input-graphdb-schema-neptune-endpoint if exists
[--output-aws-pipeline-cdk-neptume-endpoint <value> -ce ] default: --input-graphdb-schema-neptune-endpoint if exists
[--output-aws-pipeline-cdk-neptume-database-name <value> -cd ]
[--output-aws-pipeline-cdk-neptune-endpoint <value> -ce ] default: --input-graphdb-schema-neptune-endpoint if exists
[--output-aws-pipeline-cdk-neptune-database-name <value> -cd ]
[--output-aws-pipeline-cdk-region <value> -cr ] default: us-east-1 or from --input-graphdb-schema-neptune-endpoint if exists
[--output-aws-pipeline-cdk-file <value> -cf ] default: --output-aws-pipeline-cdk-name <value>-cdk.js
[--output-aws-pipeline-cdk-neptune-IAM -ci ] default: is Neptune VPC
Expand Down
4 changes: 2 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
8 changes: 4 additions & 4 deletions src/pipelineResources.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '*';
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions test/TestCases/Case06/case.json
Original file line number Diff line number Diff line change
Expand Up @@ -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", "<AIR_ROUTES_DB_HOST>:<AIR_ROUTES_DB_PORT>",
"--output-aws-pipeline-cdk-neptune-endpoint", "<AIR_ROUTES_DB_HOST>:<AIR_ROUTES_DB_PORT>",
"--output-resolver-query-https"],
"host": "<AIR_ROUTES_DB_HOST>",
"port": "<AIR_ROUTES_DB_PORT>",
Expand Down

0 comments on commit fd0a4fc

Please sign in to comment.