feat(gql): adds tests for stream search and user search
This commit is contained in:
@@ -29,11 +29,12 @@ module.exports = {
|
||||
if ( args.limit && args.limit > 100 )
|
||||
throw new UserInputError( 'Cannot return more than 100 items, please use pagination.' )
|
||||
|
||||
let totalCount = await getUserStreamsCount({userId: context.userId, publicOnly: false, searchQuery: args.query} )
|
||||
let totalCount = await getUserStreamsCount( {userId: context.userId, publicOnly: false, searchQuery: args.query} )
|
||||
|
||||
let {cursor, streams} = await getUserStreams({userId: context.userId, limit: args.limit, cursor: args.cursor, publicOnly: false, searchQuery: args.query} )
|
||||
let {cursor, streams} = await getUserStreams( {userId: context.userId, limit: args.limit, cursor: args.cursor, publicOnly: false, searchQuery: args.query} )
|
||||
return {totalCount, cursor: cursor, items: streams}
|
||||
},
|
||||
}
|
||||
},
|
||||
Stream: {
|
||||
|
||||
async collaborators( parent, args, context, info ) {
|
||||
@@ -47,7 +48,7 @@ module.exports = {
|
||||
async streams( parent, args, context, info ) {
|
||||
if ( args.limit && args.limit > 100 )
|
||||
throw new UserInputError( 'Cannot return more than 100 items, please use pagination.' )
|
||||
// Return only the user's public streams if parent.id !== context.userId
|
||||
// Return only the user's public streams if parent.id !== context.userId
|
||||
let publicOnly = parent.id !== context.userId
|
||||
let totalCount = await getUserStreamsCount( { userId: parent.id, publicOnly } )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user