Giter VIP home page Giter VIP logo

Comments (3)

spawnia avatar spawnia commented on June 24, 2024

Lighthouse works as expected here, I added a test just to be sure: 2ecc00c.

Consider https://spec.graphql.org/draft/#sec-Handling-Field-Errors. GraphQL repsonses will always conform to what is promised in the schema. If a non-nullable field at any level of the query tree has an error, that entire level is invalidated and the error bubbles up to the next level. If you you already on the top level, you will get no data at all.

from lighthouse.

MarcEspiard avatar MarcEspiard commented on June 24, 2024

Hey @spawnia, thanks for the clarification, I wasn't aware of that distinction, pretty new to GraphQL.

Quick question, changing the return types to nullable did indeed work on mutations but not for my queries example, is there a reason for that, other than nullable return types ?

from lighthouse.

mowses avatar mowses commented on June 24, 2024

Sorry for commenting in a closed issue.

Using lighthouse v6, I would like to opt to make my mutations to stop if one of them fails. Is it possible to achieve such thing?

For example, this is an pseudo request a client is making:

mutation update_and_insert {
   updateRow {...}
   insertRow {...}
}

Both of these mutations are decorated with @field (resolver: "path/to/mutation@method")
The updateRow is prone to throw exceptions due to many factors. When it happen, I would like to prevent insertRow to insert new row in database.
Does anybody knows if it's possible to run both of mutations inside a "transaction block" without creating a third mutation just to wrap updateRow and insertRow?

from lighthouse.

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.