Closed bromanko closed 2 years ago
Started using FSharp.Data.GraphQL but it looks to be a dead end. I want to put the client in the CapeMay.Admin.Domain
library. However the introspection schema must reside alongside the code that consumes it per this issue. So this is out.
Came across Snowflaq which statically generates the client. I'll try this next.
The config file can be placed in a directory. So let's make src/flyio-graphql-client
and put it there. The schemas and queries are also inputs so they will go in there as src/flyio-graphql-client/snowflaqe.json
and src/flyio-graphql-client/queries
.
Snowflaq will generate a new project. Let's call the project FlyIo
.
Set asyncReturnType
to task
since F# is moving this way.
Resulting config:
{
"schema": "src/flyio-graphql-client/fly_schema.json",
"queries": "queries",
"project": "FlyIo",
"output": "src/FlyIo",
"target": "fsharp",
"asyncReturnType": "task",
"serializer": "newtonsoft"
}
Add a just
command to run snowflaqe:
dotnet snowflaqe --config src/flyio-graphql-client/snowflaqe.json --generate
I need to look in to customizing the errorType
. This is a reminder.
This client will be used by the admin server to create new tenants.