Skip to content
No description, website, or topics provided.
JavaScript C# CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Controllers
Core
Properties
Queries
Requests
Views
wwwroot
.gitignore
LICENSE
Program.cs
README.md
Startup.cs
appsettings.json
graphql-sample.csproj
package.json
webpack.config.js
yarn.lock

README.md

GraphQL with .NET Core sample application

How to start

Clone the repository and execute in the terminal following commands:

npm install
npm install yarn -g
yarn start
dotnet restore
dotnet run

Open the web browser and navigate to the URL: http://localhost:5000 and you shall see the GraphiQL UI :).

Sample query:

query ($name: String!, $withSets: Boolean!){
  plan(name: $name) {
    name,
    weeks {
      number,
      days {
        name,
      	dayOfWeek,
        sessions {
          name,
          number,
          exercises {
            name
            number,
            sets @include(if: $withSets) {
              number,
              load,
              repetitions
            }
          }
        }
      }
    }
  }
}

Variables

{
  "name": "stronglifts",
  "withSets": true
}

Sample mutation

mutation ($name: String!, $weeks: Int! $daysBreak: Int!){
  createPlan(name: $name, weeks: $weeks, daysBreak: $daysBreak) {
    name,
    weeks {
      number,
      days {
        name,
      	dayOfWeek,
        sessions {
          name,
          number,
          exercises {
            name
            number,
            sets {
              number,
              load,
              repetitions
            }
          }
        }
      }
    }
  }
}

Variables

{
  "name": "custom",
  "weeks": 4,
  "daysBreak": 2
}
You can’t perform that action at this time.