Experimental GraphQL code generator template for C# projects using instructions provided at this site.
This template reads the introspection JSON of a GraphQL schema as an input. The user has to also mention the output folder where the file has to be written
The name of the output file can be defined in src/config.ts
For executing the template, install graphql-code-generator first. See the install instructions here or you can go through the steps below.
Open command prompt and go to working directory.
Execute yarn add -D [email protected] [email protected] [email protected]
Clone graphql-codegen-csharp in this directory
cd graphql-codegen-csharp
npm install
Execute a yarn build
from the template folder so that a dist
folder is created in it.
cd ..
Execute yarn gql-gen --schema "graphQL schema JSON path" --template graphql-codegen-csharp --out "output folder path"
.
Other CLI Flag options are listed here.