Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RenameSession Error #89

Closed
jason8448 opened this issue Jan 2, 2022 · 1 comment
Closed

RenameSession Error #89

jason8448 opened this issue Jan 2, 2022 · 1 comment

Comments

@jason8448
Copy link

jason8448 commented Jan 2, 2022

Hi! I want to try the get started found here: https://chillicream.com/docs/strawberryshake/get-started and the following project is generated. I found that the RenameSession is not work correctly after click the Save button. The problem occurred in the graphql server .

The error msg as follows:
https://files.slack.com/files-pri/TD98NH6TS-F02RX8AQ5FZ/image.png
https://files.slack.com/files-pri/TD98NH6TS-F02RVR6BTEK/image.png

And the function should be modified as follows:

[UseApplicationDbContext]
    public async Task<RenameSessionPayload> RenameSessionAsync(
        RenameSessionInput input,
        [ScopedService] ApplicationDbContext context,
        [Service]ITopicEventSender eventSender)
    {
        var session = await context.Sessions.FindAsync( int.Parse( input.SessionId));

        if (session is null)
        {
            return new RenameSessionPayload(
                new UserError("Session not found.", "SESSION_NOT_FOUND"));
        }

        session.Title = input.Title;

        await context.SaveChangesAsync();

        await eventSender.SendAsync(
            nameof(SessionSubscriptions.OnSessionScheduledAsync),
            session.Id);

        return new RenameSessionPayload(session);
    }
@glen-84
Copy link
Collaborator

glen-84 commented Aug 30, 2024

I'm closing this issue as outdated, as we have an updated workshop on the main branch, for Hot Chocolate 14.

@glen-84 glen-84 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants