Skip to content

Commit

Permalink
update example queries/mutations
Browse files Browse the repository at this point in the history
  • Loading branch information
saerdnaer committed Dec 24, 2021
1 parent 06d40ba commit 14292cc
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 61 deletions.
78 changes: 78 additions & 0 deletions examples/create-conferences.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
mutation createConference {
createConference(input: {
conference: {
acronym: "35C3"
title: "35th Chaos Communication Congress"
startDate: "2018-12-27"
endDate: "2018-12-30"
}
}) { conference {id} }
}


# query foo {
# conferenceByAcronym(acronym: "35C3") {
# id
# }
# }

mutation createDay {
createDay(input: {
day: {
conferenceId: "7"
index: 1
startDate: "2018-12-27T11:00:00+01:00"
endDate: "2018-12-28T03:00:00+01:00"
}
}) { day { id } }
}



# alternative with nested mutation plugin
# c.f. https://www.npmjs.com/package/postgraphile-plugin-nested-mutations


mutation createConferenceAndDays {
createConference(
input: {
conference: {
acronym: "35C3"
title: "35th Chaos Communication Congress"
startDate: "2018-12-27"
endDate: "2018-12-30"
daysUsingId: {
create: [
{
index: 1
startDate: "2018-12-27T11:00:00+01:00"
endDate: "2018-12-28T03:00:00+01:00"
}
{
index: 2
startDate: "2018-12-28T11:00:00+01:00"
endDate: "2018-12-29T03:00:00+01:00"
}
{
index: 3
startDate: "2018-12-29T11:00:00+01:00"
endDate: "2018-12-30T03:00:00+01:00"
}
{
index: 4
startDate: "2018-12-30T11:00:00+01:00"
endDate: "2018-12-30T19:00:00+01:00"
}
]
}
}
}
) {
conference {
id
}
}
}



115 changes: 54 additions & 61 deletions examples/schedule.gql
Original file line number Diff line number Diff line change
@@ -1,64 +1,57 @@




query schedule {
conferenceByAcronym(acronym: "35C3") {
acronym
title
start: startDate
end: endDate
days: daysByConferenceId(orderBy:INDEX_ASC) {
nodes {
index
date
startDate
endDate
}
}
rooms: roomsByConferenceId {
nodes {
name
}
}
events: eventsByConferenceId {
nodes {
id: localId
guid
dayIndex
roomName
logo
startDate
startTime
duration: durationTime
slug
title
subtitle
track: trackByTrackId {
name
}
eventType
language
abstract
description
recordingLicense
doNotRecord
persons {
nodes {
id
publicName
}
}
links {
title
url
}
attachments {
title
url
}
}
}
}
conferences {
nodes {
acronym
}
}
conference: conferenceByAcronym(acronym: "36c3") {
acronym
title
start: startDate
end: endDate
rooms {
nodes {
name
}
}
events {
totalCount
nodes {
id: localId
guid
url
dayIndex
roomName
logo
startDate
startTime
duration: durationTime
slug
title
subtitle
track
eventType
language
abstract
description
recordingLicense
doNotRecord
persons {
nodes {
guid
publicName
}
}
links {
title
url
}
attachments {
title
url
}
}
}
}
}

0 comments on commit 14292cc

Please sign in to comment.