nicolaslopezj / meteor-apollo-accounts

Meteor accounts in GraphQL
MIT License
145 stars 37 forks source link

Resolvers is not a fonction #24

Closed HBCharles closed 7 years ago

HBCharles commented 7 years ago

After updating the package to the latest version and updating all the spread operators to fonctions the project couldnt work. Im having an error in the chrome console telling me that "resolvers" is not à fonction.

Is there anything else to do to upgrade from the previous version of the package ?

janikvonrotz commented 7 years ago

Can you share the lines of code where the error is thrown? Have updated both, the npm package and meteor package?

HBCharles commented 7 years ago

Both npm package (1.3.0) and meteor package (2.1.0) are updated. I just uninstall them and install again but still have the issue.

Lines of code concerned :

resolvers.js

import { Meteor } from 'meteor/meteor';
import { Resolvers } from 'meteor/nicolaslopezj:apollo-accounts'

const usersResolvers = {
    Query: {
        me (root, args, context) {
            const { userId } = context ? context : { userId: null };
            if (userId)
            return Meteor.users.findOne({ _id: userId });
        },
        users (root, args) {
            return Meteor.users.find().fetch();
        }
    },
    Mutation: {
        ...Resolvers()
    }
};

export default usersResolvers;

Error message in Chrome console image

HBCharles commented 7 years ago

Finally got it working just by moving my schema, server side instead of lib.