Comments (9)
Hmm, i wasn't actually aware that you would need to return fields other than those requested.
But in any case i have been considering whether we should remove attribute filtering at all or just fetch them all (since it continues to cause small subtle bugs).
from graphql-sequelize.
Yeah I may have misdiagnosed this. Taking a look now
On Tue, Oct 20, 2015 at 9:18 AM Mick Hansen [email protected]
wrote:
Hmm, i wasn't actually aware that you would need to return fields other
than those requested.
But in any case i have been considering whether we should remove attribute
filtering at all or just fetch them all (since it continues to cause small
subtle bugs).—
Reply to this email directly or view it on GitHub
#45 (comment)
.
from graphql-sequelize.
Okay the real problem is that the map
option is only on attributeFields
, not on the resolver
. So anything you map doesn't actually get resolved unless you manually specify a resolver.
I think we should either get rid of the map
option, or somehow make resolver
aware of mapped fields. The problem is, I don't see a good way to get that map
object shared between the two without having to specify it in both places, which is not great.
from graphql-sequelize.
Gah.. my brain wasn't working properly.. This is very simple.. just need to add a resolver in attributeFields
. I'll work on a pull request now.
from graphql-sequelize.
Ah yeah, mapped attributes will need a resolver or a virtual field (but with a virtual we don't really need map).
from graphql-sequelize.
See this branch for the problem (with failing test): master...idris:mapped-fields
Even after adding a resolver to the field, the field is never included in findOptions.attributes
, so it never gets queried for. I can't think of a way to get the actual field name in resolver.js
so we can automatically include mapped fields.
If we can't think of a solution for this, I think we should just get rid of the map
functionality altogether, to avoid confusion. It's easy enough to do it manually.
from graphql-sequelize.
Or we disable findOptions.attributes filtering, it keeps giving me headaches.
from graphql-sequelize.
I think you at least want the attributes filtering in case there are large fields, like binary or JSONB fields that the user is never going to use.
map
could also cause confusion and problems in the future. For example, if you try to map an associated field.
from graphql-sequelize.
Alright since you requested the feature initially i'll kill it for now.
from graphql-sequelize.
Related Issues (20)
- Combining multiple associations HOT 5
- Problem integrating connection types and dataloader for paginated (cursor) queries HOT 1
- When using `JSONType` I get `Error: One of the provided types for building the Schema is missing a name.` HOT 2
- Can we use `attributeFields` with graphql SDL? HOT 2
- How to express two way relationship HOT 2
- Change the default name of Date scalar HOT 3
- Relay Connections with Dataloader HOT 4
- Is this working with GraphQL 15? HOT 2
- sequelize model comment => graphql field description HOT 4
- CITEXT throws an issue in the latest version HOT 7
- Unable to convert geometry to graphql type HOT 1
- Are filtering operators supported? HOT 2
- OrderBy can conflicts with Attributes HOT 1
- Passing `where:` in-place, without query variable HOT 2
- Fix order type in defaultListArgs HOT 6
- Compatibility with GraphQL v17 HOT 1
- Peer dependency support for graphql 16 HOT 2
- OrderBy doesn't pass multiple to the query HOT 1
- Changing relay edges to be nonNull causes a node error HOT 3
- Use graphql-sequelize with dataloader-sequelize HOT 2
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-sequelize.