Comments (1)
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)
- Jun2018 clarify: Improve the Input Object input coercion subsection with more examples (#388) HOT 1
- Jun2018 clarify: Generalize validation of value literals, changing the names of validation rules but not changing the validity of documents (#389) HOT 1
- Jun2018 clarify: Fix ExecuteSelectionSet algorithm where fieldType may not be defined, but will never be null (#433) HOT 1
- Jun2018 clarify: Make it clear that field result coercion should throw errors before data loss (#434) HOT 2
- Jun2018 clarify: Clarify list coercion rules, especially with respect to null values, including examples (#436, #440) HOT 1
- Move this project to Erlang 21.x
- Jun2018 Spec: Null value support (2.9.5) HOT 2
- Jun2018 spec: Handle type extensions HOT 1
- Jun 2018 spec: Handle the new Schema definition HOT 5
- Replace scalar `input/2` and `output/2` with a `scalar/3` function HOT 2
- Add support for a @deprecated directive
- Errornous handling of nulls in inlined field arguments HOT 2
- Translate GraphQL qureries to SQL HOT 2
- Questions about graphql:sync/3 HOT 1
- Handle application failure of graphql:map/2
- bug in graphql:type_check_params/3? HOT 2
- GraphQL with Yaws HOT 1
- Failing Hex package compilation HOT 6
- GraphQL parsing fails on 'subscription' field
- Introspection produces `Bool` instead of `Boolean`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-erlang.