Gisle Aune
6 years ago
5 changed files with 121 additions and 23 deletions
-
4graph2/gqlgen.yml
-
15graph2/queries/channel.go
-
7graph2/schema/root.gql
-
63graph2/schema/types/Channel.gql
-
55model/channel/channel.go
@ -0,0 +1,15 @@ |
|||
package queries |
|||
|
|||
import ( |
|||
"context" |
|||
|
|||
"git.aiterp.net/rpdata/api/model/channel" |
|||
) |
|||
|
|||
func (r *resolver) Channel(ctx context.Context, name string) (channel.Channel, error) { |
|||
return channel.FindName(name) |
|||
} |
|||
|
|||
func (r *resolver) Channels(ctx context.Context, filter *channel.Filter) ([]channel.Channel, error) { |
|||
return channel.List(filter) |
|||
} |
@ -0,0 +1,63 @@ |
|||
# Information about an IRC channel |
|||
type Channel { |
|||
# The channel's name |
|||
name: String! |
|||
|
|||
# Whether the channel should be logged |
|||
logged: Boolean! |
|||
|
|||
# Whether the channel is a hub channel |
|||
hub: Boolean! |
|||
|
|||
# The event name, or `null` if none is specified |
|||
eventName: String |
|||
|
|||
# The location name, or `null` if none is specified |
|||
locationName: String |
|||
} |
|||
|
|||
# Filters for the channels query |
|||
input ChannelsFilter { |
|||
# Filter to either logged or unlogged channels |
|||
logged: Boolean |
|||
|
|||
# Filter by event name |
|||
eventName: String |
|||
|
|||
# Filter by location name |
|||
locationName: String |
|||
} |
|||
|
|||
input ChannelAddInput { |
|||
# The channel's name |
|||
name: String! |
|||
|
|||
# Whether the channel should be logged |
|||
logged: Boolean |
|||
|
|||
# Whether the channel is a hub channel |
|||
hub: Boolean |
|||
|
|||
# The event name, or `null` if none is specified |
|||
eventName: String |
|||
|
|||
# The location name, or `null` if none is specified |
|||
locationName: String |
|||
} |
|||
|
|||
input ChannelEditInput { |
|||
# The channel's name |
|||
name: String! |
|||
|
|||
# Whether the channel should be logged |
|||
logged: Boolean |
|||
|
|||
# Whether the channel is a hub channel |
|||
hub: Boolean |
|||
|
|||
# The event name, or `null` if none is specified |
|||
eventName: String |
|||
|
|||
# The location name, or `null` if none is specified |
|||
locationName: String |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue