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
16
votes
1 answer

How can I use timestamps in Absinthe? (Phoenix 1.3)

I have a problem with phoenix 1.3 + absinthe. I try this code: schema "urls" do field :path, :string timestamps() end object :url do field :id, :id field :path, :string field :inserted_at, :datetime end It work with id and path but it…
JAlberto
  • 155
  • 1
  • 12
5
votes
1 answer

How can I get Absinthe and Dataloader to work together?

I have a GraphQL API that works just fine using conventional resolve functions. My goal is to eliminate the N+1 problem. To do so I've decided to use the Dataloader. I've done these steps to supposedly make the app run: I added these two functions…
bart-kosmala
  • 931
  • 1
  • 11
  • 20
5
votes
0 answers

Authorization graphql subscriptions with elixir and absinthe using cookies

I'm trying make authorization/authentication graphql subscriptions with elixir and absinthe using cookies and I used the follow link: https://nts.strzibny.name/graphql-subscriptions-with-elixir-and-absinth/ I'm trying authenticate the user for…
5
votes
2 answers

How to accept JSON in Absinthe GraphQL requests

I'm attempting to receive a string of JSON in my graphql implementation but keep getting errors with the custom scalar I've defined to handle the JSON. I've defined a custom scalar to properly serialize the JSON to an elixir map. I'm getting errors…
Piranha
  • 53
  • 4
5
votes
1 answer

Elixir, Absinthe How can I get user created after a date with absinthe?

I am trying to get users that were created before/after certain date and I get this error. "message": "Argument \"filter\" has invalid value $filter.\nIn field \"insertedAfter\": Expected type \"NaiveDateTime\", found \"2018-05-13\".", The error…
4
votes
2 answers

How should I manage inserting into related tables

I have an account table that links to an emails table, roughly as follows: Currently, my changeset on accounts uses cast_assoc to pull in the email: |> cast_assoc(:emails, required: true, with: &Email.changeset(&1, &2)) But this means I need to…
cnorris
  • 548
  • 4
  • 12
3
votes
1 answer

GraphQL Elixir/Phoenix API: Socket hang up with large json response

New to Elixir/Phoenix and GraphQL. I have created a simple API that retrieves "drawings" from a PostgreSQL database. The table consists of an "id" (uuid) and "drawing_json" (text). In the table is one row with a json string of about 77Kb. My schema…
mac
  • 485
  • 1
  • 6
  • 29
3
votes
2 answers

Absinthe - How to put_session in resolver function?

I'm using Absinthe and have a sign in mutation. When users send over valid credentials, I'd like to set a session cookie in the response via put_session. The problem I'm facing is that I'm not able to access the conn from within a resolver function.…
Raphael Rafatpanah
  • 19,082
  • 25
  • 92
  • 158
3
votes
1 answer

Dializer (via Dialyxir) warning about "but this value is unmatched" from `forward` command for Absinthe (GraphQL) route. How to address?

I am getting a dialyzer error about unmatched returns of which I'm not sure how to properly address. mix dialyzer --quiet lib/my_app_web/router.ex:1:no_return Function __checks__/0 has no local…
Loading...
  • 863
  • 9
  • 21
3
votes
1 answer

Handling Exceptions in Absinthe

The Issue There are a lot of guides available for handling error tuples in absinthe but next to zero for exceptions. This is important because there are always unforseen issues which might raise an exception and return a response that will not…
Sheharyar
  • 73,588
  • 21
  • 168
  • 215
3
votes
2 answers

Using `react-apollo-hooks` and `useSubscription` hook

I'm building a simple todo app using React, Apollo and react-apollo-hooks for hooks support, but the useSubscription hook doesnt fire. I know the actual backend stuff works, because I have a graphiql app set up, and whenever I save a todo, the…
gunnar2k
  • 185
  • 1
  • 13
3
votes
0 answers

How to use GraphQL Schema Stitching with Elixir Absinthe?

To be developed and deployed independently we want to decompose our schema into separate microservices within Erlang ecosystem using Elixir Absinthe, but it seems that they don't have ready this feature yet. So my question is. Is it posible using…
3
votes
2 answers

hex dependencies not found for elixir project - poison, absinthe

I am getting unchecked dependency for environment error for ecto.create and ecto.migrate. I have below mix.exs file dependency entry defp deps do [{:phoenix, "~> 1.3"}, {:phoenix_pubsub, "~> 1.0"}, {:phoenix_ecto, "~> 3.3"}, …
Vinayak
  • 55
  • 4
3
votes
1 answer

implementing authentication in Elixir Phoenix Absinthe GraphIQL client?

I use the built-in GraphiQL interface in Absinthe. As follows: pipeline :browser do plug RemoteIp, headers: ~w[x-forwarded-for], proxies: ~w[] plug :accepts, ["html", "json"] plug :fetch_session plug :fetch_flash plug…
raarts
  • 2,711
  • 4
  • 25
  • 45
3
votes
2 answers

Graphql Absinthe Elixir permission based accessible fields

What is the proper way to define fields that may not be accessible to all users. For example, a general user can query the users and find out another users handle, but only admin users can find out their email address. The user type defines it as a…
Zerfar
  • 33
  • 3
1
2 3 4 5 6