Skip to content

Instantly share code, notes, and snippets.

View josmanperez's full-sized avatar
😊

Josman josmanperez

😊
View GitHub Profile
@josmanperez
josmanperez / filterMovies2.js
Created April 23, 2021 17:00
GraphQL Custom Resolver linked function with parameters
exports = async function({imdbRating, genres, rated, languages}) {
const request = context.services.get('mongodb-atlas').db('sample_mflix').collection('movies');
const lang = languages === undefined ? ["English", "Japanese"] : languages;
const pipeline = [
{
$match: {
"imdb.rating": { "$gte": imdbRating },