Comments (13)
Interesting, do you think any other types could be "summed"?
from graphql-js.
I suppose Object types could? Although that doesn't seem as useful?
from graphql-js.
PostType + CommentType
seems like it should be DocumentInterface
from graphql-js.
This is pretty interesting, and definitely something worth pursuing in future versions of the spec.
Currently, when we run into a case like this, we just define a new interface that's the manually summed interface, and use that as well.
from graphql-js.
@rmosolgo - Interfaces are the only types that could be summable. Summing two unions doesn't really make sense: it doesn't lend to any change in query expressiveness and you could just define a new union if more types are possible. Summing two object types also doesn't make sense as object types are concrete (like classes in OO land).
from graphql-js.
i'm with ya, that's what i was angling for, making one type "summable" doesn't seem like a great fit when interfaces already exist for exactly (er, almost) that purpose
from graphql-js.
@leebyron Would it be useful if I tried to do it for the JS implementation, or would you rather have the spec first?
from graphql-js.
I think this is something we need to discuss at the spec level first. We will probably punt on it for the first version of the spec, but I want to leave room for discussion
from graphql-js.
Shall I open the same issue on the spec repo then?
from graphql-js.
Sure
from graphql-js.
It would also help if you include some concrete (non contrived) use cases you're trying to support to help work through useful discussion
from graphql-js.
@leebyron added to to graphql/graphql-spec#48.
from graphql-js.
Closing here in favor of graphql/graphql-spec#48.
from graphql-js.
Related Issues (20)
- https://github.com/graphql/graphql-spec/pull/793#issue-742412159
- Support Nodejs 20 LTS HOT 1
- Hi @Cito, I'm @github-actions bot happy to help you with this PR 👋
- https://github.com/graphql/graphql-js/issues/4047#issue-2228685707
- Hey really.org
- Hey
- Global HOT 1
- Depending on the scale a few more fields could result in a lot more function calls in the resolvers. That coupled with Node.js / JS single threaded nature might be problematic.
- IHeyReally
- IHeyReally.org
- IHeyReally.org
- Suggestion: Bundling in v17, ESM, CJS, and the dual package hazard HOT 9
- Just to give my 2c, I'm not sure if `exports.development` and `exports.production` target conditionsa are widely supported, so some `import.env` shenanigans may still be necessary until that's widely adopted. HOT 1
- Collection of libraries and how they import from `graphql` HOT 20
- `process.env`, `globalThis`, and `typeof process` HOT 21
- Introspection queries don't support `@oneOf` HOT 2
- Tutorial data HOT 2
- astFromValue fails with a custom scalar serializing to an object value HOT 5
- In a response to a query about an Issue, the URL and other info is missing for links created with Reference editor button HOT 5
- author/committer -> user fields returning NULL for commits committed by user
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-js.