Skip to content

Latest commit

 

History

History
65 lines (49 loc) · 859 Bytes

README.md

File metadata and controls

65 lines (49 loc) · 859 Bytes

Netcore 2.2 with GraphQL and EntityFrameworkCore MSSQL


This is an example project of how to use GraphQL with EF to query and manipulate with data.

EF will populate person table with 3 entries.


Get started:

Modify your sql server connection string in the appsettings.Development.json file if needed.

dotnet restore

dotnet build

dotnet run

Playground

Open https://localhost:5001 in your browser.

  • Query all persons
{
  allPersons {
    id
    name
    
  }
}
  • Query person with name "Rachelle"
{
  allPersons(name: "Rachelle") {
    id
    name
    
  }
}
  • Mutation add person
mutation PersonMutation($person: PersonInputType!){
  addPerson(person: $person){
    id
  }
}

Variable:

{
    "person":{
      "name": "John",
      "surname": "Cena"
    }
}