Get req userID in middleware for GraphQL endpoint

Where is the “user” object stored for middlewares when using graphql? If I make a request to the REST api, I get pretty ctx.user object with name, id, etc. If I hit graphql, I don’t get any user information on the root object. Is there some way I have to set up my middleware for graphql?

@alexandrebodin is the ctx.state.user not populated with GraphQL (and passed back up the request chain to the middlewares?)

in V4, we can use something like this to get information about the user in the middleware:

// path: ./src/index.js

module.exports = {
  register({ strapi }) {
    const extensionService = strapi.plugin("graphql").service("extension");

    extensionService.use({
      resolversConfig: {
        "Query.authorProfiles": {
          middlewares: [
            async (resolve, parent, args, context, ...rest) => {
              console.log("user", context.state.user);

              return someThingToReturn;
            },
          ],
        },
      },
    });
  },
};