You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,4 +61,5 @@ This release contains new support for Apollo Server integration.
61
61
* Enabled mutations for the Apollo Server ([#98](https://github.com/aws/amazon-neptune-for-graphql/pull/98))
62
62
* Refactored integration tests to be less vulnerable to resolver logic changes ([#99](https://github.com/aws/amazon-neptune-for-graphql/pull/99))
63
63
* Enabled usage of query fragments with Apollo Server ([#103](https://github.com/aws/amazon-neptune-for-graphql/pull/103))
64
-
* Compressed resolver schema file and moved schema initialization outside of event handlers to improve performance ([#111](https://github.com/aws/amazon-neptune-for-graphql/pull/111))
64
+
* Compressed resolver schema file and moved schema initialization outside of event handlers to improve performance ([#111](https://github.com/aws/amazon-neptune-for-graphql/pull/111))
65
+
* Updated and proofread outdated documentation ([#107](https://github.com/aws/amazon-neptune-for-graphql/pull/107))
Copy file name to clipboardExpand all lines: README.md
+28-18Lines changed: 28 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,13 @@
5
5
6
6
The Amazon Neptune utility for GraphQL™ is a Node.js command-line utility to help with the creation and maintenance of a GraphQL API for the Amazon Neptune Database or Neptune Analytics graph. It is a no-code solution for a GraphQL resolver when GraphQL queries have a variable number of input parameters and return a variable number of nested fields.
7
7
8
-
If you **start from a Neptune database with data**, the utility discover the graph database schema including nodes, edges, properties and edges cardinality, generate the GraphQL schema with the directives required to map the GraphQL types to the graph databases nodes and edges, and auto-generate the resolver code. We optimized the resolver code to reduce the latency of querying Amazon Neptune by returning only the data requested by the GraphQL query.*(Note: the utility works only for Property Graph databases, not RDF yet)*
8
+
If you **start from a Neptune database with data**, the utility discovers the graph database schema including nodes, edges, properties and edges cardinality. This database schema is then used to generate the GraphQL schema with the directives required to map the GraphQL types to the graph databases nodes and edges, and auto-generate the resolver code. We optimized the resolver code to reduce the latency of querying Amazon Neptune by returning only the data requested by the GraphQL query.
9
9
10
-
You can also **start with a GraphQL schema with your types and an empty Neptune database**. The utility will process your starting GraphQL schema and inference the directives required to map it to the Neptune database graph nodes and edges. You can also **start with GraphQL schema with the directives**, that you have modified or created.
10
+
> [!NOTE]
11
+
>
12
+
> This utility works for Property Graph databases only. Support for RDF has not yet been added.
13
+
14
+
You can also **start with a GraphQL schema with your types and an empty Neptune database**. The utility will process your starting GraphQL schema and inference the directives required to map it to the Neptune database graph nodes and edges. You can also **start with a GraphQL schema with the directives**, that you have modified or created.
11
15
12
16
The utility has the option to **generate the AWS resources** of the entire pipeline, including the AWS AppSync API, configuring the roles, data source, schema and resolver, and the AWS Lambda that queries Amazon Neptune.
13
17
@@ -85,7 +89,13 @@ To rollback, removing all the AWS resources run:
85
89
<br>
86
90
87
91
# Starting from a GraphQL schema and an empty Neptune database
88
-
You can start from an empty Neptune database and use a GraphQL API to create the data and query it. Running the command below, the utility will automate the creation of the AWS resources. Your *your-graphql-schema-file* must include the GraphQL schema types, like in the TODO example [here](/doc/todoExample.md). The utility will analyze your schema and create an extended version based on your types. It will add queries and mutations for the nodes stored in the graph database, and in case your schema have nested types, it will add relationships between the types stored as edges in the graph database, again see the TODO example [here](/doc/todoExample.md). The utility creates an AppSync GraphQL API, and the required AWS resources, like a pair of IAM roles and a Lambda function with the GraphQL resolver code. As soon as the utility complete the execution, you will find in the AppSync console your new GraphQL API called *your-new-GraphQL-API-name*API. To test it, use the AppSync “Queries” from the menu. (*Note: follow the setup instructions below to enable your environment to reach the Neptune database and create AWS resources.*)
92
+
You can start from an empty Neptune database and use a GraphQL API to create the data and query it. Running the command below, the utility will automate the creation of the AWS resources.
93
+
Your *your-graphql-schema-file* must include the GraphQL schema types, like in the [TODO example](/doc/todoExample.md). The utility will analyze your schema and create an extended version based on your types. It will add queries and mutations for the nodes stored in the graph database, and in case your schema have nested types, it will add relationships between the types stored as edges in the graph database, again see the [TODO example](/doc/todoExample.md).
94
+
The utility creates an AppSync GraphQL API and the required AWS resources, like a pair of IAM roles and a Lambda function with the GraphQL resolver code. As soon as the utility completes the execution, you will find in the AppSync console your new GraphQL API called *your-new-GraphQL-API-name*API. To test it, use the AppSync “Queries” from the menu.
95
+
96
+
> [!TIP]
97
+
>
98
+
> Follow the setup instructions below to enable your environment to reach the Neptune database and create AWS resources.
@@ -106,7 +116,7 @@ You can start from a GraphQL schema with directives for a graph database. For th
106
116
<br>
107
117
108
118
# Customize the GraphQL schema with directives
109
-
The utility generate a GraphQL schema with directives, queries and mutations. You might want to use it as is, or change it. Here below ways to change it.
119
+
The utility generates a GraphQL schema with directives, queries and mutations. You might want to use it as is, or change it. Below are ways to change it.
110
120
111
121
### Please no mutations in my schema
112
122
In case you don't want your Graph API having the option of updating your database data, add the the CLI option `--output-schema-no-mutations`.
@@ -141,15 +151,15 @@ type Airport @alias(property: "airport") {
@@ -246,30 +256,30 @@ You have three option to created the GraphQL API pipeline:
246
256
- You manually create the AWS resources
247
257
248
258
Independently of the method you or the utility will need to create the following resources:
249
-
- Create a IAM role for Lambda called LambdaExecutionRole
259
+
- Create an IAM role for Lambda called LambdaExecutionRole
250
260
- Attach to the LambdaExecutionRole the IAM policy AWSLambdaBasicExecutionRole
251
261
- For VPC (default) attach to the LambdaExecutionRole the IAM policy AWSLambdaVPCAccessExecutionRole
252
262
- For IAM create and attach to the LambdaExecutionRole a new IAM policy that only allow to connect and query Neptune
253
263
- Create a Lambda function with the LambdaExecutionRole
254
-
- Create a IAM for AppSync API to call the Lambda called LambdaInvocationRole
264
+
- Create an IAM for AppSync API to call the Lambda called LambdaInvocationRole
255
265
- Attach to the LambdaInvocationRole the policy LambdaInvokePolicy
256
266
- Create the AppSync GraphQL API
257
267
- Add to the AppSync API a Function with the LambdaInvocationRole to call the Lambda
258
268
259
269
260
270
### Let the utility create the resources
261
-
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>
271
+
With the CLI option `--create-update-aws-pipeline`, and its accessory 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>
262
272
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>
263
273
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>`.
264
-
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).
274
+
The code of the utility uses the JavaScript AWS sdk v3, if you'd like to review the code, it is only in [this file](https://github.com/aws/amazon-neptune-for-graphql/blob/main/src/pipelineResources.js).
265
275
266
276
### I prefer a CDK file
267
-
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>
268
-
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.
277
+
The 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>
278
+
After running, 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.
269
279
See CDK end to end example [here](https://github.com/aws/amazon-neptune-for-graphql/blob/main/doc/cdk.md).
270
280
271
281
### Let me setup the resources manually or with my favorite DevOps toolchain
272
-
[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.
282
+
[Here](https://github.com/aws/amazon-neptune-for-graphql/blob/main/doc/resources.md)is the detailed list of resources needed to configure the GraphQL API pipeline.
0 commit comments