Adding dynamic types to your GraphQL schema with Hot Chocolate.

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 พ.ย. 2022
  • Hi everyone,
    we often get a questions how to deal with dynamic data structures that are inferred from JSON files or databases. In this episode I will walk you through type modules, which allow you to infer schema types dynamically and hot reload your schema whenever they change.
    Don't forget to comment, like, and subscribe ;)
    Please, if you like our project, give us a star on GitHub:
    github.com/ChilliCream/hotcho...
    github.com/ChilliCream/hotcho...
    Hot Chocolate version used in this video: www.nuget.org/packages/HotCho...
    Workshops:
    NDC Minnesota 2022 - bit.ly/ndc-minnesota
    NDC London 2023 - bit.ly/ndc-london-graphql
    NDC Oslo 2023 - ndcoslo.com/workshops/buildin...
    Social Media:
    Follow me on GitHub: bit.ly/michaelGitHub
    Follow me on Twitter: bit.ly/michaelTwitter
    Connect on LinkedIn: bit.ly/michaelLinkedIn
    Web:
    chillicream.com
    #dotnet #graphql #dynamic #hotchocolate
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @mickdelaney
    @mickdelaney ปีที่แล้ว +3

    just thinking that this sort of schema extension would be interesting in a multi tenant scenario. but not sure how that would work on the schema end of things. great work though !!!

  • @piotrkurowski6509
    @piotrkurowski6509 9 หลายเดือนก่อน +4

    Very nice, but how can I create a dynamic query instead of a dynamic type? is it possible?

  • @normanaranez323
    @normanaranez323 ปีที่แล้ว +10

    How to implement multiple tenants/database using hotchocolate?

    • @nowzarifarhad
      @nowzarifarhad 2 หลายเดือนก่อน

      but this not really relevant to HotChocolate is it? for having multiple databases, you may need to load different connection strings per request based on the request headers perhaps from your secret store.

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

    Nice and powerful but I really don't find a usecase where I will use it. In your exemple I will type the content to something else than a string anyway use jsonb and EF core.

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

    Can you provide documentation on how we can implement the strawberry shake on MAUI. currently no documentation on how to implement it

  • @anandlshinde
    @anandlshinde 9 หลายเดือนก่อน

    Nice and powerful. I have the same use case. Can you help me here with how to implement the same Java Spring Boot implementation? any references pls share here it will be helpful for me.

  • @GBG731
    @GBG731 5 หลายเดือนก่อน

    How to get all fields in json string without specifying the field names in a query?

  • @nowzarifarhad
    @nowzarifarhad 2 หลายเดือนก่อน

    I assume that this is also possible on initiating the service, right? I mean without triggering by the event. I need to build the whole schema dynamically

    • @nowzarifarhad
      @nowzarifarhad 2 หลายเดือนก่อน

      I think it is this one? th-cam.com/video/EjON8pU-CVs/w-d-xo.html

    • @ChilliCream
      @ChilliCream  2 หลายเดือนก่อน +1

      Yes ... the event is just of you have changes and you want a rebuild.

    • @nowzarifarhad
      @nowzarifarhad 2 หลายเดือนก่อน

      @@ChilliCream Thank you for your answer, helped a lot. I'm building the whole mutation with the type modules now dynamically. One thing which I came across, I think with this approach, performing authorization and error handling for example for mutations, is on us. Right?

    • @nowzarifarhad
      @nowzarifarhad 2 หลายเดือนก่อน

      This worked beautifully, only one point. To build the mutations, I registered the root mutation type and added the dynamic mutation fields with ObjectTypeExtension.CreateUnsafe. Good work on the library

  • @AAAdov
    @AAAdov 8 หลายเดือนก่อน +1

    On 13 version is not working. Failed with Type 'System.String' does not have a default constructor Arg_ParamName_Name
    Update: this example is not working for EF. The exception on expression compilation stage... It looks very strange, why give fake examples that don't work in real life...