Giter Site home page Giter Site logo

Comments (9)

sorenbs avatar sorenbs commented on May 1, 2024 2

This is happening :-) Thanks for the great suggestion! https://github.com/graphcool/framework/issues/353

from prisma1.

ThisIsMissEm avatar ThisIsMissEm commented on May 1, 2024 1

👍 to being able to select which mutations and queries are exposed. This would be a great feature

from prisma1.

ThisIsMissEm avatar ThisIsMissEm commented on May 1, 2024

This is inspired by this example in the GraphQL Documentation:
queries_and_mutations___graphql

from prisma1.

schickling avatar schickling commented on May 1, 2024

Would be using the Relay API an option for you as well?

from prisma1.

ThisIsMissEm avatar ThisIsMissEm commented on May 1, 2024

Maybe, but it greatly complicates things. I'd say using Input Types is a general great practice that should be encouraged.

from prisma1.

schickling avatar schickling commented on May 1, 2024

There are a couple of alternatives from the top of my head:

  1. Embed the input type into existing mutations. The upside would be that you could choose between providing a "combined object" matching input type vs spreading out all fields directly. The big downside of this approach is that all arguments would need to be optional (non-required). That means we'd lose a lot of the type system's power along the way.

  2. An alternative approach would be to generate additional mutations like createPostWrapped(post: { ... }. The upside of this would be that it preserves the expressiveness of the typesystem. But obviously this approach would clutter the query namespace quite a lot. (This could be solve though by selectively configuring which queries should be exposed in the schema at all).

  3. A third approach would be to make it a configuration option on a project basis which "layout" of mutations you'd prefer. This could however confuse people quite a bit.

Would be interested to hear what your thoughts are on this and especially if you'd see any other viable options?

from prisma1.

ThisIsMissEm avatar ThisIsMissEm commented on May 1, 2024

I'd say a configuration option, perhaps per model, would be best.

from prisma1.

ThisIsMissEm avatar ThisIsMissEm commented on May 1, 2024

But also, new projects should be created in the input type mode, and allow you to switch if you want.

from prisma1.

marktani avatar marktani commented on May 1, 2024

We're looking to enhance the Simple API with an object input argument as described in this feature request. This would be a great opportunity to work on other feature requests that require an input object, like #45.

from prisma1.

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.