Coder Social home page Coder Social logo

Comments (2)

stijnopheide avatar stijnopheide commented on July 22, 2024

We are using lacinia selections in a different way and not sure if that is as intended or whether this proposal will have any influence on that.

Our mutation resolvers for updating/creating content are very generic. On these resolvers we use [:com.walmartlabs.lacinia/selection :field-definition :args] and translate each argument into (a part of) a datomic transaction. We decorate our :input-objects with some information about the namespace of the datomic attribute and how relations should be constructed. If an input-object has a field that is not a scalar type, we'll look up the type in the schema and do this conversion recursively.

So, in short: we would need some way of identifying the type of the arguments being passed into the mutation resolver. On the other hand I think we could also do this by passing those types as a parameter of the resolver factory. So if the selection API is not public, we are going to change this before upgrading to 0.17.0.

from lacinia.

hlship avatar hlship commented on July 22, 2024

We don't want to commit to freezing the format of the selection tree. For example, we're thinking about using more namespaced keywords for keys. And, over the course of the last couple of dot releases, we've added a couple of new keys to various schema definitions, and to the selection nodes.

I would say that the right way to do this is using field resolvers, which will have direct access to the arguments.

Again, back this up to your actual requirement: "We need the types of the argument values inside our field resolver." That's something that could be accomplished, either as meta data on the args map, or as an additional key in the supplied context.

from lacinia.

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.