Understanding Middleware in Hot Chocolate

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ต.ค. 2024
  • Hi everyone,
    I am Michael, and in this video, I will dive deep into the Hot Chocolate core to see what middleware is and how we can use them to change the execution behavior of the Hot Chocolate GraphQL server.
    You should already be familiar with Hot Chocolate before you dive into this deep dive episode :)
    The example code can be found here:
    github.com/Chi...
    Preview version used in this video:
    www.nuget.org/...
    Please, if you like our project, give us a star on GitHub:
    github.com/Chi...
    Don't forget to comment, like, and subscribe ;)
    Social Media:
    Follow me on GitHub: bit.ly/michael...
    Follow me on Twitter: bit.ly/michael...
    Connect on LinkedIn: bit.ly/michael...
    Web:
    chillicream.com
    #graphql #hotchocolate #dotnet #csharp

ความคิดเห็น • 8

  • @dalibor-rankovic
    @dalibor-rankovic 2 ปีที่แล้ว +3

    Michael, although in general I hate thumbnails with idiotic reactions, I loved yours. Thanks for making me laugh! And.. thanks for building a library that boosted my backend work 80% in everyday life. HotChocolate is honestly another level. You're the man!

  • @andreaskarz
    @andreaskarz 2 ปีที่แล้ว +2

    Now I finally understood the CancelationToken 🤣🤣🤣

  • @wonkyeyedgamer
    @wonkyeyedgamer ปีที่แล้ว +1

    Hi Michael, this video has actually helped me a lot with a specific use case I have, but I have not actually managed to get to the final result. What I am trying to achieve is to get the name of the actual resolving class. I can it see inside the CONTEXT object under the ACTIVATOR property, and buried within is what I need except that it is hidden behind a non-public property (_instances).
    For example ... with the following, I would like to obtain the MYBOOKQUERY
    [ExtendObjectType(OperationTypeNames.Query)]
    public class MyBookQuery
    {
    public async Task GetMyBooks()
    {
    ...
    }
    }

  • @GandalfTheCheap
    @GandalfTheCheap ปีที่แล้ว

    Great video. Informative and clear.
    Using your customising of Timeout middleware example, I tried doing the same thing with your OperationalComplexity middleware (pasted that into my own cs file to customise it, just like you did with Timeout).
    But it's not as easy as shown: I get dozens of "___ is inaccessible due to it's protection level" for all the classes in Hot Chocolate that the middleware is referencing, as they are all marked internal.
    Is that just complexityMiddleware being more complicated, or am I doing something wrong? Any tips on the right way to handle this?
    (Copying and pasting all the referenced code from Hot Chocolate into my own solution is taking ages and adding hundreds of lines...)

  • @doomloop42
    @doomloop42 2 ปีที่แล้ว +1

    Great video! You explain the topic really well. Videos like these help a lot to make HotChocolate more accessible to new developers.

  • @mickdelaney
    @mickdelaney 2 ปีที่แล้ว

    Great content, keep it coming !!! Would love some content on the Visitor pattern in Hotchocolate !!

    • @ChilliCream
      @ChilliCream  2 ปีที่แล้ว

      This is coming soon! At the moment we will try to focus on the type system a bit... type interceptors, descriptor attributes and so on ... but we will also have a look at the AST, visitors and rewriters.