My schema
import {Meteor} from 'meteor/meteor';
import Posts from '../posts/posts';
export const typeDefs = `
type Author {
_id: String
username: String
}
type Post {
_id: String
title: String
private: Boolean
author: Author
}
type Query {
posts(private: Boolean): [Post],
}
schema {
query: Query
}
`;
export const resolvers = {
Query: {
posts(root, args, context) {
return Posts.find({private: args.private}).fetch();
},
},
Post: {
author(post){
// Please update to support nested arguments
return Meteor.users.findOne.....................;
},
},
};
--------------------
import {createApolloServer} from 'meteor/apollo';
import {makeExecutableSchema} from 'graphql-tools';
import {typeDefs, resolvers} from '../../api/apollo/schema';
const schema = makeExecutableSchema({
typeDefs,
resolvers,
});
createApolloServer({
schema,
});
My query
{
posts(private: true){
_id,
title,
author(username: "theara"){
_id,
username
}
}
}
Please help me