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)…
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
…
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…
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…
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,
…
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,…
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…
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…
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…
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 {
…
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…
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…
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)
…
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…
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,…