Code Monkey home page Code Monkey logo

Comments (3)

bruce avatar bruce commented on August 25, 2024

@skosch Can you give an example of what the resulting GraphQL result needs to look like? I don't understand based on this issue why you can't provide whatever fields you want (including an edge) in a mutation output type. The edge type for a connection is defined as *_edge, so, eg:

  • connection node_type: :pet will give you an edge type, :pet_edge
  • connection :my_custom_connection, node_type: :pet (supported by master, will be in v0.9.0) will give you :my_custom_connection_edge.

from absinthe_relay.

skosch avatar skosch commented on August 25, 2024

Just using :pet_edge and returning %{node: {new_pet}} works indeed. Thank you 👍

from absinthe_relay.

dotbear avatar dotbear commented on August 25, 2024

hey @skosch, I'm trying to get this to work, but my upsert is returning null. Am I returning the wrong value?

My return from my resolver is

    {:ok, %{node: post}}

my return type is

      output do
        field :post_edge, :post_edge
      end

my response is

{"data":{"upsertPost":{"postEdge":null}}}

my client mutation code is

const mutation = graphql`
  mutation UpsertPostMutation($input: UpsertPostInput!) {
    upsertPost(input: $input) {
      postEdge {
        node {
          id
          ...EditPost_post
        }
      }
    }
  }
`;

EDIT: I realise this is some SERIOUS thread necromancy 😂 My apologies

from absinthe_relay.

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.