Comments (15)
@jbaxleyiii I wrote some of my thoughts here #21
Basically I think the loaders should look like query builders, which will allow us to do the batching and caching automatically, without people having to write their own batching mechanism as they currently have to with DataLoader. Unfortunately I don't see a way to make the REST loaders behave in a similar fashion right now, so their API will most likely be different. We could put additional abstractions on top of that, but then we'd essentially be building an ORM, which I believe is not what we want.
Although... now that I think of it, GraphQL might be exactly the right technology for writing the one ORM to rule them all!!! What I mean by that is that we could build an ORM that supports the intersection of operations provided by ORMs for different DBs, a polyglot ORM so to speak. That would mean that one 'Connector' would be enough for virtually any DB out there. My suspicion is that the set of operations that all of these ORMs let you do would be sufficient for most purposes. If performance optimizations require using database specific technologies later, It would always be possible to write resolve functions that use a custom connector on top of the DB-specific loaders we have. -- Anyway, that's just a side note, I think we don't have to worry about that for now, it's just an idea for later.
from graphql-tools.
@helfer Yes, I was misunderstanding. I'm conflating a resource shift away from apollo server tools with apollo client tools. Thanks for clearing that up!
from graphql-tools.
Yeah, just saying it could be reopened as an issue called "add schema/resolver composition", rather than "Features" with a giant checklist at the top.
from graphql-tools.
Ideally, it should be possible to replace this file:
// schema.js
import {
GraphQLObjectType,
GraphQLSchema,
GraphQLInt,
GraphQLString,
GraphQLList,
} from "graphql"
import ImageType from "./image"
import ColorType from "./color"
const ContentType = new GraphQLObjectType({
name: "Content",
fields: () => ({
body: {
type: GraphQLString,
resolve: content => content.body
},
description: {
type: GraphQLString,
resolve: like => like.description
},
scripture: {
type: GraphQLString,
resolve: content => content.scripture
},
ooyalaId: {
type: GraphQLString,
resolve: content => content.ooyalaId
},
images: {
type: new GraphQLList(ImageType),
resolve: content => content.images
},
tags: {
type: new GraphQLList(GraphQLString),
resolve: content => content.tags
},
colors: {
type: new GraphQLList(ColorType),
resolve: content => content.colors
},
speakers: {
type: GraphQLString,
resolve: content => content.speakers
}
})
})
export default ContentType
With this:
#js import Image from './image'
#js import Color from './color'
type Content {
body: String
description: String
scripture: String
ooyalaId: String
images: [Image]
tags: [String]
colors: [Color]
speakers: String
}
I feel like that would really make things feel nice.
from graphql-tools.
@helfer do you have a rough api design you would like to see for the loaders? If so, I can start working on mongo, mysql, and mssql loaders 👍
from graphql-tools.
Updated the first comment to show that the only thing currently missing is type composition.
from graphql-tools.
@helfer I love the idea around the ORM, I also think GraphQL is the perfect abstract layer to implement a powerful way to combine databases together but this is not the purpose of this topic. I write this message to have more information about the type / resolver function composition. Did you make some progress to adding this feature in the next release?
from graphql-tools.
@Aurelsicoko we've temporarily shifted focus away from graphql-tools, so I won't be working on it in the forseeable future. I still think it could be a cool project though, and I'd be happy to give feedback and help with a PR that implements better composition for types and resolvers.
from graphql-tools.
we've temporarily shifted focus away from graphql-tools
Who is we in "we've"?
from graphql-tools.
"We" as in "we the Apollo team".
from graphql-tools.
@helfer ok, that's what I was inferring, and wanted to be sure. So... I'm embarking on a new project that is using GraphQL, and I've been perusing Apollo Stack, but when I see statements like this, I get nervous. So, is there a write-up yet about where the focus is being shifted? Are you simply recommending Relay at this point?
from graphql-tools.
@jpdesigndev There's no need to be worried. In fact, the opposite is true. We're shifting focus away from graphql-tools to spend more time on Apollo Client, our alternative to Relay.
Shifting focus away from graphql-tools is an Apollo-internal rebalancing of efforts to make sure we spend our time where it makes a difference. Overall, we are investing significantly more resources into Apollo than before, not less.
from graphql-tools.
This issue doesn't seem valuable anymore IMO. Maybe we should close it?
from graphql-tools.
I looked at it yesterday and decided we should keep it open a bit longer, because I still think it would be nice if we had some sort of schema/resolver composition in graphql-tools. However, if nothing happens within the next 30 days, I think we'll close it.
from graphql-tools.
from graphql-tools.
Related Issues (20)
- Project Roadmap HOT 2
- Drop dependency on fast-url-parser HOT 2
- DEBUG=1 results in console.time() warnings
- @graphql-tools/mock does not work with Vitest HOT 5
- Deterministic (seeded) enum values
- Stitching: object field is null when all selections are delegated
- Http Executor encodes headers into query parameters which can leak Authorization headers
- Ability to get names of all the stitched queries in a middleware
- requireResolversToMatchSchema: 'warn' throws an error
- Support .astro file loading on graphql-tag-pluck HOT 1
- Troubles with connectionParams on subscriptions
- Adding content-type header is not supported when fetching schema
- Query does not provide a operation name as a property in the request body causing some server configurations to reject the request
- @graphql-tools/mock 9.0.1 causes panic: Internal errors HOT 2
- @graphql-tools/merge directive arguments compare should not require identical ordering HOT 1
- load babel options in `graphql-tag-pluck`
- [mock] relayStylePaginationMock sometimes returns an incorrect value for hasNextPage
- Batch execution throws an error when Array.prototype has additional property
- Federation @join__field requires parameter handling improvement
- filterSchema argumentFilter provides incorrect typeName
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-tools.