Code Monkey home page Code Monkey logo

Comments (1)

jlouis avatar jlouis commented on August 23, 2024

You have a number of options in the current state of the system:

Option 1: when resolving books(genre: ..) you load every row and every possible column on that row. When resolving the Book itself, you grab inside the fully loaded object. This is actually not as insane as it sounds: you'll need the full row anyway for a cache.

Option 2: resolve the IDs of books on the books(genre: ...) field, then issue a fetch on the fields which are not satisfiable in a cache.

Option 3: Don't return a JSON structure. Return data which can be used to perform an SQL query and then perform it later on. The idea is that GraphQL is but the first stage of a resolution which dynamically forms the SQL query needed. Then you send the query through something such as sqerl to form the actual query and execute it. Note that this is going to be destroying your database as you expose the world to queries.

Once we have proper concurrent field resolution in, we can start using a data loader pattern for this, which is probably going to be better from a cache-perspective, but that is in the future.

The TL;DR is: Not a GraphQL problem. The current lack of concurrent execution in the engine may hamper a bit, though.

from graphql-erlang.

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.