BryanJBryce

BryanJBryce

I just updated to Ash 3.0 here are my versions:

      {:ash, "~> 3.0.0-rc.29"},
      {:ash_postgres, "~> 2.0.0-rc.11"},
      {:ash_phoenix, "~> 2.0.0-rc.7"},
      {:ash_authentication, "~> 4.0.0-rc.6"},
      {:ash_authentication_phoenix, "~> 2.0.0-rc.2"},
      {:ash_graphql, "~> 1.0.0-rc.3"}

I have a Company Resource with attributes of id, name, and domain.

And I’ve set the default accept on actions to :*

 actions do
    default_accept :*
    defaults [:create, :read, :update, :destroy]

And the following GraphQL configuration:

   graphql do
    type :company

    queries do
      list :list_companies, :read, paginate_with: nil
      get :exists, :by_domain
      get :company_by_id, :by_id
    end

    mutations do
    end
  end

By default, list companies works with pagination. When paginate_with: nil the generated schema shows that it should return [Company!]! like you would expect but when I call the query via GraqhQL I get an error that seems like it’s still trying to use pagination somewhere:

[error] 3bd03236-83ff-4ca6-9a20-8e8ffdf15eab: Exception raised while resolving query.

** (KeyError) key :name not found in: %{
count: %Absinthe.Type.Field{
identifier: :count,
name: “count”,
description: “Total count on all pages”,
type: :integer,
deprecation: nil,
args: %{},
config: nil,
triggers: ,
middleware: [{Absinthe.Middleware.MapGet, :count}],
complexity: nil,
default_value: nil,
private: ,
definition: App.GraphqlSchema,
reference: %{
module: AshGraphql.Resource,
location: %{
line: 3296,
file: “/Users/bryan/one-dashboard/app/deps/ash_graphql/lib/resource/resource.ex”
}
}
},
results: %Absinthe.Type.Field{
identifier: :results,
name: “results”,
description: “The records contained in the page”,
type: %Absinthe.Type.List{
of_type: %Absinthe.Type.NonNull{of_type: :company}
},
deprecation: nil,
args: %{},
config: nil,
triggers: ,
middleware: [{Absinthe.Middleware.MapGet, :results}],
complexity: nil,
default_value: nil,
private: ,
definition: App.GraphqlSchema,
reference: %{
module: AshGraphql.Resource,
location: %{
line: 3396,
file: “/Users/bryan/one-dashboard/app/deps/ash_graphql/lib/resource/resource.ex”
}
}
},
start_keyset: %Absinthe.Type.Field{
identifier: :start_keyset,
name: “start_keyset”,
description: “The first keyset in the results”,
type: :string,
deprecation: nil,
args: %{},
config: nil,
triggers: ,
middleware: [{Absinthe.Middleware.MapGet, :start_keyset}],
complexity: nil,
default_value: nil,
private: ,
definition: App.GraphqlSchema,
reference: %{
module: AshGraphql.Resource,
location: %{
line: 3409,
file: “/Users/bryan/one-dashboard/app/deps/ash_graphql/lib/resource/resource.ex”
}
}
},
end_keyset: %Absinthe.Type.Field{
identifier: :end_keyset,
name: “end_keyset”,
description: "The last k

:erlang.map_get(:name, %{count: %Absinthe.Type.Field{identifier: :count, name: "count", description: "Total count on all pages", type: :integer, deprecation: nil, args: %{}, config: nil, triggers: [], middleware: [{Absinthe.Middleware.MapGet, :count}], complexity: nil, default_value: nil, __private__: [], definition: App.GraphqlSchema, __reference__: %{module: AshGraphql.Resource, location: %{line: 3296, file: "/Users/bryan/one-dashboard/app/deps/ash_graphql/lib/resource/resource.ex"}}}, results: %Absinthe.Type.Field{identifier: :results, name: "results", description: "The records contained in the page", type: %Absinthe.Type.List{of_type: %Absinthe.Type.NonNull{of_type: :company}}, deprecation: nil, args: %{}, config: nil, triggers: [], middleware: [{Absinthe.Middleware.MapGet, :results}], complexity: nil, default_value: nil, __private__: [], definition: App.GraphqlSchema, __reference__: %{module: AshGraphql.Resource, location: %{line: 3396, file: "/Users/bryan/one-dashboard/app/deps/ash_graphql/lib/resource/resource.ex"}}}, start_keyset: %Absinthe.Type.Field{identifier: :start_keyset, name: "start_keyset", description: "The first keyset in the results", type: :string, deprecation: nil, args: %{}, config: nil, triggers: [], middleware: [{Absinthe.Middleware.MapGet, :start_keyset}], complexity: nil, default_value: nil, __private__: [], definition: App.GraphqlSchema, __reference__: %{module: AshGraphql.Resource, location: %{line: 3409, file: "/Users/bryan/one-dashboard/app/deps/ash_graphql/lib/resource/resource.ex"}}}, end_keyset: %Absinthe.Type.Field{identifier: :end_keyset, name: "end_keyset", description: "The last keyset in the results", type: :string, deprecation: nil, args: %{}, config: nil, triggers: [], middleware: [{Absinthe.Middleware.MapGet, :end_keyset}], complexity: nil, default_value: nil, __private__: [], definition: App.GraphqlSchema, __reference__: %{module: AshGraphql.Resource, location: %{line: 3417, file: "/Users/bryan/one-dashboard/app/deps/ash_graphql/lib/resource/resource.ex"}}}, __typename: %Absinthe.Type.Field{identifier: :__typename, name: "__typename", description: "The name of the object type currently being queried.", type: :string, deprecation: nil, args: %{}, config: 0, triggers: %{}, middleware: [{{Absinthe.Middleware, :shim}, {:keyset_page_of_company, :__typename, [{:ref, Absinthe.Phase.Schema.Introspection, :typename}]}}], complexity: 0, default_value: nil, __private__: [], definition: Absinthe.Phase.Schema.Introspection, __reference__: %{module: Absinthe.Phase.Schema.Introspection, location: %{line: 74, file: "/Users/bryan/one-dashboard/app/deps/absinthe/lib/absinthe/phase/schema/introspection.ex"}}}})
(absinthe 1.7.6) lib/absinthe/resolution/projector.ex:136: Absinthe.Resolution.Projector.update_schema_node/2
(absinthe 1.7.6) lib/absinthe/resolution/projector.ex:53: Absinthe.Resolution.Projector.do_collect/6
(absinthe 1.7.6) lib/absinthe/resolution/projector.ex:41: Absinthe.Resolution.Projector.collect/3
(absinthe 1.7.6) lib/absinthe/resolution/projector.ex:29: Absinthe.Resolution.Projector.project/5
(absinthe 1.7.6) lib/absinthe/resolution.ex:190: Absinthe.Resolution.project/2
(ash_graphql 1.0.0-rc.3) lib/graphql/resolver.ex:763: AshGraphql.Graphql.Resolver.validate_resolve_opts/6
(ash_graphql 1.0.0-rc.3) lib/graphql/resolver.ex:425: AshGraphql.Graphql.Resolver.resolve/2
(absinthe 1.7.6) lib/absinthe/phase/document/execution/resolution.ex:234: Absinthe.Phase.Document.Execution.Resolution.reduce_resolution/1
(absinthe 1.7.6) lib/absinthe/phase/document/execution/resolution.ex:189: Absinthe.Phase.Document.Execution.Resolution.do_resolve_field/3
(absinthe 1.7.6) lib/absinthe/phase/document/execution/resolution.ex:174: Absinthe.Phase.Document.Execution.Resolution.do_resolve_fields/6
(absinthe 1.7.6) lib/absinthe/phase/document/execution/resolution.ex:145: Absinthe.Phase.Document.Execution.Resolution.resolve_fields/4
(absinthe 1.7.6) lib/absinthe/phase/document/execution/resolution.ex:88: Absinthe.Phase.Document.Execution.Resolution.walk_result/5
(absinthe 1.7.6) lib/absinthe/phase/document/execution/resolution.ex:67: Absinthe.Phase.Document.Execution.Resolution.perform_resolution/3
(absinthe 1.7.6) lib/absinthe/phase/document/execution/resolution.ex:24: Absinthe.Phase.Document.Execution.Resolution.resolve_current/3
(absinthe 1.7.6) lib/absinthe/pipeline.ex:408: Absinthe.Pipeline.run_phase/3
(absinthe_plug 1.5.8) lib/absinthe/plug.ex:536: Absinthe.Plug.run_query/4
(absinthe_plug 1.5.8) lib/absinthe/plug.ex:290: Absinthe.Plug.call/2
(phoenix 1.7.12) lib/phoenix/router/route.ex:42: Phoenix.Router.Route.call/2
(phoenix 1.7.12) lib/phoenix/router.ex:484: Phoenix.Router.__call__/5

Showing Posts 1 to 3

zachdaniel

zachdaniel

Creator of Ash

Can you try the latest release candidate of ash_graphql?

BryanJBryce

BryanJBryce OP

Yep, one sec

BryanJBryce

BryanJBryce OP

Hey, it works!

— All posts loaded —

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews