Markind.HotChocolate.AzureFunctions.IsolatedProcess
0.0.1
See the version list below for details.
dotnet add package Markind.HotChocolate.AzureFunctions.IsolatedProcess --version 0.0.1
NuGet\Install-Package Markind.HotChocolate.AzureFunctions.IsolatedProcess -Version 0.0.1
<PackageReference Include="Markind.HotChocolate.AzureFunctions.IsolatedProcess" Version="0.0.1" />
paket add Markind.HotChocolate.AzureFunctions.IsolatedProcess --version 0.0.1
#r "nuget: Markind.HotChocolate.AzureFunctions.IsolatedProcess, 0.0.1"
// Install Markind.HotChocolate.AzureFunctions.IsolatedProcess as a Cake Addin #addin nuget:?package=Markind.HotChocolate.AzureFunctions.IsolatedProcess&version=0.0.1 // Install Markind.HotChocolate.AzureFunctions.IsolatedProcess as a Cake Tool #tool nuget:?package=Markind.HotChocolate.AzureFunctions.IsolatedProcess&version=0.0.1
Multi Schema/Endpoint for HotChocolate Azure Functions.
Azure supports multiple endpoints using multiple functions, official implementation of HotChocolate (as 13.0.0-preview.66) does not yet.
I let it be as mush as possible aspnet like implementation, so we do not need to change a lot of code when coming from server project.
Azure Functions Isolated Process
Install
dotnet add package Markind.HotChocolate.AzureFunctions.IsolatedProcess
Why Markind? it is the name of the company I am willing to build. It is about to left mark in the earth.
Program
var host = new HostBuilder()
.ConfigureFunctionsWorkerDefaults()
.ConfigureServices(s =>{
s.AddGraphQLServer("persons") // schema 1
.AddQueryType<Query>();
s.AddGraphQLServer("persons2") // schema 2 , etc.
.AddQueryType<Query2>();
})
.AddGraphQLFunctions()// Add support for Azure FunctionS
.Build();
host.Run();
Similarly if using Startup.cs
Function
Again make sure to use IMultiSchemaRequestExecutor.
public class GraphQLFunction
{
private readonly IMultiSchemaRequestExecutor _executor;
public GraphQLFunction(IMultiSchemaRequestExecutor executor)
{
_executor = executor;
}
[Function("GraphQLHttpFunction")]
public Task<HttpResponseData> Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = "persons/{**slug}")]
HttpRequestData request)
=> _executor.ExecuteAsync(request, "persons");
}
Create the other functions and make sure to set the schema name executor.ExecuteAsync(request, "persons2");
Full sample at samples/Azf.IsolatedProcess
Sponsor it
Glad to be of help, it took me more than a week cracking my head 😂 to understand how it should work and give the easiest and smoothly solution possible. I am willing to improve it or fix issues if needed. So if you wish ❤️
Mentions
Base code is using official implementation of HotChocolate.AzureFunctions and I reviewed a lot GraphQL.AzureFunctionsProxy
Notice
This implementation has original implementation from HotChocolate.AzureFunctions as well, I made this way with the hope of integrate it in the official HotChocolate repo. Be sure to use .AddGraphQLFunctions()
with s at the end, using without it you will be using original implementation that has no multi schema support.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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. |
-
net5.0
- Markind.HotChocolate.AzureFunctions (>= 0.0.1)
- Microsoft.Azure.Functions.Worker.Core (>= 1.4.0)
- Microsoft.Azure.Functions.Worker.Extensions.Abstractions (>= 1.1.0)
-
net6.0
- Markind.HotChocolate.AzureFunctions (>= 0.0.1)
- Microsoft.Azure.Functions.Worker.Core (>= 1.4.0)
- Microsoft.Azure.Functions.Worker.Extensions.Abstractions (>= 1.1.0)
-
net7.0
- Markind.HotChocolate.AzureFunctions (>= 0.0.1)
- Microsoft.Azure.Functions.Worker.Core (>= 1.4.0)
- Microsoft.Azure.Functions.Worker.Extensions.Abstractions (>= 1.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.