public RootGraphQLMutation( IHttpContextAccessor context, UserManager <ApplicationUser> users, GraphQLUserContextAccessor accessor, FarmMasterContext fmDb, IdentityContext idDb, IAuthorizationService auth, IEnumerable <IGraphQLMutationProvider> providers ) : base(context, users, accessor, fmDb, idDb, auth) { foreach (var provider in providers) { provider.AddMutations(this); } }
public RootGraphQLQuery( // Required for RootBase IHttpContextAccessor context, UserManager <ApplicationUser> users, GraphQLUserContextAccessor accessor, FarmMasterContext fmDb, IdentityContext idDb, IAuthorizationService auth, // Extern providers IEnumerable <IGraphQLQueryProvider> providers ) : base(context, users, accessor, fmDb, idDb, auth) { foreach (var provider in providers) { provider.AddQueries(this); } }
public RootBase( IHttpContextAccessor context, UserManager <ApplicationUser> users, GraphQLUserContextAccessor accessor, FarmMasterContext fmDb, IdentityContext idDb, IAuthorizationService auth ) { var user = users.GetUserAsync(context.HttpContext.User).Result; accessor.Context = new DataAccessUserContext(user, context.HttpContext.User, auth); if (user == null) { throw new ExecutionError("You are not logged in"); } this.DataContext = accessor.Context; this.FarmMasterDb = fmDb; this.IdentityDb = idDb; this.UserManager = users; }