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
2
votes
0 answers

How to jump to a specific date in a cursor based relay pagination?

I’ve got a cursor base paginated relay connection which is ordered by a startDatetime timestamp. The query looks like this; query UnassignedShiftsQuery($first: Int, $cursor: String) { user { id unassignedShifts(first: $first, after: $cursor)…
james2m
  • 1,562
  • 12
  • 15
2
votes
1 answer

Mapping elixir absinthe input_object to single data structure

Is there some way to map an input_object into a single data structure? input_object(:numrange) do field :start, non_null(:integer) do resolve(fn field, _, _ -> ... end) end field :end, non_null(:integer) do …
atomkirk
  • 3,701
  • 27
  • 30
2
votes
1 answer

Is there a way to force disconnect an absinthe graphql subscription from the server side?

The Phoenix app I’m working on creates subscriptions to the changes on a document as long as that document is “public”. If someone changes their document to “private”, though, I don’t want those subscriptions to continue receiving updates. I know…
neurodynamic
  • 4,294
  • 3
  • 28
  • 39
2
votes
1 answer

How do I know what Phoenix and Absinthe are doing in terms of process spawning and message sending?

I have an Elixir Umbrella app, with Phoenix, Absinthe (graphQL). In AppWeb, my AppWeb.Router routes requests, handling /graphql with Absinthe.Plug and using MyApp.Schema. In AppWeb.Schema, I import objects from numerous different schemas in…
alexexchanges
  • 3,252
  • 4
  • 17
  • 38
2
votes
1 answer

Absinthe isn't able to serialize a nested map, yet it is able to serialize a top level map

I am trying to resolve the following (this is the return value of my resolver function, and I am passing it to the resolve macro): {:ok, %{ collection: nil, errors: %{ recoverable: [ %{ __exception__: true, …
mackshkatz
  • 861
  • 8
  • 19
2
votes
1 answer

[Network error]: TypeError: Network request failed

I am trying apollo for the first time. My backend server is Phoenix framework(elixir). and running in http://localhost:4000/api So I tried to do a first query using apollo like this in my code. import React from 'react'; import { StyleSheet, Text,…
freewebwithme
  • 429
  • 12
  • 22
2
votes
2 answers

I don't get GraphQL. How do you solve the N+1 issue without preloading?

A neighborhood has many homes. Each home is owned by a person. Say I have this graphql query: { neighborhoods { homes { owner { name } } } } I can preload the owners, and that'll make…
Sergio Tapia
  • 9,173
  • 12
  • 35
  • 59
2
votes
1 answer

Unknown argument in an otherwise correct GraphQL query with Absinthe backend

I'm running an Absinthe query, with three argument fields, all of them lists of integers. @desc "Fetches resolutions of Taiga ids" field :taiga_ids, :taiga_entities do arg :usIds, list_of(:integer) arg :taskIds, list_of(:integer) arg…
Sebastialonso
  • 1,437
  • 18
  • 34
2
votes
1 answer

Dynamic identifier with macros

I'm using macros and I want to pass a dynamic identifier to an Absinthe macro enum, wanting to generate different enums with a set list. Everything is inside a for comprehension. I've read that Kernel.apply/3 does not work on macros. I've also…
2
votes
1 answer

Elixir: Using Absinthe to query Dgraph, a graph database. GraphQL to GraphQL+ mapping

I am using Absinthe to build a GraphQL API. The datastore is Dgraph, which uses GraphQL+ as query language. It is similar to GraphQL but not identical. This would in theory put me in a wonderful situation. A GraphQL query like query { user { …
Ole Spaarmann
  • 15,845
  • 27
  • 98
  • 160
2
votes
1 answer

How to use arguments on nested items in my query using Absinthe in Elixir?

I'm trying to find out how to use arguments on nested items in my query using Absinthe. What I try to accomplish is this: { users(order: ASC) { id email clients(order: DESC) { id email } } } Here's my Schema and…
Gulliver
  • 103
  • 1
  • 8
2
votes
1 answer

Many-to-many on the same table in Phoenix

Using Ecto v2.2.6, Phoenix 1.3 I have a table of people (who happen to be related to each other), and another table of relations for those people. The relations table lists the id of the parent in one column, and the id of the child in another. mix…
Mark Karavan
  • 2,654
  • 1
  • 18
  • 38
1
vote
1 answer

Elixir Absinthe GraphQL, Union resolve_type list_of/1

I need help. I'm looking for a way to resolve a list_of(:object) in union. Here's what I did. object :community_queries do field :search, type: :search_result do arg(:keyword, non_null(:string)) resolve(&CommunityResolver.search/3) …
Dyey517
  • 426
  • 5
  • 15
1
vote
0 answers

Apollo client & Absinthe - difficulty parsing errors

I'm working with the @apollo/client and @absinthe/socket-apollo-link NPM packages in my React app, but I'm having some trouble parsing query and mutation errors received by onError in my implementation of the useQuery and useMutation hooks. For…
skwidbreth
  • 7,888
  • 11
  • 58
  • 105
1
vote
1 answer

Absinthe union type resolver providing an empty map to object field resolver

I'm trying to implement a GraphQL union type in Absinthe. We have two objects, :foo and :bar and a union type :info that resolves to one of those types. object :contact do field :info, list_of(:info) end object :foo do field :phone,…
Raphael Rafatpanah
  • 19,082
  • 25
  • 92
  • 158