zorn
zorn
AEAsh Elixir
Created by zorn on 8/25/2023 in #support
Do I have to manually make a `node` query in Absinthe to honor Global Object Identification?
I am using a SvelteKit library called Houdini to consume a GraphQL endpoint I am creating in Ash. I've intentionally marked my graphql, queries, list with relay?: true per the docs: https://ash-hq.org/docs/dsl/ash-resource#graphql-queries-list-relay- While pulling the schema for the frontend code, I get this error:
npx houdini generate -l full
🎩 Generating runtime...
⚠️ Your project defines a Node interface but it does not conform to the Global Identification Spec.

If you are trying to provide the Node interface and its field, they must look like the following:

interface Node {
id: ID!
}

extend type Query {
node(id: ID!): Node
}

For more information, please visit these links:
- https://graphql.org/learn/global-object-identification/
- https://houdinigraphql.com/guides/caching-data#custom-ids
npx houdini generate -l full
🎩 Generating runtime...
⚠️ Your project defines a Node interface but it does not conform to the Global Identification Spec.

If you are trying to provide the Node interface and its field, they must look like the following:

interface Node {
id: ID!
}

extend type Query {
node(id: ID!): Node
}

For more information, please visit these links:
- https://graphql.org/learn/global-object-identification/
- https://houdinigraphql.com/guides/caching-data#custom-ids
My observation is that my AshGraph is generating the
interface Node {
id: ID!
}
interface Node {
id: ID!
}
part just fine, but I do not see the
extend type Query {
node(id: ID!): Node
}
extend type Query {
node(id: ID!): Node
}
Is the expectation that I should have to write a manual node query and resolver inside the Absinthe schema file such that my graph honored the Global Object Identification spec? Or is there someway to nudge AshGraph to generate this for me?
20 replies
AEAsh Elixir
Created by zorn on 8/17/2023 in #showcase
[VIDEO] Early thoughts on using Ash Framework to produce a GraphQL API.
👨‍💻 In this video, I speak to some ideas about a future project and my current experiments around different technologies, specifically the Elixir Ash Framework, and using it to produce GraphQL endpoints. https://www.youtube.com/watch?v=ZeMuXWrRq80
7 replies
AEAsh Elixir
Created by zorn on 8/17/2023 in #support
Is the structure from the auto-generated graph filters from some spec?
No description
8 replies
AEAsh Elixir
Created by zorn on 8/15/2023 in #support
Trying to better understand filter in the context of AshGraph
I am trying to work through some basics of AshGraph, and in the guide it has you set up a filter with code like:
read :query_tickets do
argument :representative_id, :uuid

filter(
expr do
is_nil(^arg(:representative_id)) or representative_id == ^arg(:representative_id)
end
)
end
read :query_tickets do
argument :representative_id, :uuid

filter(
expr do
is_nil(^arg(:representative_id)) or representative_id == ^arg(:representative_id)
end
)
end
https://ash-hq.org/docs/guides/ash_graphql/latest/graphql-generation#filter-data-with-arguments I'm having trouble understanding what is going on here. I am particularly confused about the is_nil check and why this is an or. When I run a query like:
query($representativeId: ID) {
listTickets(representativeId: $representativeId) {
id
representativeId
}
}

{"representativeId": "b6b74a04-a49f-43a5-87fb-bc1a91ad723f"}
query($representativeId: ID) {
listTickets(representativeId: $representativeId) {
id
representativeId
}
}

{"representativeId": "b6b74a04-a49f-43a5-87fb-bc1a91ad723f"}
It works as expected (I only get back tickets with that representativeId. But then, when I try:
query($representativeId: ID) {
listTickets(representativeId: $representativeId) {
id
representativeId
}
}

{"representativeId": null}
query($representativeId: ID) {
listTickets(representativeId: $representativeId) {
id
representativeId
}
}

{"representativeId": null}
I get back all tickets, those with a null representativeId and those with a proper id. My code is here in case that helps provide context: https://github.com/zorn/helpdesk-elixir-api
28 replies
AEAsh Elixir
Created by zorn on 5/27/2023 in #support
What is the difference between `mix ecto.create` and `mix ash_postgres.create`.
In my early experiments, they seem to do the same thing, but not sure if I am missing something. Maybe this is mostly for the --apis flag thing? https://ash-hq.org/docs/mix_task/ash_postgres/latest/ash_postgres-create
4 replies