-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
blueprint inside telemetry events comes out as Inspect.Error when in IEx #1185
Comments
I could not reproduce this. Do you have a step by step guide on getting this error? |
This is likely related to another bug but we will need to see a more concrete schema example that reproduces this to narrow it down a bit more |
I can send a example schema since it happens on any request in our app, just OOO this week but I'll be back in Monday |
Using defmodule FSGraphQL.GraphQL.Schema do
use Absinthe.Schema
@schema_provider Absinthe.Schema.PersistentTerm
import_types(Absinthe.Type.Custom)
def list_features(_, _, _), do: {:ok, []}
@desc "Metric source types"
enum :source_type do
value(:space_area, as: :spacearea, description: "Area")
value(:metric, as: "Metric", description: "Calculated metric")
end
object :branches do
field :global_id, :string
field :description, :string
field :source, :source_type
end
input_object :global_id_filter do
field :global_id, :string
end
query do
field :all_branches, list_of(:branches) do
arg(:filter, :global_id_filter)
resolve(&list_features/3)
end
end
end Then inspecting #Inspect.Error<
got RuntimeError with message:
"""
Unexpected nil
"""
while inspecting:
[... schema struct ...]
Stacktrace:
(absinthe 1.7.6) lib/absinthe/schema/notation/sdl_render.ex:246: Absinthe.Schema.Notation.SDL.Render.render/2
(elixir 1.15.7) lib/enum.ex:1693: Enum."-map/2-lists^map/1-1-"/2
(absinthe 1.7.6) lib/absinthe/schema/notation/sdl_render.ex:51: Absinthe.Schema.Notation.SDL.Render.render/2
(absinthe 1.7.6) lib/absinthe/schema/notation/sdl_render.ex:12: Absinthe.Schema.Notation.SDL.Render.inspect/2
(elixir 1.15.7) lib/inspect/algebra.ex:348: Inspect.Algebra.to_doc/2
(elixir 1.15.7) lib/kernel.ex:2366: Kernel.inspect/2
(iex 1.15.7) lib/iex/evaluator.ex:375: IEx.Evaluator.io_inspect/1
(iex 1.15.7) lib/iex/evaluator.ex:334: IEx.Evaluator.eval_and_inspect/3
(iex 1.15.7) lib/iex/evaluator.ex:305: IEx.Evaluator.eval_and_inspect_parsed/3
(iex 1.15.7) lib/iex/evaluator.ex:294: IEx.Evaluator.parse_eval_inspect/4
(iex 1.15.7) lib/iex/evaluator.ex:187: IEx.Evaluator.loop/1
(iex 1.15.7) lib/iex/evaluator.ex:32: IEx.Evaluator.init/5
(stdlib 5.1.1) proc_lib.erl:241: :proc_lib.init_p_do_apply/3 Making a Blueprint "by hand" does not render either: %Absinthe.Blueprint{}
%Absinthe.Blueprint{name: "My Model", schema: FSGraphQL.GraphQL.Schema, schema_definitions: [%Absinthe.Blueprint.Schema.SchemaDefinition{schema_declaration: "MyModel"}]}
%Absinthe.Blueprint{name: "Urban Model", schema: FSGraphQL.GraphQL.Schema, schema_definitions: [%Absinthe.Blueprint.Schema.SchemaDefinition{schema_declaration: "UrbanModel"}]} These kick up various errors, including: #Inspect.Error<
got MatchError with message:
"""
no match of right hand side value: %Absinthe.Blueprint{operations: [], directives: [], fragments: [], name: nil, schema_definitions: [], schema: nil, prototype_schema: nil, adapter: nil, initial_phases: [], telemetry: %{}, flags: %{}, errors: [], input: nil, source: nil, execution: %Absinthe.Blueprint.Execution{adapter: nil, schema: nil, fragments: %{}, fields_cache: %{}, validation_errors: [], result: nil, acc: %{}, context: %{}, root_value: %{}}, result: %{}}
"""
>
#Inspect.Error<
got FunctionClauseError with message:
"""
no function clause matching in Absinthe.Schema.Notation.SDL.Render.render/2
"""
>
I'm not sure what the expectations are for completeness / setup of these structs, but the renderer seems to fail with default constructions, bare bones manual constructions, and schemas generated from modules. This is true whether or not The only reliable way I can see any useful output is to run the struct through |
Environment
Expected behavior
We get the blueprint struct instead of an
Inspect.Error
Actual behavior
Inspect.Error
on theblueprint
field in the[:execute, :operation, :stop]
event when using fragments or subscriptionsRelevant Schema/Middleware Code
In an iex shell when printing it out you get
The text was updated successfully, but these errors were encountered: