From b3540a909bbdc41c0bafac58b6c42cabc83d49c7 Mon Sep 17 00:00:00 2001 From: Riccardo Binetti Date: Thu, 18 Jan 2024 01:17:35 +0100 Subject: [PATCH] WIP: node query --- lib/api/api.ex | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/lib/api/api.ex b/lib/api/api.ex index 5cc496c3..43dbd4a5 100644 --- a/lib/api/api.ex +++ b/lib/api/api.ex @@ -173,6 +173,39 @@ defmodule AshGraphql.Api do [] end + # TODO + # Node query makes sense only if we have global IDs + # node_query = + # if relay_ids? do + # [ + # %Absinthe.Blueprint.Schema.FieldDefinition{ + # arguments: [ + # %Absinthe.Blueprint.Schema.InputValueDefinition{ + # name: "id", + # identifier: :id, + # type: %Absinthe.Blueprint.TypeReference.NonNull{ + # of_type: :id + # }, + # description: "The Node unique identifier", + # __reference__: AshGraphql.Resource.ref(env) + # } + # ], + # identifier: :node, + # middleware: [ + # {AshGraphql.Graphql.Resolver, :resolve_node} + # ], + # complexity: {AshGraphql.Graphql.Resolver, :query_complexity}, + # module: schema, + # name: "Node", + # description: "Retrieves a Node from its global id", + # type: %Absinthe.Blueprint.TypeReference.NonNull{of_type: :node}, + # __reference__: AshGraphql.Resource.ref(__ENV__) + # } + # ] + # else + # [] + # end + relay_types ++ resource_types else resource_types