Code Monkey home page Code Monkey logo

Comments (2)

gbxl avatar gbxl commented on August 10, 2024

Experiencing the same behavior with a plain resolver.

  object :shelf do
    field :id, :id
    field :name, :string
    field :products, list_of(:product), resolve: dataloader(Product) // Also tried with "Project" in place of "Product", same result
  end

Where the Shelf object is associated to products like so:

defmodule Shelf do
    belongs_to(:position_taxon, Taxon)
    has_many(:classifications, through: [:position_taxon, :classifications])
    has_many(:products, through: [:classifications, :product])

I get

[error] #PID<0.1860.0> running MasterProxy.Plug (cowboy_protocol) terminated
Server: localhost:4000 (http)
Request: POST /api/platform/merchandising/
** (exit) an exception was raised:
    ** (CaseClauseError) no case clause matching: %Ecto.Association.HasThrough{cardinality: :many, field: :classifications, on_cast: nil, owner: Shelf, owner_key: :position_taxon_id, relationship: :child, through: [:position_taxon, :classifications], unique: true}
        (dataloader) lib/dataloader/ecto.ex:327: Dataloader.Source.Dataloader.Ecto.chase_down_queryable/2
        (dataloader) lib/dataloader/ecto.ex:337: Dataloader.Source.Dataloader.Ecto.get_keys/2
        (dataloader) lib/dataloader/ecto.ex:247: Dataloader.Source.Dataloader.Ecto.fetch/3
        (dataloader) lib/dataloader/ecto.ex:287: Dataloader.Source.Dataloader.Ecto.load/3
        (elixir) lib/enum.ex:1925: Enum."-reduce/3-lists^foldl/2-0-"/3
        (dataloader) lib/dataloader.ex:123: Dataloader.load_many/4
        (absinthe) lib/absinthe/resolution/helpers.ex:255: Absinthe.Resolution.Helpers.do_dataloader/6
        (absinthe) lib/absinthe/resolution.ex:209: Absinthe.Resolution.call/2
        (absinthe) lib/absinthe/phase/document/execution/resolution.ex:209: Absinthe.Phase.Document.Execution.Resolution.reduce_resolution/1
        (absinthe) lib/absinthe/phase/document/execution/resolution.ex:168: Absinthe.Phase.Document.Execution.Resolution.do_resolve_field/4
        (absinthe) lib/absinthe/phase/document/execution/resolution.ex:153: Absinthe.Phase.Document.Execution.Resolution.do_resolve_fields/6
        (absinthe) lib/absinthe/phase/document/execution/resolution.ex:72: Absinthe.Phase.Document.Execution.Resolution.walk_result/5
        (absinthe) lib/absinthe/phase/document/execution/resolution.ex:257: Absinthe.Phase.Document.Execution.Resolution.build_result/4
        (absinthe) lib/absinthe/phase/document/execution/resolution.ex:153: Absinthe.Phase.Document.Execution.Resolution.do_resolve_fields/6
        (absinthe) lib/absinthe/phase/document/execution/resolution.ex:72: Absinthe.Phase.Document.Execution.Resolution.walk_result/5
        (absinthe) lib/absinthe/phase/document/execution/resolution.ex:98: Absinthe.Phase.Document.Execution.Resolution.walk_results/6
        (absinthe) lib/absinthe/phase/document/execution/resolution.ex:87: Absinthe.Phase.Document.Execution.Resolution.walk_result/5
        (absinthe) lib/absinthe/phase/document/execution/resolution.ex:257: Absinthe.Phase.Document.Execution.Resolution.build_result/4
        (absinthe) lib/absinthe/phase/document/execution/resolution.ex:98: Absinthe.Phase.Document.Execution.Resolution.walk_results/6
        (absinthe) lib/absinthe/phase/document/execution/resolution.ex:77: Absinthe.Phase.Document.Execution.Resolution.walk_result/5

from dataloader.

benwilson512 avatar benwilson512 commented on August 10, 2024

Fixed by #65

from dataloader.

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.