diff --git a/examples/create-conferences.gql b/examples/create-conferences.gql index e69de29..b6b6b20 100644 --- a/examples/create-conferences.gql +++ b/examples/create-conferences.gql @@ -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 + } + } +} + + + diff --git a/examples/schedule.gql b/examples/schedule.gql index bad5781..d41666e 100644 --- a/examples/schedule.gql +++ b/examples/schedule.gql @@ -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 + } + } + } + } }