graph2: Added Channel type and queries
the build failed

This commit is contained in:
2018-09-13 22:49:36 +02:00
parent 9978d7380b
commit 1be4088a8f
5 changed files with 121 additions and 23 deletions
+4
View File
@@ -17,3 +17,7 @@ models:
model: git.aiterp.net/rpdata/api/model/character.Character
CharactersFilter:
model: git.aiterp.net/rpdata/api/model/character.Filter
Channel:
model: git.aiterp.net/rpdata/api/model/channel.Channel
ChannelsFilter:
model: git.aiterp.net/rpdata/api/model/channel.Filter
+15
View File
@@ -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)
}
+7
View File
@@ -8,6 +8,13 @@ type Query {
# Find characters
characters(filter: CharactersFilter): [Character!]!
# Find channel by name
channel(name: String!): Channel!
# Find channels
channels(filter: ChannelsFilter): [Channel!]!
# Find all distinct tags used in stories
+63
View File
@@ -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
}