GithubHelp home page GithubHelp logo

Features about graphql-tools HOT 15 CLOSED

ardatan avatar ardatan commented on April 30, 2024 6
Features

from graphql-tools.

Comments (15)

helfer avatar helfer commented on April 30, 2024 1

@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.

paynecodes avatar paynecodes commented on April 30, 2024 1

@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.

stubailo avatar stubailo commented on April 30, 2024 1

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.

stubailo avatar stubailo commented on April 30, 2024

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.

jbaxleyiii avatar jbaxleyiii commented on April 30, 2024

@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.

helfer avatar helfer commented on April 30, 2024

Updated the first comment to show that the only thing currently missing is type composition.

from graphql-tools.

Aurelsicoko avatar Aurelsicoko commented on April 30, 2024

@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.

helfer avatar helfer commented on April 30, 2024

@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.

paynecodes avatar paynecodes commented on April 30, 2024

@helfer

we've temporarily shifted focus away from graphql-tools

Who is we in "we've"?

from graphql-tools.

helfer avatar helfer commented on April 30, 2024

"We" as in "we the Apollo team".

from graphql-tools.

paynecodes avatar paynecodes commented on April 30, 2024

@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.

helfer avatar helfer commented on April 30, 2024

@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.

stubailo avatar stubailo commented on April 30, 2024

This issue doesn't seem valuable anymore IMO. Maybe we should close it?

from graphql-tools.

helfer avatar helfer commented on April 30, 2024

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.

helfer avatar helfer commented on April 30, 2024

#116

from graphql-tools.

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.