Questions tagged [absinthe]

For issues relating to the Absinthe GraphQL implementation for Elixir.

Absinthe is an implementation for going far beyond GraphQL specification basics.

83 questions
0
votes
1 answer

Elixir Absinthe Instrumentation

I'm looking to instrument my absinthe/phoenix server. I would like to find out how long it takes to encode data as json using Jason. My endpoint.ex file looks like following: defmodule AssessmentApi.Web.Endpoint do use Phoenix.Endpoint, otp_app:…
GTDev
  • 5,488
  • 9
  • 49
  • 84
0
votes
1 answer

Elixir Absinthe Relay using non_null on connection node_type

Any idea why I would get this error on: connection(node_type: non_null(:thing), non_null: true) == Compilation error in file lib/app/things/types.ex == ** (Protocol.UndefinedError) protocol String.Chars not implemented for {:non_null, [line: 7],…
atomkirk
  • 3,701
  • 27
  • 30
0
votes
1 answer

Batch loading a field in absinthe with dataloader

I have an object in my Absinthe graphql schema that looks like this: object :match do field(:id, non_null(:id)) field(:opponent, non_null(:string)) @desc "The number of votes that have been cast so far." field(:vote_count,…
harryg
  • 23,311
  • 45
  • 125
  • 198
0
votes
1 answer

How do I use Phoenix forms to populate a custom type in an Absinthe @graphql mutation attribute in a controller?

I have finished reading Craft GraphQL APIs in Elixir with Absinthe (Pragprog) and I am trying to expand upon the item_controller.ex to allow for “menu item” editing. I have made these functions in the controller: @graphql """ query ($id: ID!) { …
Peaceful James
  • 1,807
  • 1
  • 7
  • 16
0
votes
1 answer

Absinthe dataloader: no function clause matching in anonymous fn/3 in Absinthe.Resolution.Helpers.dataloader/2

The integration between Absinthe and Dataloader is quite new for me, so any help is welcome. I'm running into the following error: ** (FunctionClauseError) no function clause matching in anonymous fn/3 in Absinthe.Resolution.Helpers.dataloader/2 My…
Kevin Etore
  • 1,046
  • 3
  • 14
  • 32
0
votes
1 answer

Graphiql (GraphQL UI) not loading in Chrome but works in Firefox and Safari

I'm not sure what changed in Chrome but the Graphiql GUI tool is not loading. In Firefox and Safari it works just fine. I have disabled all Chrome extensions, restarted Chrome, and restarted my Mac. The error persists. How do I debug this? In…
Loading...
  • 863
  • 9
  • 21
0
votes
1 answer

Why my Absinthe GraphQL Subscription doesn't work?

My Schema: subscription do @desc "Subscribe to drawing change" field :drawing_change, :drawing do # arg(:drawing_id, non_null(:id)) config(fn _args, _resolution -> {:ok, topic: "*"} end) end end When I…
Mr H
  • 5,254
  • 3
  • 38
  • 43
0
votes
1 answer

Elixir + Absinthe + Ecto + Dataloader – filter by multiple fields

Using Elixir/Absinthe/Ecto/Dataloader, how do you query/filter a source by multiple fields? Example: Let's say you would want to filter a schema (and dataloader source) named User by two fields, one named is_admin (only true values) and one group_id…
gunnar2k
  • 185
  • 1
  • 13
0
votes
1 answer

Why am I getting a CompileError related to the schema.ex of the Absinthe tutorial?

I was doing the Absinthe tutorial for Elixir using the howtographql.com website. At some point (https://www.howtographql.com/graphql-elixir/2-queries/), when running the last step of running the graphql server, I get an error. Command executed: $…
fer
  • 1
  • 2
0
votes
2 answers

Passing information from resolver to post-resolution middleware

Im trying to pass from information from my resolver function to my middleware such that I can set a cookie in the response. The use-case is I want to generate an Oauth2 authorization link which allows the client to begin an Oauth2 flow with a third…
0
votes
1 answer

Creating a GraphQL field without a resolver

I'm using Elixir with Phoenix and Absinthe to set up a GraphQL backend. Ideally, I'd like to have a structure that looks like this: { posts { published { title } draft { title } } } To do so, I thought I would need…
Kieran E
  • 3,616
  • 2
  • 18
  • 41
0
votes
1 answer

Ecto looks for field_id instead of field

I am trying to setup a Phoenix API with GraphQL. I have a Team table and a Game Table in my DB like this: schema "teams" do field :name, :string has_many :games, LvdnApi.Fixtures.Game timestamps() end schema "games" do …
Uj Corb
  • 1,959
  • 4
  • 29
  • 56
0
votes
1 answer

Sending a graphql response from Guardian error handler when using Absinthe

I have a Phoenix app with Absinthe for a Graphql API. Guardian is used to authenticate requests that provide a Bearer token in the header. This is all working great until an invalid token is provided. I have specified an error handler in my Guardian…
harryg
  • 23,311
  • 45
  • 125
  • 198
0
votes
1 answer

GraphQL API Parameters issue - Elixir

I have a requirement to post comments in an application. This was implemented and is working fine. Now, I got an additional requirement to upload a photo along with the comment. So, I implemented the camera feature in the app and I am sending the…
Tessy Thomas
  • 1,475
  • 12
  • 19
0
votes
2 answers

Graphql Query testing doesn't return correctly the result in Phoenix

Hello everyone I'm just new to Elixir, generally new to FP. So basically I try to learn Elixir and afterwards jump to building a graphql api server. I read and follow the book "Craft GraphQL APIs in Elixir with Absinthe" and stuck at the testing…
Ricardo Raz
  • 493
  • 1
  • 10
  • 23