Meteor create --apollo, Not Yet Compatible with Meteor 3.0?

Did you try the swydo:ddp-apollo approach to see if it works?

About calling the method getUserId, I checked your reproduction, and it doesn’t have login, so it makes sense it never returns a user. But I’m guessing your shared results were gathered from your running app, right?

Did you try the swydo:ddp-apollo approach to see if it works?

Yes, I tried it in the Mv3 version of my running app, and it did not appear to work yet. It may depend on other parts of swydo:ddp-apollo, or of the Swydo Meteor package.

I’ve updated the repo to include a new branch (origin/adding_meteor_accounts) with rudimentary Meteor account creation code. On creating an account, the new user becomes logged in, and can be used for testing purposes.

Interesting – in this code:

async function startApolloServer() {
    const {url} = await startStandaloneServer(server, {
        context: async ({req}) => {
            let userTest = null;
            let userTest2 = null;
            let userTest3 = null;
            let userId = null;
            try {
                userTest = await getUser(req.headers.authorization)
                userTest2 = await Meteor.call(
                    "getUserId"
                );
                userTest3 = await Meteor.users.findOneAsync();
                userId = userTest3._id;
            } catch (error) {
                console.log('context: ', error)
            }
            return {
                userId: userId
            };
            return {
                userId,
            };
        },
    });

userTest3 = await Meteor.users.findOneAsync(); is working. But I think it’s just returning the first user found, rather than the currently logged-in user on the client.

Given that I can access Meteor.users.findOneAsync(); is there another call that would be expected to be available, that can access the currently logged-in user?

UPDATE: In the same code, in this section:

async function startApolloServer() {
    const {url} = await startStandaloneServer(server, {
        context: async ({req}) => {

req is coming in with req.headers but not with req.headers.authorization. If I can get req.headers.authorization, then this might work:

userTest = await getUser(req.headers.authorization)