GraphQL.DynamoDB 1.0.0

dotnet add package GraphQL.DynamoDB --version 1.0.0
NuGet\Install-Package GraphQL.DynamoDB -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GraphQL.DynamoDB" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GraphQL.DynamoDB --version 1.0.0
#r "nuget: GraphQL.DynamoDB, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install GraphQL.DynamoDB as a Cake Addin
#addin nuget:?package=GraphQL.DynamoDB&version=1.0.0

// Install GraphQL.DynamoDB as a Cake Tool
#tool nuget:?package=GraphQL.DynamoDB&version=1.0.0

GraphQL.DynamoDB

An adaptor to use GraphQL in AspNetCore with a dynamo DB backing without defining models.

Minimum Setup

You can add the package to your AspNetCore app from NuGet

Install-Package GraphQL.DynamoDB

The easiest way to load the schema is to preload it before starting your web host.

        public static async Task Main(string[] args)
        {
            var host = CreateWebHostBuilder(args).Build();
            await host.LoadDynamoDbSchema();
            await host.RunAsync();
        }

You'll also need to add configure the services in your Startup.cs

using Amazon.DynamoDBv2;
using GraphQL.DynamoDB;
...

            services.AddAWSService<IAmazonDynamoDB>();
            services.AddGraphQL();

How it works

The LoadDynamoDbSchema method attempts to load table data by using the AWSSDK API for ListTablesAsync and DescribeTableAsync. The list of tables are then converted to a GraphQL Schema during instantiation of the DynamoDBSchema class. The schema can be accessed by injecting GraphQL.Types.ISchema and using it as normal.

Additional columns

Since DynamoDB is a no-SQL database, we may also need to tell the schema to allow for additional properties by passing them to the LoadDynamoDbSchema extension method.

            await host.LoadDynamoDbSchema(new Dictionary<string, IEnumerable<(string, string)>>
            {
                // Optionally declare properties that are not defined in the schema
                { "TableName", new[] { ( "StringColumn", "S" ), ( "NumericalColumn", "N"), ("StringArrayColumn", "SS") } }
            });

Please note that more complex types are not currently supported.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 621 4/22/2019