-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement GraphQL mutations #927
base: master
Are you sure you want to change the base?
Changes from all commits
41702cb
b5135b7
353c602
a806ee6
038d60b
2e4962a
03793ae
f4fd5c1
f45b6c4
d3355a6
349d99a
3b480d1
02bc3d1
471f3fa
5ade6f4
fdbbfdd
0ba7adf
d2503e0
2995437
ec32877
834f47f
4b9165d
fe49a57
f60f4dd
7074163
2d7dbf6
3a55c60
25a45ef
97c6e4e
67cf048
d643350
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,9 @@ directive @bind( | |
|
||
enum CallingConvention { | ||
FirstArgCurrentUser, | ||
FirstArgCurrentObject | ||
FirstArgInput, | ||
FirstArgCurrentObject, | ||
InputAsArgs | ||
} | ||
|
||
enum AuthHook { | ||
|
@@ -347,7 +349,7 @@ type Timeslot implements Node & MyRadioObject @auth(hook: ViewShow) { | |
photo: String | ||
messages: [Message] | ||
webpage: String! | ||
|
||
uploadState: String @meta(key: "upload_state") | ||
tracklist: [TracklistItem!] @bind(class: "\\MyRadio\\ServiceAPI\\MyRadio_TracklistItem", method: "getTracklistForTimeslot", callingConvention: FirstArgCurrentObject) | ||
uploadState: String @meta(key: "upload_state") | ||
} | ||
|
@@ -462,8 +464,70 @@ type Query { | |
|
||
allGenres: [Genre!] @bind(class: "\\MyRadio\\ServiceAPI\\MyRadio_Scheduler", method: "getGenres") @auth(constants: []) | ||
allCreditTypes: [CreditType!] @bind(class: "\\MyRadio\\ServiceAPI\\MyRadio_Scheduler", method: "getCreditTypes") @auth(constants: []) | ||
|
||
findMemberByName(name: String!, limit: Int): [MemberSearchResult!] @bind(class: "\\MyRadio\\ServiceAPI\\MyRadio_User", method: "findByName") @auth(constants: ["AUTH_APPLYFORSHOW"]) # TODO not 100% sure this is the best constant | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess out of scope, but the fact this uses a completely separate auth list to V2 makes me a bit sad. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It still defaults to V2 auth unless you override it. The reason for this is that V2 auth is evaluated once (when you call the endpoint), while GraphQL auth is evaluated for every sub-method in the graph. The reason for that is that some object properties are really just methods (for example |
||
findShowByTitle(term: String!, limit: Int!): [FindShowByTitleResult!] @bind(class: "\\MyRadio\\ServiceAPI\\MyRadio_Scheduler", method: "findShowByTitle") @auth(constants: ["AUTH_APPLYFORSHOW"]) # TODO ditto | ||
} | ||
|
||
#input ShowCreditInput { # this is icky | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lots of commented out stuff :/ |
||
# memberid: [Int!]! | ||
# credittype: [Int!]! | ||
#} | ||
# | ||
#input CreateShowInput { | ||
# title: String! | ||
# description: HTMLString! | ||
# credits: ShowCreditInput! | ||
# genres: [Int!] | ||
# tags: [String!] | ||
# podcast_explicit: Boolean | ||
# subtype: String! # TODO: not a string | ||
# mixclouder: Boolean | ||
# "Unused" | ||
# location: Int | ||
#} | ||
# | ||
#input CreateSeasonWeeks { | ||
# wk1: Boolean! | ||
# wk2: Boolean! | ||
# wk3: Boolean! | ||
# wk4: Boolean! | ||
# wk5: Boolean! | ||
# wk6: Boolean! | ||
# wk7: Boolean! | ||
# wk8: Boolean! | ||
# wk9: Boolean! | ||
# wk10: Boolean! | ||
#} | ||
# | ||
#input CreateSeasonTimes { | ||
# day: [Int!]! | ||
# "Seconds since midnight" | ||
# stime: [Int!]! | ||
# "Seconds since midnight" | ||
# etime: [Int!]! | ||
#} | ||
# | ||
#input CreateSeasonInput { | ||
# show_id: Int! | ||
# weeks: CreateSeasonWeeks! | ||
# times: CreateSeasonTimes! | ||
# tags: [String!] | ||
# description: HTMLString | ||
# subtype: String | ||
#} | ||
|
||
input SendMessageInput { | ||
timeslotId: Int! | ||
message: String! | ||
} | ||
|
||
type Mutation { | ||
# createShow(input: CreateShowInput): Show @bind(class: "\\MyRadio\\ServiceAPI\\MyRadio_Show", method: "create", callingConvention: FirstArgInput) | ||
sendMessageToTimeslot(input: SendMessageInput): Show @bind(class: "\\MyRadio\\ServiceAPI\\MyRadio_Timeslot", method: "sendMessageToTimeslot", callingConvention: InputAsArgs) | ||
} | ||
|
||
schema { | ||
query: Query | ||
mutation: Mutation | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woops