Giter VIP home page Giter VIP logo

Comments (4)

benmccallum avatar benmccallum commented on May 18, 2024 1

Thanks mate, will close.

from dapper.graphql.

dougrday avatar dougrday commented on May 18, 2024

Yep, it avoids the n+1 problem by growing query results horizontally rather than vertically. There's a point where this payoff starts to fade, but for most use cases you'll see a big performance increase.

I haven't used graphql-net's authorization toolset, but based on what I'm seeing browsing through their code, it shouldn't interfere with this library. Essentially, you build _QueryBuilder_s that are used by a single QueryBuilder that's rooted at the top of your schema. Each type resolves the same way it always has, this library just gets really critical about what information it retrieves on each object (preferably getting all data in one or two queries) before resolving.

from dapper.graphql.

benmccallum avatar benmccallum commented on May 18, 2024

I see what you mean, I did even more looking into it yesterday and my understanding is that if you do the following:

Field<ListGraphType<EmailType>>(
    "emails",
    description: "A list of email addresses for the person.",
    resolve: context => context.Source.Emails
);

you're resolver function is just grabbing the value off the already constructed/populated entity, which you're saying is populated by executing the root-level query builder's generated SQL and the subsequent entity mapper.

Does that sound right? If so, then I guess the Authorization library should still play nice as it will intercept the resolver function call (e.g. context => context.Source.Emails), apply the Authorization logic and approve/deny that field resolution.

Thanks, I think this is exactly what I need. GraphQL is great in principle, but without a really sensible layer to map the query to the data storage system easily, effectively and optimally it's very easy to run into trouble I can imagine.

from dapper.graphql.

dougrday avatar dougrday commented on May 18, 2024

@benmccallum Yes, that sounds right.

from dapper.graphql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.