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
1
vote
0 answers

Unable to find item in batch Absinthe Dataloader

After upgrading absinthe from 1.4.12 to 1.5.2, ecto from 2.1 to 3.0 and dataloader from 1.0.2 to 1.0.7 I've been having some issues with dataloader not finding items in batch. I tried to follow the steps pointed by deepankar-j at…
Renan
  • 11
  • 2
1
vote
1 answer

Absinthe result has all null values

I'm totally new to Elixir, Phoenix, and Absinthe...so go easy on me. :) I'm experimenting with a graph database called Dgraph using a library called Dlex. I've written a simple query designed to look up and return a list of users (I only have two…
Rob Johansen
  • 5,076
  • 10
  • 40
  • 72
1
vote
1 answer

Efficiently resolving belongs_to relationship in elixir dataloader?

Is it possible to use elixir dataloader to query a belongs_to relationship efficiently? It seems that the load is querying all of the items it needs, but the get is returning the first value of the loaded items regardless of which single item it…
Craig
  • 139
  • 1
  • 5
1
vote
2 answers

How to do graphql subscriptions with Absinthe (Elixir) and Urql?

My idea was to build a client app using react and urql and a graphql api using elixir and absinthe but at the moment it looks as if these don't really play that well together. Is there a way to actually use the Absinthe subscriptions with any other…
1
vote
1 answer

Representing Elixir/Ecto associations in GraphQL with absinthe

I've added a many to many association to a couple of my models and it seems to work fine in isolation--meaning w/o the GraphQL schema declarations. Here is the code for one of my models: use Ecto.Schema import Ecto.Changeset alias…
jaydel
  • 14,389
  • 14
  • 62
  • 98
1
vote
1 answer

Absinthe - Response formatting %{data: %{id: 1, name: "Bob"}} vs %{data: %{createUser: %{id: 1, name: "Bob"}}}

What's the correct way to format a response, and how would I go about it? In example I see online, the response data is never nested inside a key with the mutation name Here's the request mutation CreateUser($input: CreateUserInput!) { …
Peter R
  • 3,185
  • 23
  • 43
1
vote
1 answer

Allowing a multipart (image) upload through GraphQL for Elixir backend

I was hoping to get a clearer understand where I may be going wrong. Sorry if I ask a lot of questions since I feel a bit lost and been stuck for about a week on this one. Currently, I've changed the package I was using for linking with…
Yama
  • 401
  • 1
  • 8
  • 22
1
vote
2 answers

Why doesn't my registration mutation work with the role field?

Why doesn't my registration mutation work with the role field? I written the following code but can't figure out why my role enum doesn't work with my mutation. I uploaded my code to github Github code. The registration mutation works: mutation{ …
itwolfpower
  • 306
  • 3
  • 11
1
vote
1 answer

How do I use Absinthe Dataloader for many to many relationships

In my phoenix application, I have a many to many relationship between an Artist and a Cause schema implemented using a join table artists_causes. In my Artist schema, I have many_to_many :causes, Cause, join_through: "artists_causes" and in the…
Mike Aono
  • 859
  • 2
  • 11
  • 17
1
vote
1 answer

How to request graphql query without extensions?

Hi i want to request graphql query from server. But it always return bunch of log in extensions field. My question is how can i modify my graphql query below to discard extensions. Here is my graphql query: query { myProfile { …
1
vote
0 answers

How to handle multiple optional arguments in Absinthe GraphQL resolver while constructing a query in a DSL?

Imagine a GraphQL query like this: Query { projects(platforms: [String], languages: [String]) } And a Neo4j graph containing nodes labeled Project, Platform and Language. When none of the optional arguments are passed, the resolver should return…
StargazingTux
  • 59
  • 1
  • 5
1
vote
1 answer

Applying filters on subscriptions

Im trying to apply filters in subscription but I’m having some trouble in the resolver file. the absinth resolution requires as a parameter a {:ok, params} o {:error,params } so it can execute, the problem is that everything y send appears at my…
Gerardo Davila
  • 161
  • 1
  • 1
  • 7
1
vote
0 answers

Subscription with Authorization: Skip trigger if condition isn't met

I have a Phoenix web application and am using Absinthe for subscriptions that are triggered whenever a new Comment is added to a Topic. I am trying to send a subscription only if the user is a member of a topic, and otherwise not send something at…
Sheharyar
  • 73,588
  • 21
  • 168
  • 215
1
vote
1 answer

How to resolve sub-fields such that they add optional parameters to HTTP query?

Note: this is a greatly simplified example but the problem is the same. I am trying to wrap an existing HTTP service, /blog-posts, with a GraphQL interface. The service returns some extra data in its response only if I pass in a query parameter,…
Yawar
  • 11,272
  • 4
  • 48
  • 80
1
vote
2 answers

Absinthe Graphql nested queries security

I've been reading that it is important to secure your applications with the a Maximum Query Depth. Meaning, to limit the number of "levels" that the query has. Example of a very deep query: query IAmEvil { author(id: "abc") { posts { …