Absinthe.Relay.Node.ParseIDs causes runtime error if occurs more than once in a mutation query.
This happens because in mutation.ex, __parse_ids_root is set at a global level on the resolution.
Once the ParseIDs.ex middleware is hit, it works great from a parent mutation but if ParseIDs is called in any of the child fields it blows up because it is expecting input to be set when it isn't for the child field.
This does two things:
pattern matches on find_schema_root! so that it will identify if it is the parent mutation by matching on the
Absinthe.Relay.Node.ParseIDs causes runtime error if occurs more than once in a mutation query.
This happens because in
mutation.ex
,__parse_ids_root
is set at a global level on the resolution.Once the
ParseIDs.ex
middleware is hit, it works great from a parent mutation but ifParseIDs
is called in any of the child fields it blows up because it is expectinginput
to be set when it isn't for the child field.This does two things:
find_schema_root!
so that it will identify if it is the parent mutation by matching on thestructure.
The other pattern-match function is for the child fields.
modern.ex
andclassic.ex
modules in that theabsinthe_relay: list
was being generated in a different order.For modern, it was getting generated as:
And classic was getting generated as:
I reordered the macro in the
classic.ex
so that the list generated will be the same for both modern and classic and enable the pattern-match to work.