GraphQL 实用程序的命令行参数 - Amazon Neptune
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

GraphQL 实用程序的命令行参数

  • --help, -h – 将 GraphQL 实用程序的帮助文本返回到控制台。

     

  • --input-schema (schema text) – 要用作输入的 GraphQL 架构,带或不带指令。

     

  • --input-schema-file (file URL) – 包含要用作输入的 GraphQL 架构的文件的 URL。

     

  • --input-schema-changes-file (file URL) – 包含要对 GraphQL 架构所做的更改的文件的 URL。如果您多次对 Neptune 数据库运行该实用程序,并且还手动更改 GraphQL 源架构(可能添加自定义查询),则手动更改将丢失。为避免这种情况,请将您的更改放在更改文件中,然后使用此参数将其传入。

    更改文件采用以下 JSON 格式:

    [ { "type": "(GraphQL type name)", "field": "(GraphQL field name)", "action": "(remove or add)", "value": "(value)" } ]

    有关更多信息,请参阅 Todo 示例

     

  • --input-graphdb-schema (schema text) – 您可以用文本形式表达 graphdb 架构以用作输入,而不是对 Neptune 数据库运行该实用程序。graphdb 架构具有如下所示的 JSON 格式:

    { "nodeStructures": [ { "label":"nodelabel1", "properties": [ { "name":"name1", "type":"type1" } ] }, { "label":"nodelabel2", "properties": [ { "name":"name2", "type":"type1" } ] } ], "edgeStructures": [ { "label":"label1", "directions": [ { "from":"nodelabel1", "to":"nodelabel2", "relationship":"ONE-ONE|ONE-MANY|MANY-MANY" } ], "properties": [ { "name":"name1", "type":"type1" } ] } ] }

     

  • --input-graphdb-schema-file (file URL) – 您可以将 graphdb 架构保存在文件中以用作输入,而不是对 Neptune 数据库运行该实用程序。有关 graphdb 架构文件的 JSON 格式示例,请参阅上面的 --input-graphdb-schema

     

  • --input-graphdb-schema-neptune-endpoint (endpoint URL) – Neptune 数据库端点,实用程序应从中提取 graphdb 架构。

     

  • --output-schema-file (file name) – GraphQL 架构的输出文件名。如果未指定,则默认值为 output.schema.graphql,除非使用 --create-update-aws-pipeline-name 设置了管道名称,在这种情况下,默认文件名为 (pipline name).schema.graphql

     

  • --output-source-schema-file (file name) – 带有指令的 GraphQL 架构的输出文件名。如果未指定,则默认值为 output.source.schema.graphql,除非使用 --create-update-aws-pipeline-name 设置了管道名称,在这种情况下,默认名称为 (pipeline name).source.schema.graphql

     

  • --output-schema-no-mutations – 如果存在此参数,则该实用程序不会在 GraphQL API 中生成任何突变,只生成查询。

     

  • --output-neptune-schema-file (file name) – 实用程序发现的 Neptune graphdb 架构的输出文件名。如果未指定,则默认值为 output.graphdb.json,除非使用 --create-update-aws-pipeline-name 设置了管道名称,在这种情况下,默认文件名为 (pipeline name).graphdb.json

     

  • --output-js-resolver-file (file name) – 解析器代码副本的输出文件名。如果未指定,则默认值为 output.resolver.graphql.js,除非使用 --create-update-aws-pipeline-name 设置了管道名称,在这种情况下,文件名为 (pipeline name).resolver.graphql.js

    此文件压缩在上传到运行解析器的 Lambda 函数的代码包中。

     

  • --output-resolver-query-sdk – 此参数指定该实用程序的 Lambda 函数应使用 Neptune 数据 SDK 来查询 Neptune,该 SDK 从 Neptune 引擎版本 1.2.1.0.R5(这是默认版本)开始推出。但是,如果该实用程序检测到较旧的 Neptune 引擎版本,则它建议改用 HTTPS Lambda 选项,您可以使用 --output-resolver-query-https 参数调用该选项。

     

  • --output-resolver-query-https – 此参数指定该实用程序的 Lambda 函数应使用 Neptune HTTPS API 查询 Neptune。

     

  • --create-update-aws-pipeline— 此参数会触发创建供 GraphQL API 使用的Amazon资源,包括 GraphQL API 和运行 AppSync 解析器的 Lambda。

     

  • --create-update-aws-pipeline-name (pipeline name)— 此参数设置管道的名称,例如 Lambda pipeline-name 函数pipeline-name的 API AppSync 或函数。如果未指定名称,则 --create-update-aws-pipeline 使用 Neptune 数据库名称。

  • --create-update-aws-pipeline-region (Amazon region) – 此参数设置在其中创建 GraphQL API 的管道的 Amazon 区域。如果未指定,则默认区域为 us-east-1 或 Neptune 数据库所在区域(从数据库端点提取)。

  • --create-update-aws-pipeline-neptune-endpoint (endpoint URL) – 此参数设置 Lambda 函数用于查询数据库的 Neptune 数据库端点。如果未设置,则使用由 --input-graphdb-schema-neptune-endpoint 设置的端点。

  • --remove-aws-pipeline-name (pipeline name) – 此参数移除使用 --create-update-aws-pipeline 创建的管道。要删除的资源列在名为 (pipeline name).resources.json 的文件中。

  • --output-aws-pipeline-cdk— 此参数会触发一个 CDK 文件的创建,该文件可用于为 GraphQL API 创建Amazon资源,包括 GraphQL API 和运行解析器的 Lambda 函数。 AppSync

  • --output-aws-pipeline-cdk-neptume-endpoint (endpoint URL) – 此参数设置 Lambda 函数用于查询 Neptune 数据库的 Neptune 数据库端点。如果未设置,则使用由 --input-graphdb-schema-neptune-endpoint 设置的端点。

  • --output-aws-pipeline-cdk-name (pipeline name)— 此参数设置要使用的 AppSync API 和 Lambda 管道名称函数的管道名称。如果未指定,则 --create-update-aws-pipeline 使用 Neptune 数据库名称。

  • --output-aws-pipeline-cdk-region (Amazon region) – 这会设置在其中创建 GraphQL API 的管道的 Amazon 区域。如果未指定,则它默认为 us-east-1 或 Neptune 数据库所在的区域(从数据库端点提取)。

  • --output-aws-pipeline-cdk-file (file name) – 这将设置 CDK 文件名。如果未设置,则默认为 (pipeline name)-cdk.js