Giter VIP home page Giter VIP logo

Comments (2)

leebyron avatar leebyron commented on May 5, 2024 1

The answers to this are going to vary widely and depend a lot more on your storage model than your API design. Typically dataloaders correspond to individual "types" of information in storage - that's usually a table in SQL style storage. For most apps, a type in storage corresponds to a type in GraphQL, so I would expect to see a data loader for "Post" and a data loader for "Comment" unless storage was organized in a different way.

It's common to see a collection of loaders passed as part of the "context" variable in GraphQL so they're always available and unique per request.

You can read more about these patterns on the README for this repo on "Using with GraphQL" and "Common Patterns" https://github.com/facebook/dataloader#using-with-graphql

from dataloader.

hems avatar hems commented on May 5, 2024 1

I believe one of the great features of GraphQL is to know exactly which fields to fetch, so would be interest to have a standard way of fetching only the needed information from the database and not the whole document once the user is requesting only a few fields, i believe that is the motivation behind @shakaIsReal issue, am i right @shakaIsReal ?

i'm also trying to figure out a lean way of fetching the smallest amount of data from the database

from dataloader.

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.