Buid GraphQL Server Side using ASP.NET Core and Hot Chocolate
dotnet graphql init https://localhost:5001/graphql/ -n ConferenceClient -p GraphQL.Client
dotnet graphql update -u https://localhost:5001/graphql/ -p GraphQL.Client
mutation AddSpeaker {
addSpeaker(input: {
name: "Speaker Name"
bio: "Speaker Bio"
webSite: "http://speaker.website" }) {
speaker {
id
}
}
}
query GetSpeakerNames {
speakers {
name
}
}
query GetSpeakerNamesInParallel {
a: speakers {
name
bio
}
b: speakers {
name
bio
}
c: speakers {
name
bio
}
}
query GetSpecificSpeakerById {
a: speaker(id: 1) {
name
}
b: speaker(id: 1) {
name
}
}
query GetSpeakerWithSessions {
speakers {
name
sessions {
title
}
}
}
mutation AddSession{
addSession(input:{
title: "The tour of c#",
speakerIds:["U3BlYWtlcgppMQ=="],
}){
session {
id
}
}
}
mutation AddTrack{
addTrack(input:{
name:"Track 1",
}){
errors {
code,
message
},
track{
id
}
}
}
query FindSession{
sessions{
id,
title,
abstract,
duration,
endTime,
startTime,
trackId,
speakers{
id,
name
}
}
}
mutation ScheduleSession{
scheduleSession(input: {
sessionId :"U2Vzc2lvbgppMQ==",
trackId:"VHJhY2sKaTE=",
startTime:"2021-09-21T13:11:55.00",
endTime:"2021-09-21T13:13:55.00"
}){
errors{
code,
message
},
session{
startTime,
endTime,
speakers{
name
},
track{
name
}
}
}
}
query FindSession{
sessions{
nodes{
id,
title,
track{
id,
name
}
}
}
}
{
tracks {
name
}
}
query GetFirstTrack {
tracksPaginated(first: 1) {
edges {
node {
id
name
}
cursor
}
pageInfo {
startCursor
endCursor
hasNextPage
hasPreviousPage
}
}
}
query GetTrackWithSessions {
trackById(id: "VHJhY2sKaTI=") {
id
sessions(first: 1) {
nodes {
title
}
}
}
}
query GetSessionsContainingTourInTitle {
sessions(where: { title: { contains: "tour" } }) {
nodes {
title
}
}
}
mutation RegisterAttendee{
registerAttendee(input:{
emailAddress:"[email protected]",
firstName:"Vinay",
lastName:"Arora",
userName:"vin.aroar"
}){
attendee{
id
},
errors{
code,
message
}
}
}
mutation CheckinAttendee{
checkInAttendee(input:{
attendeeId:"QXR0ZW5kZWUKaTE=",
sessionId:"U2Vzc2lvbgppMQ=="
}){
attendee{
id,
emailAddress
},
errors{
code,
message
}
}
}
subscription {
onSessionScheduled {
title
startTime
}
}
query GetSessionsAndTracks {
sessions {
nodes {
id
}
}
tracks {
id
}
}
mutation ScheduleSession {
scheduleSession(
input: {
sessionId: "U2Vzc2lvbgppMQ=="
trackId: "VHJhY2sKaTE="
startTime: "2021-10-01T16:00"
endTime: "2021-10-01T17:00"
}
) {
session {
title
}
}
}